Skip to content

Upgrade gradle dependencies only if >=48h old#11293

Open
sarahchen6 wants to merge 8 commits into
masterfrom
sarahchen6/implement-48h-cooldown-for-gradle-dependencies
Open

Upgrade gradle dependencies only if >=48h old#11293
sarahchen6 wants to merge 8 commits into
masterfrom
sarahchen6/implement-48h-cooldown-for-gradle-dependencies

Conversation

@sarahchen6
Copy link
Copy Markdown
Contributor

What Does This Do

Only upgrade gradle dependencies if they are at least 48 hours old. This PR specifically addresses the “Update Gradle dependencies” workflow. This follows #11215

Motivation

Require a 48-hour cooldown on external dependencies to reduce the risk of zero-day vulnerabilities.

Additional Notes

This PR was largely written by AI with my guidance on requirements and testing, followed by my review and tweaks for readability.

I added python tests for the scripts, but the actual changes need to land on master before the workflow can be tested because the workflow depends on an octo-sts token that is only scoped to master.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@sarahchen6 sarahchen6 added tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels May 6, 2026
Base automatically changed from sarahchen6/implement-48h-cooldown to master May 6, 2026 23:48
@sarahchen6 sarahchen6 force-pushed the sarahchen6/implement-48h-cooldown-for-gradle-dependencies branch from 4efc512 to 5d9229e Compare May 7, 2026 13:00
@sarahchen6 sarahchen6 force-pushed the sarahchen6/implement-48h-cooldown-for-gradle-dependencies branch from 5d9229e to 355ced2 Compare May 7, 2026 13:02
@sarahchen6 sarahchen6 marked this pull request as ready for review May 7, 2026 14:04
@sarahchen6 sarahchen6 requested a review from a team as a code owner May 7, 2026 14:04
@sarahchen6 sarahchen6 requested review from AlexeyKuznetsov-DD and amarziali and removed request for a team May 7, 2026 14:04
@DataDog DataDog deleted a comment from dd-octo-sts Bot May 7, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 355ced273e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/scripts/dependency_age.py Outdated
@sarahchen6
Copy link
Copy Markdown
Contributor Author

Marking as draft, as I re-review

@sarahchen6 sarahchen6 marked this pull request as draft May 7, 2026 14:58
@sarahchen6 sarahchen6 marked this pull request as ready for review May 8, 2026 20:32
Comment thread .github/scripts/dependency_age.py
"validate-lockfiles",
"--baseline-dir", str(baseline_dir),
"--current-dir", str(current_dir),
"--metadata-file", str(metadata_file),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what are the use case in which the metadata are missing? How updating will look like ? (i.e. manual?)
Maintaining this looks uncomfortable but I'm maybe missing context on this switch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh good catch! At some point, I meant to add an "override" option via this metadata file path, for example if the artifact wasn't found on Maven Central, but this is unused now, so I'll remove it... Instead there's an automatic retry to get the artifact to hopefully address the case there is infra flakiness.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah sorry, a correction -- the --metadata-file is still used in these python tests to pass in timestamp values, but it's not used in the actual workflow


reverted_files = len(violations_by_file)
emit_outputs({"cutoff_at": format_datetime(cutoff), "reverted_files": reverted_files}, args.github_output)
print(f"Validated {len(changed)} changed coordinate(s) across {len(changed_by_file)} lockfile(s). {reverted_files} lockfile(s) reverted.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would it be worth listing on the PR what which artifact caused the push back?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Totally. Done in 5abefc4!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants