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

Implemented hiding of outdated bot comments - #1976 #6550

Merged
merged 96 commits into from
May 27, 2024

Conversation

iancooperman
Copy link
Member

Fixes #1976

What changes did you make?

  • Added code that hides bot "update" comments older than 7 days.

Why did you make the changes (we will use this info to test)?

  • To improve readability of issue histories.

@iancooperman
Copy link
Member Author

@roslynwythe Sorry it's taken so long, but I've added the wait. Go ahead and try it out again when you get the chance.

@roslynwythe
Copy link
Member

@iancooperman Using a PAT with the "repo" group of scopes in my fork of the repo, all of the "please add update" bot comments older than 7 days were hidden successfully. Thank you for adding the wait and your patience with changing the token. Prior to merge we need to create HACKFORLA_REPO_TOKEN. Please advise @t-will-gillis, if you would like me to create that secret.

@t-will-gillis
Copy link
Member

Hi @roslynwythe and @iancooperman because of another automation's requirements, the HACKFORLA_ADMIN_TOKEN also needed the "repo" scope. It now has the following scopes so I believe it will work for this automation:

  • repo
  • admin:org_hook
  • write:org

@iancooperman sorry for the delay- I will try to look at this tonight.

@t-will-gillis t-will-gillis self-requested a review May 9, 2024 04:01
Copy link
Member

@t-will-gillis t-will-gillis left a comment

Choose a reason for hiding this comment

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

Hey @iancooperman - Great job. I tested this and for an issue in the "In Progress (actively working)" column, the bot-generated comments older than 7 days are being hidden.

As I mentioned in a previous comment, the HACKFORLA_ADMIN_TOKEN is already upgraded to include the "repo" scope because it was needed for a different automation, and so it can be used to replace HACKFORLA_REPO_TOKEN.

I noticed a few more things that aren't having a negative impact on the code, but that likely (?) CodeQL will flag at some point. (Many/ most are from before you worked on it)

  • There are a lot of missing semi-colons: eg. lines 15-20, 47-48, 52, 93, 97, 100, and many more

I triggered CodeQL on a fork and it found:

  • Line 43: this variable not being used
  • Line 118: variable not being used
  • Line 286 logins missing a declaration
  • Line 278 assigneesLogins missing a declaration

I am not sure why thus far the main repo's CodeQL has not flagged these, but might be worth it to fix these (potential) alerts.

To recap about the token, these are the scopes for HACKFORLA_ADMIN_TOKEN:

  • repo ('Full control of private repositories')
  • admin:org_hook
  • write:org (under 'admin:org')

Submitting this as a comment for right now. Thanks for your ongoing work...

@iancooperman
Copy link
Member Author

@t-will-gillis @roslynwythe I just changed the name of the secret in schedule-fri-0700.yml. Anything else I can do?

Copy link
Member

@t-will-gillis t-will-gillis left a comment

Choose a reason for hiding this comment

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

Hi @iancooperman

  • The file ga-hide-old-comments-1976.code-workspace is included in the commit - what is this file?
  • In add-label.js:
    • please confirm whether the variable at line 118 is being used, if not please remove
    • there are extra spaces on line 142. please remove
    • extra line at 189, please remove
    • to prevent future CodeQL alerts, please add semi-colon at end of line 154

Thanks

@iancooperman
Copy link
Member Author

Hi @iancooperman

  • The file ga-hide-old-comments-1976.code-workspace is included in the commit - what is this file?

  • In add-label.js:

    • please confirm whether the variable at line 118 is being used, if not please remove
    • there are extra spaces on line 142. please remove
    • extra line at 189, please remove
    • to prevent future CodeQL alerts, please add semi-colon at end of line 154

Thanks

ETA: 5/16 EoD
Availability: 5/16 6pm-9pm

@iancooperman
Copy link
Member Author

iancooperman commented May 17, 2024

@t-will-gillis I've made the requested changes in add-label.js. ga-hide-old-comments-1976.code-workspace was mistakenly pushed when I was exploring VS Code's workspace settings. It has now been deleted.

Copy link
Member

@t-will-gillis t-will-gillis left a comment

Choose a reason for hiding this comment

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

Hey @iancooperman Fantastic- I did one final test and everything seems to be working as intended.

Thanks for all of your work on this!

@Thinking-Panda
Copy link
Member

Hi @roslynwythe Whenever possible please add you availability and ETA for this PR. Thanks!

Copy link
Member

@roslynwythe roslynwythe left a comment

Choose a reason for hiding this comment

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

Thank you @iancooperman for your work on this complex issue.

@roslynwythe roslynwythe merged commit 63a016a into hackforla:gh-pages May 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours time sensitive Needs to be worked on by a particular timeframe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub Actions: Automate In Progress Issue Updates: Hide Old Comments
4 participants