feat(config): add CONFIG_REF environment variable for scheduled syncs#1020
Open
tdabasinskas wants to merge 2 commits into
Open
feat(config): add CONFIG_REF environment variable for scheduled syncs#1020tdabasinskas wants to merge 2 commits into
CONFIG_REF environment variable for scheduled syncs#1020tdabasinskas wants to merge 2 commits into
Conversation
Allow scheduled and full syncs to read configuration from a specific git ref instead of the default branch. This enables testing configuration changes from a branch before merging. Webhook-triggered syncs continue to use the ref from the triggering event and are not affected by this setting. The CONFIG_REF value is passed through to syncAll() and used when fetching configuration files from the admin repository.
CONFIG_REF environment variable for scheduled syncs
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for running scheduled/CLI full syncs against a specific git ref of the admin repo by introducing a CONFIG_REF environment variable, addressing the limitation described in #1019 (enabling dry-run validation of config branches without merging).
Changes:
- Add
CONFIG_REFto environment configuration and pass it through thesyncInstallation(CRON/full-sync) path. - Ensure config loading (via
ConfigManager) and sync execution (Settings.syncAll) can be pinned to the provided ref. - Add unit coverage for
syncInstallationbehavior with/withoutCONFIG_REF, and document the new variable in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
index.js |
Threads env.CONFIG_REF into the scheduled/CLI sync path so config reads can target a non-default admin-repo ref. |
lib/env.js |
Exposes CONFIG_REF from process env for use by the app. |
test/unit/index.syncInstallation.test.js |
Adds unit tests verifying default-branch behavior vs explicit CONFIG_REF behavior. |
README.md |
Documents CONFIG_REF for scheduled/full sync configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Improve readability and clarity of the CONFIG_REF documentation by: - Simplifying the sentence structure - Removing redundant "admin repo" reference (already clear from context) - Replacing "For e.g." with the grammatically correct "For example"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1019.
Adds a
CONFIG_REFenvironment variable. When set,syncInstallation(the path behindCRONschedules andfull-sync.js) passes it as the ref for config loading, sosettings.ymland the suborg/repo configs are read from that ref of the admin repo. When unset, nothing changes: the ref staysundefinedand config loading falls back to the default branch exactly as before.Combined with
FULL_SYNC_NOP=true(#733) this makes it possible to dry-run a proposed config branch in CI before merging it to the admin repo's default branch, which is what several people in #818 were trying to do.Webhook flows are untouched; the variable is only read in the
syncInstallationpath.