Configuration maintenance automation
Configuration maintenance automation keeps the repository's operator-facing environment template and auxiliary deployment configuration aligned with released images. It also reports pull request build results and keeps the runtime proxy configuration safe when deployment inputs are absent or invalid. See Configuration and environment inputs for how these files are used as deployment inputs.
Maintenance lifecycle
The maintenance flow connects image release, version resolution, configuration updates, and the optional Helm release. The stable workflow is the owner of this sequence. The shared workflows provide the version values that the update scripts consume.
This diagram shows how a stable build turns upstream release tags into repository configuration updates and a Helm release.
flowchart LR
A[Stable build] --> B[Resolve latest Frappe and ERPNext tags]
B --> C[Build and test images]
C --> D[Publish stable images]
D --> E[Update example.env and auxiliary deployment configuration]
E --> F[Commit and push main]
D --> G[Release Helm chart]
Stable release maintenance
The stable workflow runs maintenance only in the canonical repository and only after the v16 image publish job succeeds. It then writes a change to main when the tracked deployment version changes. Pull requests can build and test the images, but they cannot publish images or write back to configuration. core-build-stable.yml core-build-stable.yml
The workflow also starts the Helm release after the same publish step. That release uses the stable major version and a deploy key to update the separate Helm repository. This keeps the container configuration update and the chart release tied to the same image publication without mixing their files or repositories. core-build-stable.yml
References: .github/…/core-build-stable.yml• L43-48 .github/…/core-build-stable.yml• L66-91 .github/…/core-build-stable.yml• L181-212
Version resolution
Version resolution converts a supported major version into the image tags used by the build. The image workflow first uses the image-size service to select versions and a trusted main-run baseline. Pull requests use that baseline when one exists, while other runs resolve the latest upstream tags. image_sizes.py image_sizes.py
The resolved values travel to the build and publish jobs. The stable maintenance job then resolves the latest v16 tags again before it updates the tracked deployment defaults. This keeps the published image and the version written to configuration on the same release line. core-build-test-images.yml core-build-test-images.yml core-build-stable.yml get_latest_tags.py
References: .github/…/image_sizes.py• L65-72 .github/…/image_sizes.py• L142-169 .github/…/core-build-test-images.yml• L49-67 .github/…/core-build-test-images.yml• L105-110 .github/…/core-build-stable.yml• L112-135 .github/…/get_latest_tags.py• L15-40
Configuration file updates
The update scripts apply the resolved ERPNext tag to two operator-facing deployment references. update_example_env.py maintains the ERPNEXT_VERSION value in example.env, while update_pwd.py maintains the ERPNext image reference used by the quick-test stack. Both scripts require the version values supplied by the resolver. update_example_env.py update_pwd.py
The environment template provides a starting point for a local .env file. The quick-test configuration provides a ready-to-run single-file deployment. Updating both after image publication keeps new deployments on the stable ERPNext version that passed the release checks. example.env pwd.yml pwd.yml pwd.yml pwd.yml
References: .github/…/update_example_env.py• L5-24 .github/…/update_pwd.py• L5-26 example.env• L1-76 pwd.yml• L1-3 pwd.yml• L21-23 pwd.yml• L50-52 pwd.yml• L110-112
Change publication
After the update scripts run, the workflow stages example.env and pwd.yml. If their content is unchanged, it exits without a commit. If the version changed, it commits the result, rebases on the current main, and pushes the update. This makes routine version drift visible as a normal repository change while avoiding empty maintenance commits. core-build-stable.yml
The write permission is limited to the maintenance job. This boundary allows release automation to update the tracked deployment defaults while keeping pull-request validation read-only. core-build-stable.yml
References: .github/…/core-build-stable.yml• L112-119 .github/…/core-build-stable.yml• L129-150
Pull request build reporting
Pull request build reporting turns a completed stable image build into one pull request comment. It combines job status, build time, image size, and the trusted successful main-run baseline so reviewers can see both the result and its change from the last known build. core-report-pr-build.yml report_pr_build.py
The reporter runs only for stable workflows started by pull requests. It finds the matching pull request and creates or updates a bot comment instead of changing deployment files. This separates review feedback from the write-back path used after a stable release. report_pr_build.py
References: .github/…/core-report-pr-build.yml• L1-31 .github/…/report_pr_build.py• L153-232 .github/…/report_pr_build.py• L235-287
Workflow entry points
The repository has reusable core workflows and small legacy entry points. The legacy stable and develop workflows only delegate to their corresponding core workflow, so the maintenance behavior is defined in the core stable workflow rather than duplicated in both entry points. build_stable.yml build_develop.yml
The maintenance path can start from several stable workflow events:
- A push to
mainthat changes a stable-build input. - A repository dispatch from an upstream Frappe or ERPNext release.
- A manual workflow run.
- A reusable workflow call from another workflow.
Only a successful stable publish in the canonical repository can lead to a write-back. This keeps source changes and test-only runs from changing the shared deployment defaults. core-build-stable.yml core-build-stable.yml
Compose configuration validation
Compose configuration validation checks that supported combinations of the base Compose file and override files can be read as valid deployment models. It runs as part of repository linting, so changes to deployment inputs are checked before they can become shared defaults.
This diagram shows how the declarative configuration registry drives both coverage checks and Compose parsing.
flowchart LR
A[compose-configs.json] --> B[Check names and file coverage]
B --> C[Merge each registered file set]
D[Repository environment values] --> C
C --> E[docker compose config --quiet]
E --> F[Lint result]
Configuration registry
The registry in tests/compose-configs.json defines the supported Compose combinations and the safe environment values used to render them. The validator rejects malformed entries, duplicate names, missing files, and any Compose override that has no registered case. compose-configs.json validate_compose.py
This registry gives the project one coverage list for database, proxy, SSL, multi-bench, and auxiliary service variants. Adding an override therefore requires a matching supported combination instead of relying on an untracked manual check. compose-configs.json
References: tests/compose-configs.json• L1-19 tests/compose-configs.json• L20-140 .github/…/validate_compose.py• L20-80
Compose rendering checks
For each registered combination, the validator invokes Docker Compose with the repository root, the listed Compose files, and the registry's environment values. A failed render marks the validation run as failed, while a missing Docker command stops the run with an explicit setup error. validate_compose.py
The pre-commit hook runs this check when Compose inputs, the registry, or the validator changes. The lint workflow also runs the workflow-script unit suite before all pre-commit hooks on pushes and pull requests. This makes configuration checks and maintenance script checks part of hosted review. .pre-commit-config.yaml lint.yml
References: .github/…/validate_compose.py• L83-146 .pre-commit-config.yaml• L68-81 .github/…/lint.yml• L11-36
Nginx runtime configuration
The Nginx runtime configuration converts deployment environment values into a proxy configuration for web traffic and Socket.IO traffic. The entry point supplies safe defaults for required routing, proxy, client, and site values before it renders the template. nginx-entrypoint.sh nginx-template.conf
Forwarded HTTPS is accepted only when the deployment explicitly trusts its upstream proxy. The entry point rejects any other trust value, while the template uses the approved value to set forwarded protocol headers. This prevents an incomplete environment from silently changing the request scheme seen by the application. nginx-entrypoint.sh nginx-template.conf
References: resources/…/nginx-entrypoint.sh• L6-28 resources/…/nginx-entrypoint.sh• L48-71 resources/…/nginx-template.conf• L1-29 resources/…/nginx-template.conf• L40-83
Change checklist
When these files or sections are changed, remember to consider these:
- When changing the
ERPNEXT_VERSIONline or its format in example.env, keep the resolver output and update_example_env.py replacement aligned. - When changing the version names or their format in pwd.yml, keep the resolver output and the update script aligned.
- When changing the stable image version inputs, confirm that the resolved tags still flow from core-build-test-images.yml to core-publish-images.yml and then to
update_versions. - When changing the stable workflow trigger or job conditions, preserve the boundary that allows write-back only after a canonical-repository publish.
- When changing the Helm release version or its dependency, keep it tied to the same successful stable publish as the configuration update.
- When adding or renaming a Compose override, update tests/compose-configs.json so the validator still covers every override and can supply any new required environment values.
- When changing the validation command or its input paths, keep the pre-commit file filter and the lint workflow aligned with the validator's required Docker Compose runtime.
- When changing image version selection for pull requests, preserve the link between the resolved versions, the retained main-run baseline, and the PR report artifacts.
- When changing the stable workflow completion event, keep the PR reporter restricted to stable pull request runs and keep its comment marker stable so it updates the existing report.
- When changing Nginx environment names or defaults, update both the entry point's rendered variables and the template's use of those variables.
- When changing forwarded-protocol trust behavior, keep the accepted values and proxy-header mapping aligned so an untrusted upstream cannot set the application scheme.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Upstream has no tag that matches the requested major version | Version resolution stops, so the stable build cannot provide versions for image publication or configuration maintenance. | The tag resolver rejects an empty tag set and validates the selected tag. |
A required FRAPPE_VERSION or ERPNEXT_VERSION value is missing | The update scripts stop before they can change the tracked deployment configuration. | Each update script checks its required environment input. |
| A maintenance run has no configuration change | The workflow exits without creating an empty commit. | The push step checks the staged working-tree status before commit. |
| A pull request or non-canonical repository reaches the stable workflow | Images may be tested, but configuration write-back and release actions must not run. | Job conditions require the canonical repository and a non-pull-request event. |
| A Compose override is absent from the configuration registry | Validation fails before rendering, so the change cannot pass the repository lint gate. | validate_compose.py compares all override files with the registry coverage. |
| A registered Compose combination cannot be merged or Docker is unavailable | The affected configuration fails validation, or the check stops with a setup error. | Each entry is rendered with docker compose config --quiet, and the validator reports the failing combination. |
| A completed stable PR run cannot be matched to one open pull request | No build report comment is created or an old comment is not updated. | The reporter matches repository, branch, and commit before it writes a comment. |
| A PR build has no trusted successful main baseline | The report cannot show a comparison for its build time or image sizes. | The image-size flow records the current measurements and marks missing baseline data instead of using an untrusted run. |
TRUST_UPSTREAM_FORWARDED_PROTO has a value other than on or off | Nginx does not start with an ambiguous forwarded-protocol policy. | The entry point validates the value before rendering the configuration. |
| An Nginx variable is missing from the entry point or template | A route can use an empty upstream, listen port, or proxy policy. | The entry point owns defaults and the template consumes the same named variables. |
Key files
| File | Why to read it |
|---|---|
| .github/…/core-build-stable.yml | Defines the stable build, publish dependency, configuration write-back, and Helm release sequence. |
| .github/…/core-build-test-images.yml | Shows how image versions and trusted size baselines enter the build and publish stages. |
| .github/…/core-report-pr-build.yml | Starts the pull request build report after the stable workflow completes. |
| .github/…/get_latest_tags.py | Defines the contract for turning upstream major versions into concrete tags. |
| .github/…/image_sizes.py | Selects trusted image-size baselines and exposes the versions used by image builds. |
| .github/…/report_pr_build.py | Builds and maintains the pull request image build summary. |
| .github/…/update_example_env.py | Maintains the ERPNext version in the operator-facing environment template. |
| .github/…/update_pwd.py | Maintains the ERPNext image tag in the quick-test deployment configuration. |
| .github/…/validate_compose.py | Checks registry shape, override coverage, and the validity of each supported Compose combination. |
| tests/compose-configs.json | Defines the supported Compose combinations and their validation values. |
| .pre-commit-config.yaml | Connects Compose validation to local checks and identifies which configuration changes trigger it. |
| .github/…/lint.yml | Runs workflow-script checks and the repository's pre-commit checks for pushes and pull requests. |
| example.env | Shows the environment template whose published ERPNext version is maintained by release automation. |
| pwd.yml | Shows the auxiliary single-file deployment configuration whose service images use the maintained version. |
| resources/…/nginx-entrypoint.sh | Applies runtime defaults and validates proxy trust before Nginx starts. |
resources/core/nginx/nginx-template.conf | Defines how the runtime values route web and Socket.IO traffic. |
| .github/…/core-publish-images.yml | Shows the publish boundary that must succeed before maintenance begins. |