artifact-uboot: add UBOOT_GIT_CACHE_TTL (fixes #7710)#9699
artifact-uboot: add UBOOT_GIT_CACHE_TTL (fixes #7710)#9699igorpecovnik merged 1 commit intoarmbian:mainfrom
Conversation
fixes armbian#7710) By default the git ref of BOOTSOURCE/BOOTBRANCH is memoized for 3600 seconds, so pushing new commits to a tracked branch is not picked up until the cache expires. Add UBOOT_GIT_CACHE_TTL, mirroring KERNEL_GIT_CACHE_TTL in artifact-kernel.sh, so users can override this timeout (set to a low value or 0 to always re-resolve the upstream SHA1). As suggested by rpardini in armbian#7710.
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/functions/artifacts/artifact-uboot.sh`:
- Around line 43-47: The current use of declare -i for
uboot_git_cache_ttl_seconds causes silent coercion and raw arithmetic errors for
invalid inputs; replace the declare -i pattern and the direct assignment from
UBOOT_GIT_CACHE_TTL by converting the user-provided string with arithmetic
expansion (e.g. set uboot_git_cache_ttl_seconds using $((UBOOT_GIT_CACHE_TTL +
0)) after trimming/allowing whitespace) before calling display_alert, so invalid
strings become 0 and valid numeric seconds are preserved; update the logic
around the UBOOT_GIT_CACHE_TTL check and the uboot_git_cache_ttl_seconds
assignment to use this expansion instead of declare -i.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7aa840c5-0110-4f1e-bc2e-29856ec5c184
📒 Files selected for processing (1)
lib/functions/artifacts/artifact-uboot.sh
|
✅ This PR has been reviewed and approved — all set for merge! |
Summary
Fix #7710 by introducing
UBOOT_GIT_CACHE_TTL, mirroring the existingKERNEL_GIT_CACHE_TTLfor kernel.The upstream u-boot git ref SHA1 is memoized for 3600 seconds by default,
so commits pushed to a tracked
BOOTBRANCH(branch:*refspec) are notpicked up until that TTL expires. There was no user-visible knob to
shorten the window — only
ARTIFACT_IGNORE_CACHE=yesas a blunt workaround.As suggested by @rpardini in #7710:
What changes
lib/functions/artifacts/artifact-uboot.sh: readUBOOT_GIT_CACHE_TTL,emit
display_alertwhen set, pass it asmemoize_cache_ttltorun_memoized.Default behaviour unchanged (3600s).
Test plan
./compile.sh uboot BOARD=helios4 BRANCH=edge UBOOT_GIT_CACHE_TTL=1→
Setting u-boot git cache TTL to [ 1 ]+Producing new & caching [ GIT_INFO_UBOOT ], exit 0./compile.sh uboot BOARD=helios4 BRANCH=edge(no override)→ no TTL alert,
Using cached [ GIT_INFO_UBOOT ], exit 0Summary by CodeRabbit