Skip to content

Trac: Read the asset cache-busting version from common.ini - #763

Closed
obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:trac/config-driven-scripts-version
Closed

Trac: Read the asset cache-busting version from common.ini#763
obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:trac/config-driven-scripts-version

Conversation

@obenland

@obenland obenland commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • site_head.html and site_footer.html each hardcoded their own scripts_version, so every wp-trac.css/js cache bump required editing both files in lockstep.
  • Both templates now read scripts_version from a new [wporg] section in common.ini via env.config.get('wporg', 'scripts_version'), giving a single source of truth.

Test plan

  • Deploy to the dotorg sandbox and confirm wp-trac.css/wp-trac.js/trac-security.js URLs render with ?243
  • Confirm bumping [wporg] scripts_version in common.ini alone updates both templates' asset URLs

site_head.html and site_footer.html each hardcoded their own
scripts_version, requiring both to be bumped in lockstep on every
wp-trac.css/js release. Read it from the [wporg] scripts_version
setting in common.ini instead, so there's a single source of truth.
Copilot AI lite review requested due to automatic review settings August 4, 2026 14:30
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI 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.

Pull request overview

This PR centralizes Trac asset cache-busting by reading scripts_version from Trac’s shared configuration (common.ini) instead of hardcoding it independently in multiple templates, reducing the chance of version drift across pages.

Changes:

  • Updated site_head.html and site_footer.html to set scripts_version via env.config.get('wporg', 'scripts_version').
  • Bumped the configured [wporg] scripts_version value in common.ini to 243.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
trac.wordpress.org/templates/site_head.html Pulls the CSS cache-busting version from Trac config instead of a hardcoded template value.
trac.wordpress.org/templates/site_footer.html Pulls the JS cache-busting version from Trac config instead of a hardcoded template value.
trac.wordpress.org/conf/common.ini Updates the single source of truth for the asset cache-busting version to 243.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bazza bazza closed this in 7fff93e Aug 4, 2026
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