Repository navigation
ci(garnet): Add lookback_days input to the shadow mirror #114
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Missing issue-closing reference The PR body lacks the Was this helpful? React with 👍 or 👎 to provide feedback. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,17 @@ def test_recently_merged_uses_lookback(self): | |
| self.assertFalse(recently_merged({"merged_at": "2026-11-16T00:00:00Z"}, now)) | ||
| self.assertFalse(recently_merged({"merged_at": None}, now)) | ||
|
|
||
| def test_open_backfilled_mirror_stays_in_window(self): | ||
| now = datetime.datetime(2026, 11, 27, tzinfo=datetime.timezone.utc) | ||
| pr = {"merged_at": "2026-10-16T00:00:00Z"} | ||
| fresh = {1: {"state": "open", "created_at": "2026-11-26T00:00:00Z"}} | ||
| stale = {1: {"state": "open", "created_at": "2026-11-10T00:00:00Z"}} | ||
| closed = {1: {"state": "closed", "created_at": "2026-11-26T00:00:00Z"}} | ||
| self.assertTrue(recently_merged(pr, now, fresh)) | ||
| self.assertFalse(recently_merged(pr, now, stale)) | ||
| self.assertFalse(recently_merged(pr, now, closed)) | ||
| self.assertFalse(recently_merged({"merged_at": None}, now, fresh)) | ||
|
Comment on lines
+76
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| def test_candidates_cover_open_and_recently_merged_bot_changes(self): | ||
| api = API("unused", True) | ||
|
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Testing checklist in PR description The test and actionlint checkbox conflicts with the PR description rules, which prohibit testing checklists. Was this helpful? React with 👍 or 👎 to provide feedback. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,11 @@ on: | |
| description: Optional space-separated change numbers | ||
| required: false | ||
| type: string | ||
| lookback_days: | ||
| description: Days of merged dependency changes to replay | ||
| required: false | ||
| default: '10' | ||
| type: string | ||
|
Comment on lines
+16
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Short replays also close existing mirrors A one-day dispatch sends existing open mirrors through sync, not just newly discovered changes. It closes mirrors when both the upstream merge and mirror creation are older than one day. Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| permissions: {} | ||
| concurrency: | ||
| group: shadow-dependency-mirror | ||
|
|
@@ -39,6 +44,7 @@ jobs: | |
| contents: read | ||
| env: | ||
| PRS: ${{ inputs.prs }} | ||
| LOOKBACK_DAYS: ${{ inputs.lookback_days || '10' }} | ||
| steps: | ||
| - name: Check authentication | ||
| id: auth | ||
|
|
@@ -64,7 +70,8 @@ jobs: | |
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| args=() | ||
| [[ "$LOOKBACK_DAYS" =~ ^[0-9]+$ ]] || { echo 'Invalid lookback'; exit 1; } | ||
| args=(--lookback-days "$LOOKBACK_DAYS") | ||
| for pr in $PRS; do | ||
| [[ "$pr" =~ ^[0-9]+$ ]] || { echo 'Invalid change number'; exit 1; } | ||
| args+=(--pr "$pr") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 No scheduled pickup for pending backfills
If replay returns
baseline pending, no mirror PR exists for scheduled discovery to find. Backfills outside the default window then need another manual run.(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.