Repository navigation
Keep static_analysis.pkl across runs; add fresh_analysis input - #172
Svilen-Stefanov wants to merge 2 commits into
Conversation
Full runs now delete everything in .codeboarding except the pkl pair and no
longer pass --force, so Core's warm start reuses the LSP results. A new
`fresh_analysis` input ('true'/'false', validated) skips every saved analysis:
the published-base and warm-start fetch steps and the seeds are skipped and the
base runs `analyze_repository.py full --fresh`. The PR head stays incremental
from that base so component names line up.
When no saved analysis matches the current config hash (e.g. after an engine
release), the base takes only the pkl pair from the nearest commit or ancestor
artifact under any config, and only when its .codeboardingignore matches the
checkout, since the released Core keeps cached files regardless of ignore rules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
CodeBoarding reviewStatus: 1 changed component See the full change in CodeBoarding. graph LR
n_Action_Analysis_and_Authentication_Tools["Action Analysis and Authentication Tools"]
n_Remote_Review_and_Briefing_Sync["Remote Review and Briefing Sync"]
n_Remote_Review_and_Briefing_Sync -- "authenticates requests via" --> n_Action_Analysis_and_Authentication_Tools
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Action_Analysis_and_Authentication_Tools modified;
linkStyle 0 stroke:#82071e,stroke-width:2px,stroke-dasharray:5 3;
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b264199be5
ℹ️ 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".
| - name: Fetch published base analysis | ||
| id: fetch_base | ||
| if: steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.state.outputs.base_name != '' && github.server_url == 'https://github.com' | ||
| if: steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.state.outputs.base_name != '' && github.server_url == 'https://github.com' && inputs.fresh_analysis != 'true' |
There was a problem hiding this comment.
Clear cached directories before skipping fresh fetches
When the action is invoked more than once in the same job, these fixed destinations can still contain the previous invocation's base and warm-start state. With fresh_analysis: 'true', both fetch steps are now skipped, so fetch-state.sh never performs its existing cleanup; review-generate-baseline.sh can then accept the stale BASE_DIR in compatible_state before reaching its fresh-analysis branch, silently violating the promise to rebuild from scratch. Ensure the directories are cleared even when these fetches are disabled, and likewise prevent the stale warm start from being considered.
Useful? React with 👍 / 👎.
| if { [ -e "$dest/.codeboardingignore" ] || [ -e "$state/.codeboardingignore" ]; } && | ||
| ! cmp -s "$dest/.codeboardingignore" "$state/.codeboardingignore"; then | ||
| echo "::notice::The saved static analysis of ${ancestor:0:7} was made with another .codeboardingignore; not reusing it." | ||
| return 0 |
There was a problem hiding this comment.
Try older caches after an ignore mismatch
When the nearest saved artifact has different ignore rules, this returns without trying any older candidate. For example, if .codeboardingignore changed and was later reverted, the nearest ancestor's cache is rejected here even though the next ancestor may exactly match the current rules; the ensuing full run therefore rebuilds the language-server cache from scratch, which this change is specifically intended to avoid and can add hours on large repositories. Continue searching older saved bases after rejecting a candidate.
Useful? React with 👍 / 👎.
ivanmilevtues
left a comment
There was a problem hiding this comment.
One comment only we use Force for this thing in the core. Maybe fresh is a better descriptior, but eitehr way I think it would be best if we unify the API between the core and here so that it is less confusing in general (both for us and agents).
| from threading import Thread | ||
|
|
||
| PROG = "codeboarding" | ||
| STATIC_CACHE = {"static_analysis.pkl", "static_analysis.sha"} |
There was a problem hiding this comment.
We have a warning on this, that we have hardcoded it multiple times.
| parser.add_argument("--output-dir", required=True, help="Action-owned output directory") | ||
| parser.add_argument("--depth-cap", help="Maximum hierarchy depth allowed for full analyses") | ||
| parser.add_argument( | ||
| "--fresh", action="store_true", help="Full analysis from nothing, not even the static-analysis cache" |
There was a problem hiding this comment.
in the core isn't this the --force parameter, i would suggest to keep the same paramtere name so it is less confusing
| str(output_dir), | ||
| "--depth-cap", | ||
| args.depth_cap, | ||
| "--force", |
There was a problem hiding this comment.
effectively this parameter for my comment from above.
| description: 'Positive integer analysis depth cap, used for both review and sync, including full fallbacks.' | ||
| required: false | ||
| default: '2' | ||
| fresh_analysis: |
There was a problem hiding this comment.
i am fine with fresh, although i am not sure this is the proper lingo, it sounds a bit odd.
I am more used to things like invalidate/force ;d, we can keep it fresh as well just mentioning. And it doesn't align with our core lingo where I think we call this force
The .codeboardingignore guard compared the file inside the saved bundle with the checkout's, but the base uploads drop dotfiles (include-hidden-files is false), so the bundle never had one. A repo that commits an ignore file always rebuilt; one without reused with no check. Core reads the rules from the checkout's .codeboarding/.codeboardingignore, so the guard now asks git whether that file differs between the commit the analysis describes and this one. A commit not in the checkout counts as different. Published bundles need no change. A fresh run also clears the fixed fetch directories: run twice in one job, the second use would otherwise inherit the first one's saved state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt ones Core reads the previous analysis from where it writes the new one, so the file being there after a full run proved nothing: a run that wrote nothing would publish the lent analysis, possibly another configuration's, as its own. The check now compares the file before and after; every analysis Core writes carries its own generated_at. The any-configuration lookup on the baseline branch is best effort, but a failed read there ran baseline_fail and failed the run. With CFG_HASH='*' a read failure now warns and the lookup falls through, as the artifact lookup does; a lookup for this configuration still fails loudly. Carries #172's ignore-rule and fetch-directory fixes unchanged, so the rebase onto it drops them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Companion to CodeBoarding/CodeBoarding#691 (https://app.codeboarding.org/CodeBoarding/CodeBoarding/pull/691).
Why
Every engine release changes the config hash, so the Action found no saved analysis and rebuilt every LSP pass from scratch (crate: about 2 h). Full runs also passed
--force, which threw the pkl away even when one was there.What changes
analyze_repository.py fulldeletes everything in.codeboardingexceptstatic_analysis.pkl/.shaand no longer passes--force.fresh_analysisinput ('false'by default; any value other thantrue/falsefails the run). Whentrue:full --fresh, which deletes everything and passes--force.reuse_static_analysistakes only the pkl pair from the nearestcodeboarding-base-*-<sha>artifact for the commit or an ancestor, under any config hash (find-ancestor-base.shSTATIC_ONLY=true). It does so only when.codeboardingignorematches the checkout, because the released Core keeps cached files regardless of ignore rules.Release order
Safe with the Core the Action pins today: Core refuses a pkl with a different cache layout and rebuilds. Reuse in shallow clones pays off once a Core release with #691 is pinned.
Tests
python3 -m unittest discover -s tests: 358 OK, 7 skipped.shellcheck -xclean.🤖 Generated with Claude Code