Draft: automate weekly cross-repo dependency alert sync#195
Draft
ihalatci wants to merge 10 commits into
Draft
Conversation
…-sync-orchestrator
- update_pipfile() appends to [packages]/[dev-packages] when alert is for a transitive dep, so pipenv lock can pull the patched version. - Use >= constraint instead of == to avoid over-pinning. - Verify per-alert outcome by reading both Pipfile.lock files post-lock, classify as addressed / already-satisfied / failed. - Write summary JSON consumed by the workflow; print one line per alert. - Exit non-zero (no PRs opened) when no alerts are actually addressed. - Workflow: pass --summary-out, surface details in run summary, expose addressed-package list as step output, only close Dependabot PRs whose title matches a package we addressed (instead of closing all of them).
Defer requirements regeneration from the Python script to a workflow step that runs after the citus PR is created, so the header can reference `citusdata/citus#<PR_NUMBER>` (matching the existing convention) rather than a transient SHA.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements weekly cross-repo dependency alert orchestration (Sunday 02:00 UTC) driven by
packagingAppcredentials. Manual approval/merge of the resulting PRs is preserved.What this adds
Orchestrator workflow —
.github/workflows/dependency-security-sync.ymlworkflow_dispatchpackagingApptoken viaactions/create-github-app-token@v1(GH_APP_ID/GH_APP_KEYorg secrets)citusdata/citusautomation/dependency-security-sync(--base main)the-processrequirements.txtfiles usingpipenv requirementsagainst the updated lockfile, with headers pointing atcitusdata/citus#<CITUS_PR>(matching existing convention)--base master)author:app/dependabot in:title Bump <pkg>); leaves unrelated Dependabot PRs aloneSync script —
.github/scripts/security_sync.pyCLI:
--alerts <json> --citus-root <path> --summary-out <path>Behavior:
first_patched_versionper packagePipfiles (citussrc/test/regressand.devcontainer/src/test/regress):">=<patched>"<package> = ">=<patched>"under[packages]or[dev-packages]based on alert scope (runtimevsdevelopment), sopipenv lockwill pull a fixing versionpipenv lockin both regress treesapplied/already-satisfied/not-fixed/absent, with an overall verdict ofaddressed/already-satisfied/failedsync-summary.json({ "addressed": [...], "details": [...] }) consumed by the workflowPost-merge callback —
.github/workflows/dependency-security-post-merge.ymlmaster, computes the new image postfix from the merged SHA (-v<sha7>)image_suffixincitus/.github/workflows/build_and_test.ymlon the citus sync branch so the corresponding citus PR picks up rebuilt imagesDesign guarantees
first_patched_version, orpipenv lockfails), the workflow fails and opens nothing. Dependabot PRs are not closed.requirements.txtheaders referencecitusdata/citus#<PR_NUMBER>.Operational prerequisites
GH_APP_IDGH_APP_KEYpackagingAppGitHub App installed oncitusdata/citusandcitusdata/the-processwith at minimum:automation/dependency-security-syncKnown upstream blockers
At time of writing, the live
pyOpenSSLDependabot alerts on citus cannot be resolved by this automation becausemitmproxy 12.2.2(citus's git-pinned version) declarespyOpenSSL<=25.3.0,>=24.3while the alert wants>=26.0.0. The workflow correctly fails and opens no PR until mitmproxy is bumped past that cap. This is a real upstream constraint, not an automation defect.Smoke testing performed (local mirror in
/tmp/smoke-test)werkzeug 3.1.1)already-satisfiedpyopenssl 26blocked by mitmproxy cap)Live happy-path (
addressed != []) will be exercised on the first scheduled run after merge once a real upstream patch is available.Follow-ups (not in this PR)
citusdata/citusafter this lands (alerts-only mode) so the consolidated PR is the single channel.