Skip to content

Fix cache update for JBang#14727

Merged
Siedlerchr merged 1 commit into
mainfrom
fix-jbang-caching
Dec 26, 2025
Merged

Fix cache update for JBang#14727
Siedlerchr merged 1 commit into
mainfrom
fix-jbang-caching

Conversation

@koppor

@koppor koppor commented Dec 26, 2025

Copy link
Copy Markdown
Member

User description

I think, I forgot to add some cache for JBang.

This PR fixes it.

Refs https://github.com/JabRef/jabref-issue-melting-pot/issues/1172

Steps to test

See happy CI

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [/] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

PR Type

Bug fix


Description

  • Changed cache action from restore-only to full cache

  • Enables both restore and save operations for JBang

  • Fixes incomplete caching setup for JBang dependencies


Diagram Walkthrough

flowchart LR
  A["Cache restore-only action"] -- "changed to" --> B["Full cache action"]
  B -- "enables" --> C["Save JBang cache"]
  C -- "improves" --> D["Build performance"]
Loading

File Walkthrough

Relevant files
Bug fix
binaries.yml
Switch from cache restore to full cache action                     

.github/workflows/binaries.yml

  • Changed actions/cache/restore@v5 to actions/cache@v5
  • Updated step name from "Use cache" to "Cache JBang"
  • Enables both restore and save operations for JBang cache
  • Maintains existing cache key and restore-keys configuration
+2/-2     

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Improve cache key to allow updates

Improve the GitHub Actions cache key to prevent stale dependencies. Use a more
specific key for saving the cache by including the commit SHA, and use the
existing monthly key as a restore key.

.github/workflows/binaries.yml [265-276]

 - name: Generate JBang cache key
   id: cache-key
   shell: bash
   run: |
-    echo "cache_key=jbang-$(date +%Y-%m)" >> $GITHUB_OUTPUT
+    echo "monthly_key=jbang-$(date +%Y-%m)" >> $GITHUB_OUTPUT
 - name: Cache JBang
   uses: actions/cache@v5
   with:
     path: ~/.jbang
-    key: ${{ steps.cache-key.outputs.cache_key }}
-    restore-keys:
+    key: ${{ steps.cache-key.outputs.monthly_key }}-${{ github.sha }}
+    restore-keys: |
+      ${{ steps.cache-key.outputs.monthly_key }}-
       jbang-

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that the monthly cache key prevents updates within the month and proposes a best-practice solution using github.sha to create unique keys for saving, while using the monthly key for restoring, thus preventing stale caches.

Medium
  • More

@Siedlerchr Siedlerchr enabled auto-merge December 26, 2025 14:19
@Siedlerchr Siedlerchr added this pull request to the merge queue Dec 26, 2025
Merged via the queue into main with commit 5c3a0a0 Dec 26, 2025
72 of 81 checks passed
@Siedlerchr Siedlerchr deleted the fix-jbang-caching branch December 26, 2025 14:41
Siedlerchr added a commit that referenced this pull request Dec 27, 2025
* upstream/fix-caching:
  Fix cache update for JBang (#14727)
  update citeproc (#14724)
  Throttle calls for workflow triggering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants