Skip to content

[Intermediate]: Refactor and test .github/workflows/bot-linked-issue-enforcer.yml to have daily closes #1863

Description

@exploreriii

🧩 Intermediate Contributors

This issue is intended for contributors who already have some familiarity with the
Hiero Python SDK codebase and contribution workflow.

You should feel comfortable:

  • navigating existing source code and examples
  • understanding SDK concepts without step-by-step guidance
  • following the standard PR workflow without additional onboarding

If this is your very first contribution to the project, we recommend starting with a few
Good First Issues before working on this one.

🐞 Problem Description

We have
.github/workflows/bot-linked-issue-enforcer.yml
and
.github/scripts/linked_issue_enforce.js

These currently:

  • runs on Monday and Thursday
  • check a pull request has been open for 3 days
  • closes it if the pull request is not linked to an issue, or the person is not assigned

We would like to tighten these guards

The cron job should:

  • run daily at e.g. 2am UTC
  • check a pull request has been open for at least 12 hours
  • close if the pull request is not linked to an issue, or the person is not assigned to the issue

NOTE: this is a very sensitive workflow, because it can close PRs, you should take care to make minimal changes and test it works
To test it works, you'll need to simulate data and also run it on your fork with e.g. 5 minute windows
You want to ensure the dry mode continues to work and be an option
This is why it is an intermediate issue

💡 Expected Solution

Change the cron trigger to once a day and threshold that a PR will be closed as 12 hours not 3 days

🧠 Implementation Notes

Edit
.github/workflows/bot-linked-issue-enforcer.yml

change the cron trigger to daily at 2am UTC

change
DAYS_BEFORE_CLOSE: '3'
to
HOURS_BEFORE_CLOSE: '12'

Then edit
.github/scripts/linked_issue_enforce.js

ensuring a PR that is greater than 12 hours old will be closed if they are not linked to an issue, or if they are linked to an issue but not assigned

This needs to be robustly tested with real github data

✅ Acceptance Criteria

To merge this issue, the pull request must:

  • Fully address the problem described above
  • Follow existing project conventions and patterns
  • Include tests or example updates where appropriate
  • Pass all CI checks
  • Include a valid changelog entry
  • be a DCO and GPG key signed as git commit -S -s -m "chore: my change" with a GPG key set up

📚 Additional Context or Resources

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: criticalCritical, blocking, must fix immediatelyscope: CI/CDinvolves continuous integration or deliveryskill: intermediaterequires some knowledge of the codebase with some defined steps to implement or examples

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions