Skip to content
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

[Issue #2495] Set points and sprint on close #2519

Merged
merged 9 commits into from
Oct 21, 2024

Conversation

widal001
Copy link
Collaborator

@widal001 widal001 commented Oct 18, 2024

Summary

Adds new linter to set a default value for points and sprint if those fields are unset when an issue is closed.

Fixes #2495

Time to review: 5 mins

Changes proposed

What was added, updated, or removed in this PR.

  • Adds linters/scripts/set-points-and-sprint.sh
  • Adds associated queries:
    • linters/queries/getFieldMetadata.graqphql
    • linters/queries/getItemMetadata.graphql

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

This action will trigger every time an issue is closed in the repo.

Questions

  1. Do we only want to apply this to issues with a certain type (e.g. bug, task, etc.)
  2. Should we post a comment to the ticket if these field values are set?
  3. Are there other instances when this action shouldn't run (even if these fields are unset)?

TODO

  • Update script to handle dry run mode
  • Add CI test to ci-project-linters.yml
  • Potentially update script based on questions above

Additional information

Screenshots, GIF demos, code examples or output to help show the changes working as expected.

Here's an example of this action from our sandbox repo

Screen.Recording.2024-10-18.at.9.31.55.AM.mov

Here's an example of a dry run within this repo:

Screenshot 2024-10-18 at 3 17 08 PM

Creates scripts for a linter that sets the points and scripts fields to
a default value if those fields are unset when an issue is closed
@github-actions github-actions bot added the ci/cd label Oct 18, 2024
@coilysiren
Copy link
Collaborator

@widal001

Do we only want to apply this to issues with a certain type (e.g. bug, task, etc.)

a) You can either include:

  • Bug
  • Task
  • Enhancement
  • Deliverable

b) Or exclude

  • Epic

Option (a) sounds safer

Should we post a comment to the ticket if these field values are set?

Yes that sounds great! I love clarifying comments from bots

Are there other instances when this action shouldn't run (even if these fields are unset)?

If you can only include tick where { author is users in this repo with the permission level write access }, that would be ace. But we might get that for free? I dunno.

@widal001
Copy link
Collaborator Author

widal001 commented Oct 21, 2024

@coilysiren Thanks for the feedback above! I've implemented most of it in the following commits:

With two notes:

a) You can either include:

Bug
Task
Enhancement
Deliverable

I'm also skipping deliverable because Deliverable is meant to be a parent to Epic, and shouldn't really ever live in a given sprint.

If you can only include tick where { author is users in this repo with the permission level write access }, that would be ace. But we might get that for free? I dunno.

This is a bit trickier to do, but helpful to note. Maybe we can revisit if we find a lot of issues being accidentally added because they were closed by open source contributors.

Examples of new behavior

Here's an example of skipping an update because an issue is an Epic:

Screenshot 2024-10-21 at 11 16 27 AM

And here's a sample comment Note: Unfortunately unless we switch to a different auth structure for GitHub actions, the automations tied to my PAT will continue to be shown as coming from me, hence the "beep boop".

@widal001 widal001 marked this pull request as ready for review October 21, 2024 15:56
@coilysiren
Copy link
Collaborator

Unfortunately unless we switch to a different auth structure for GitHub actions, the automations tied to my PAT will continue to be shown as coming from me

@widal001 we definitely have a ticket for this... but I can't find it!

@@ -17,6 +17,7 @@ jobs:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ACCESS }}
UNSET_ISSUE: "https://github.com/HHS/simpler-grants-gov/issues/1932"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you expand on what UNSET_ISSUE means here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great callout! Just added some comments in this commit: docs: Explains what UNSET_ISSUE is in ci-project-linters.yml

coilysiren
coilysiren previously approved these changes Oct 21, 2024
Copy link
Collaborator

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

Looks good, just have a clarity comment

Copy link
Collaborator

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

Excited for this!

@widal001 widal001 merged commit 7cb3956 into main Oct 21, 2024
8 checks passed
@widal001 widal001 deleted the issue-2495-set-points-and-sprint branch October 21, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set points and sprint value for issues on close
2 participants