Skip to content

Better dumper cache - #254

Open
lm-sousa wants to merge 7 commits into
dumper-v3from
better-dumper-cache
Open

Better dumper cache#254
lm-sousa wants to merge 7 commits into
dumper-v3from
better-dumper-cache

Conversation

@lm-sousa

@lm-sousa lm-sousa commented Sep 3, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 3, 2026 04:31
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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: c7e154514d

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ClangAstParser/src/pt/up/fe/specs/clang/ClangResources.java

Copilot AI left a comment

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.

🟡 Changes recommended

The new cache publish/install logic can incorrectly accept or reuse corrupted cache entries (including wrong-type destinations) without validation, which can break resource initialization.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR refactors the clang-dumper resource cache to be more robust and shareable across runs/processes, introducing a maintenance lock and staging/publish workflow to avoid partial/corrupt cache artifacts while enabling shared include extraction by SHA-256.

Changes:

  • Introduces CacheFiles to centralize cache locking, staging directories, atomic publishing, stale cleanup, and SHA-256 verification for downloaded artifacts.
  • Reworks ClangResources to use a releases/ layout and a shared includes cache keyed by includes archive SHA-256, with maintenance-locked “touch” usage tracking and stale cleanup.
  • Updates/expands ClangResourcesTest to cover shared includes extraction, maintenance-lock behavior across JVMs, staging cleanup, and cache reuse semantics.
File summaries
File Description
ClangAstParser/test/pt/up/fe/specs/clang/ClangResourcesTest.java Replaces old cache-lock tests with broader coverage for maintenance lock, shared includes-by-SHA, staging cleanup, and reuse behaviors.
ClangAstParser/src/pt/up/fe/specs/clang/ClangResources.java Switches to releases/includes cache layout, introduces shared includes resolution and maintenance-locked usage tracking + cleanup.
ClangAstParser/src/pt/up/fe/specs/clang/ClangAstWebResource.java Uses CacheFiles.installFile() for manifest caching under the new cache-root layout.
ClangAstParser/src/pt/up/fe/specs/clang/CacheFiles.java New cache utility implementing maintenance lock, staging/publish, checksum validation, and stale/staging cleanup.
Review details

Suppressed comments (1)

ClangAstParser/src/pt/up/fe/specs/clang/CacheFiles.java:188

  • publish() returns immediately if the destination exists, even if it has the wrong type (e.g., a directory where a file is expected, or vice-versa). This can cause callers like installFile() to proceed with an unusable cache entry and hide the underlying corruption.
    static Path publish(Path staging, Path destination) {
        try {
            Files.createDirectories(destination.getParent());
            if (Files.exists(destination)) {
                return destination;
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ClangAstParser/src/pt/up/fe/specs/clang/CacheFiles.java

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Build Weaver

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

@lm-sousa
lm-sousa force-pushed the better-dumper-cache branch from c7e1545 to 2dee23b Compare September 5, 2026 23:23
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants