Skip to content

chore: create /add-sub-issue and /remove-sub-issue commands #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

andyatmiami
Copy link
Contributor

@andyatmiami andyatmiami commented May 21, 2025

related: #325

This new GitHub Actions workflow listens for issue comments and processes commands to add or remove sub-issues using the Javascript client. It includes error handling and posts feedback to the issue for auditability as well as if any errors occur during execution.

Acceptable input formats (and multiple space-delimited arguments can be provided):

/add-sub-issue #1
/add-sub-issue 1
/add-sub-issue https://github.com/kubeflow/notebooks/issues/1

Additionally, the entirety of a comment is scanned/parsed by the GHA - so the following is also valid:

we need these!

/add-sub-issue #1 #2

and we don't need these

/remove-sub-issue #3 #4
  • this would add issues 1 and 2 and remove issues 3 and 4 from the "parent" issue on which the comment was added.

ℹ️ Be mindful of underlying constraints enforced in GH regarding sub-issues:

  • An issue can only be a sub-issue to 0 or 1 issues
  • Trying to add an issue as a sub-issue when it is already assigned as a sub-issue results in error

Also, in this commit, the ability to assign sub-issues is open to a set of users defined in the workflow yaml as a JSON string array within the job-level if conditional. The current collection identifies all epic owners and technical leaders for Notebooks 2.0.

Please note the workflow YAML file has been named generically to potentially house other "slash commands" in the future although the current implementation is only focused on /add-sub-issue and /remove-sub-issue.

To "see" the code in action and test it out - you can see this issue here on a personal repo of mine I was using to test/construct the code:

@paulovmr
Copy link

/ok-to-test

uses: actions/github-script@v7
with:
script: |
const parseIssueNumber = (input) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems hard to maintain this code as a giant string.
Can we move the code to an external JS file under, possibly, .github/scripts folder and call it here?
At least, we'd have a few IDE capabilities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to get @thesuperzapper to weigh in on his preferences here... I don't really see the external files pattern used elsewhere in kubeflow repositories - and don't really want to deviate unless we get an established community member to speak in favor of the change.

I totally appreciate and understand the motivation behind the ask, however!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to leave this inline, as the script is specific to the context of actions/github-script@v7 and there is only one usage of this in the kubeflow org (and even notebooks project) right now.

@andyatmiami andyatmiami force-pushed the feat/sub-issue-ghas branch from 93a9d94 to e232d50 Compare July 8, 2025 19:55
@google-oss-prow google-oss-prow bot added the area/ci area - related to ci label Jul 8, 2025
@andyatmiami andyatmiami force-pushed the feat/sub-issue-ghas branch from e232d50 to 34e2f9d Compare July 16, 2025 16:30
@thesuperzapper thesuperzapper changed the base branch from notebooks-v2 to main July 24, 2025 20:19
@google-oss-prow google-oss-prow bot added size/XXL and removed size/L labels Jul 24, 2025
related: kubeflow#325

This new GitHub Actions workflow listens for issue comments and processes commands to add or remove sub-issues using the Javascript client. It includes error handling and posts feedback to the issue for auditability as well as if any errors occur during execution.

Acceptable input formats (and multiple space-delimited arguments can be provided):
```
/add-sub-issue #1
/add-sub-issue 1
/add-sub-issue kubeflow#1
```

:information_source: Be mindful of underlying constraints enforced in GH regarding sub-issues:
- An issue can only be a sub-issue to 0 or 1 issues
- Trying to add an issue as a sub-issue when it is already assigned as a sub-issue results in error

Also, in this commit, the ability to assign sub-issues is open to a set of users defined in the workflow yaml as a JSON string array within the job-level `if` conditional.  The current collection identifies all epic owners and technical leaders for Notebooks 2.0.

Please note the workflow YAML file has been named generically to potentially house other "slash commands" in the future although the current implementation is only focused on `/add-sub-issue` and `/remove-sub-issue`.

Signed-off-by: Andy Stoneberg <[email protected]>
@andyatmiami andyatmiami force-pushed the feat/sub-issue-ghas branch from 34e2f9d to e418374 Compare July 24, 2025 20:26
@google-oss-prow google-oss-prow bot added size/L and removed size/XXL labels Jul 24, 2025
@thesuperzapper thesuperzapper changed the title feat: manage sub-issues through "slash commands" in issue comments chore: create /add-sub-issue and /remove-sub-issue commands Jul 24, 2025
@thesuperzapper
Copy link
Member

Thanks, hopefully this solves the problem with permissions to add sub-issues.

/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thesuperzapper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit fddbff9 into kubeflow:main Jul 24, 2025
7 of 8 checks passed
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in Kubeflow Notebooks Jul 24, 2025
@andyatmiami andyatmiami deleted the feat/sub-issue-ghas branch August 6, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants