Skip to content

[Intermediate]: Create a workflow to copy over the issue labels, type to the PR labels #1716

@exploreriii

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

Our pull requests are not currently labelled.

Labels would be useful, for example, we can

  • assign priority
  • assign difficulty
    This means maintainers can focus on highly difficult/urgent tasks, and spent most of their time on those, and other team members that are building review skills can focus on easier PRs.
    By allocating review time more fruitfully, the SDK can progress more seemlessly

💡 Expected Solution

We do not want to manually label the PRs

We have a workflow in place that will remind users to link their PRs to the issue they are solving.

Once that is done, perhaps what we can do is copy over the labels from the issue they are solving.

  • We already label issues by priority, difficulty, type, etc.

🧠 Implementation Notes

🧠 How it works
PR gets opened / updated
Existing workflow checks if they have linked an issue
User self-links issue
New workflow fetches labels from those issues
Applies the same labels to the PR

We need a trigger:

.github/workflows/sync-issue-labels.yml

This should identify if:

  • has a linked issue

then it should trigger a logic script
and a logic script:
.github/scripts/sync-issue-labels.js

ensure:

  • is a pull request
  • is not a bot

it should copy over the labels

This should be tested as per
docs/sdk_developers/training/testing_forks.md

The idea is to merge your bot to your fork's main, enable issues in settings, create an issue (add and create labels exactly like ours), then create a PR, link it, and see if the labels copy over due to your workflow

Please make sure to keep the code tidy and maintainable
for example

  • extract all hard coded variables to the top, think about changes in the future
  • ensure things are separated out into small functions
  • ensure there is suficient logging so the action workflow can be used to debug the output
  • ensure the error handling has approrpiate logs or comments

✅ 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

Metadata

Metadata

Assignees

Labels

github_actionsPull requests that update Github Actions code.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