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

Add bot to manage stale PRs #5300

Merged
merged 9 commits into from
Feb 19, 2025
Merged

Add bot to manage stale PRs #5300

merged 9 commits into from
Feb 19, 2025

Conversation

bm1549
Copy link
Contributor

@bm1549 bm1549 commented Feb 19, 2025

What does this PR do?

Adds a GHA bot (written by Github) that will

  • Comment on and label stale PRs as stale after 60 days of inactivity
    • This resets after any update, including comments, edits, pushes, etc
  • Close PRs that are marked as stale without any action taken after 14 additional days
    • The branch will not be deleted so these can be easily re-opened

Provides the use of another label keep-open to avoid the bot check

Example output (excerpt below): https://github.com/DataDog/dd-trace-js/actions/runs/13418709485/job/37485897173?pr=5300

Recent PR
  [#5300] Pull request #5300
  [#5300] Found this pull request last updated at: 2025-02-19T17:30:47Z
  [#5300] The option only-labels (​[https://github.com/actions/stale#only-labels​)](https://github.com/actions/stale#only-labels%E2%80%8B)) was not specified
  [#5300] └── Continuing the process for this pull request
  [#5300] Days before pull request stale: 90
  [#5300] The pull request is not closed nor locked. Trying to remove the close label...
  [#5300] ├── The close-pr-label (​[https://github.com/actions/stale#close-pr-label​)](https://github.com/actions/stale#close-pr-label%E2%80%8B)) option was not set
  [#5300] └── Skipping the removal of the close label
  [#5300] This pull request does not include a stale label
  [#5300] The option any-of-labels (​[https://github.com/actions/stale#any-of-labels​)](https://github.com/actions/stale#any-of-labels%E2%80%8B)) was not specified
  [#5300] └── Continuing the process for this pull request
  [#5300] This pull request has no milestone
  [#5300] └── Skip the milestones checks
  [#5300] This pull request has no assignee
  [#5300] └── Skip the assignees checks
  [#5300] This pull request is not stale
  [#5300] The option ignore-updates (​https://github.com/actions/stale#ignore-updates​) is disabled. The stale counter will take into account updates and comments on this pull request to avoid to stale when there is some update
  [#5300] This pull request should not be stale based on the last update date the 19-02-2025 (2025-02-19T17:30:[47](https://github.com/DataDog/dd-trace-js/actions/runs/13418709485/job/37485897173?pr=5300#step:2:48)Z)
Old Issue
  [#4814] Issue #4814
  [#4814] Found this issue last updated at: 2024-10-23T11:06:05Z
  [#4814] The option only-labels (​[https://github.com/actions/stale#only-labels​)](https://github.com/actions/stale#only-labels%E2%80%8B)) was not specified
  [#4814] └── Continuing the process for this issue
  [#4814] Days before issue stale: -1
  [#4814] The issue is not closed nor locked. Trying to remove the close label...
  [#4814] ├── The close-issue-label (​[https://github.com/actions/stale#close-issue-label​)](https://github.com/actions/stale#close-issue-label%E2%80%8B)) option was not set
  [#4814] └── Skipping the removal of the close label
  [#4814] This issue does not include a stale label
  [#4814] The option any-of-labels (​[https://github.com/actions/stale#any-of-labels​)](https://github.com/actions/stale#any-of-labels%E2%80%8B)) was not specified
  [#4814] └── Continuing the process for this issue
  [#4814] This issue has no milestone
  [#4814] └── Skip the milestones checks
  [#4814] This issue has no assignee
  [#4814] └── Skip the assignees checks
  [#4814] This issue is not stale
  [#4814] The option ignore-updates (​[https://github.com/actions/stale#ignore-updates​)](https://github.com/actions/stale#ignore-updates%E2%80%8B)) is disabled. The stale counter will take into account updates and comments on this issue to avoid to stale when there is some update
  [#4814] This issue should be stale based on the last update date the 23-10-2024 (2024-10-23T11:06:05Z)
  [#4814] This issue should not be marked as stale based on the option days-before-issue-stale (​[https://github.com/actions/stale#days-before-issue-stale​)](https://github.com/actions/stale#days-before-issue-stale%E2%80%8B)) (-1)
Old PR
  [#4819] Pull request #4819
  [#4819] Found this pull request last updated at: 2024-10-24T13:28:11Z
  [#4819] The option only-labels (​[https://github.com/actions/stale#only-labels​)](https://github.com/actions/stale#only-labels%E2%80%8B)) was not specified
  [#4819] └── Continuing the process for this pull request
  [#4819] Days before pull request stale: 90
  [#4819] The pull request is not closed nor locked. Trying to remove the close label...
  [#4819] ├── The close-pr-label (​[https://github.com/actions/stale#close-pr-label​)](https://github.com/actions/stale#close-pr-label%E2%80%8B)) option was not set
  [#4819] └── Skipping the removal of the close label
  [#4819] This pull request does not include a stale label
  [#4819] The option any-of-labels (​[https://github.com/actions/stale#any-of-labels​)](https://github.com/actions/stale#any-of-labels%E2%80%8B)) was not specified
  [#4819] └── Continuing the process for this pull request
  [#4819] This pull request has no milestone
  [#4819] └── Skip the milestones checks
  [#4819] This pull request has no assignee
  [#4819] └── Skip the assignees checks
  [#4819] This pull request is not stale
  [#4819] The option ignore-updates (​[https://github.com/actions/stale#ignore-updates​)](https://github.com/actions/stale#ignore-updates%E2%80%8B)) is disabled. The stale counter will take into account updates and comments on this pull request to avoid to stale when there is some update
  [#4819] This pull request should be stale based on the last update date the 24-10-2024 (2024-10-24T13:28:11Z)
  [#4819] This pull request should be marked as stale based on the option days-before-pr-stale (​[https://github.com/actions/stale#days-before-pr-stale​)](https://github.com/actions/stale#days-before-pr-stale%E2%80%8B)) (90)
  [#4819] Marking this pull request as stale
  [#4819] This pull request is now stale
  [#4819] This pull request is already stale
  [#4819] Checking for label on this pull request
  [#4819] Pull request marked stale on: Wed Feb 19 2025 17:31:27 GMT+0000 (Coordinated Universal Time)
  [#4819] Checking for comments on pull request since: Wed Feb 19 2025 17:31:27 GMT+0000 (Coordinated Universal Time)
  [#4819] Comments that are not the stale comment or another bot: 0
  [#4819] Pull request has been commented on: false
  [#4819] Days before pull request close: 14
  [#4819] The option remove-stale-when-updated (​[https://github.com/actions/stale#remove-stale-when-updated​)](https://github.com/actions/stale#remove-stale-when-updated%E2%80%8B)) is: true
  [#4819] The stale label should not be removed
  [#4819] marked stale this run, so don't check for updates
  [#4819] Pull request has been updated since it was marked stale: false
  [#4819] Pull request has been updated in the last 14 days: true
  [#4819] Stale pull request is not old enough to close yet (hasComments? false, hasUpdate? true)
  [#4819] 4 operations consumed for this pull request

Motivation

Discussed with @BridgeAR and the Node.js group at Datadog and this would be helpful

In the future, this should be expanded to other DD OSS repos

Plugin Checklist

Additional Notes

Copy link

github-actions bot commented Feb 19, 2025

Overall package size

Self size: 8.76 MB
Deduped: 94.96 MB
No deduping: 95.48 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | @datadog/libdatadog | 0.4.0 | 29.44 MB | 29.44 MB | | @datadog/native-appsec | 8.4.0 | 19.25 MB | 19.26 MB | | @datadog/native-iast-taint-tracking | 3.3.0 | 13.77 MB | 13.78 MB | | @datadog/pprof | 5.5.1 | 9.79 MB | 10.17 MB | | protobufjs | 7.2.5 | 2.77 MB | 5.16 MB | | @datadog/native-iast-rewriter | 2.8.0 | 2.6 MB | 2.74 MB | | @opentelemetry/core | 1.14.0 | 872.87 kB | 1.47 MB | | @datadog/native-metrics | 3.1.0 | 1.06 MB | 1.46 MB | | @opentelemetry/api | 1.8.0 | 1.21 MB | 1.21 MB | | import-in-the-middle | 1.11.2 | 112.74 kB | 835.4 kB | | source-map | 0.7.4 | 226 kB | 226 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | lru-cache | 7.18.3 | 133.92 kB | 133.92 kB | | pprof-format | 2.1.0 | 111.69 kB | 111.69 kB | | @datadog/sketches-js | 2.1.0 | 109.9 kB | 109.9 kB | | lodash.sortby | 4.7.0 | 75.76 kB | 75.76 kB | | ignore | 5.3.2 | 53.63 kB | 53.63 kB | | shell-quote | 1.8.1 | 44.96 kB | 44.96 kB | | istanbul-lib-coverage | 3.2.0 | 29.34 kB | 29.34 kB | | rfdc | 1.3.1 | 25.21 kB | 25.21 kB | | @isaacs/ttlcache | 1.4.1 | 25.2 kB | 25.2 kB | | tlhunter-sorted-set | 0.1.0 | 24.94 kB | 24.94 kB | | limiter | 1.1.5 | 23.17 kB | 23.17 kB | | dc-polyfill | 0.1.4 | 23.1 kB | 23.1 kB | | retry | 0.13.1 | 18.85 kB | 18.85 kB | | semifies | 1.0.0 | 15.84 kB | 15.84 kB | | jest-docblock | 29.7.0 | 8.99 kB | 12.76 kB | | crypto-randomuuid | 1.0.0 | 11.18 kB | 11.18 kB | | ttl-set | 1.0.0 | 4.61 kB | 9.69 kB | | path-to-regexp | 0.1.12 | 6.6 kB | 6.6 kB | | koalas | 1.0.2 | 6.47 kB | 6.47 kB | | module-details-from-path | 1.0.3 | 4.47 kB | 4.47 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.51%. Comparing base (3b782cd) to head (d75c5ee).
Report is 50 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5300      +/-   ##
==========================================
- Coverage   81.16%   80.51%   -0.65%     
==========================================
  Files         482      488       +6     
  Lines       21522    21827     +305     
==========================================
+ Hits        17468    17574     +106     
- Misses       4054     4253     +199     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 19, 2025

Datadog Report

Branch report: brian.marks/stale-pr
Commit report: 215843e
Test service: dd-trace-js-integration-tests

✅ 0 Failed, 669 Passed, 0 Skipped, 14m 5.68s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Feb 19, 2025

Benchmarks

Benchmark execution time: 2025-02-19 21:01:15

Comparing candidate commit 62aaad9 in PR branch brian.marks/stale-pr with baseline commit 3b782cd in branch master.

Found 2 performance improvements and 0 performance regressions! Performance is the same for 913 metrics, 18 unstable metrics.

scenario:plugin-graphql-with-depth-and-collapse-on-18

  • 🟩 max_rss_usage [-89.145MB; -75.639MB] or [-9.420%; -7.993%]

scenario:plugin-graphql-with-depth-on-max-18

  • 🟩 max_rss_usage [-120.035MB; -110.633MB] or [-12.260%; -11.299%]

@bm1549 bm1549 changed the title WIP: Add bot to manage stale PRs Add bot to manage stale PRs Feb 19, 2025
@bm1549 bm1549 marked this pull request as ready for review February 19, 2025 17:49
@bm1549 bm1549 requested a review from a team as a code owner February 19, 2025 17:49
tlhunter
tlhunter previously approved these changes Feb 19, 2025
Copy link
Member

@tlhunter tlhunter left a comment

Choose a reason for hiding this comment

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

LGTM. I'd like to see this applied to all 8 tracers. I'd also like @bengl to review as well.

@bm1549 bm1549 requested a review from bengl February 19, 2025 19:31
bengl
bengl previously approved these changes Feb 19, 2025
Copy link
Collaborator

@bengl bengl left a comment

Choose a reason for hiding this comment

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

While I see time-based auto-closing as generally an anti-pattern, it's worth seeing whether the benefits outweigh the costs, and we're not going to know that until we try it.

tlhunter
tlhunter previously approved these changes Feb 19, 2025
@tlhunter tlhunter dismissed stale reviews from bengl and themself via d75c5ee February 19, 2025 21:25
@tlhunter
Copy link
Member

Be sure to squash merge

@bm1549 bm1549 enabled auto-merge (squash) February 19, 2025 21:26
@bm1549 bm1549 merged commit 0c7b06b into master Feb 19, 2025
391 of 394 checks passed
@bm1549 bm1549 deleted the brian.marks/stale-pr branch February 19, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants