Repository navigation
Optional build step for UCC apps (build_command, package_dir) - #7
Merged
Merged
Conversation
app-ci.yml and release.yml gain two optional inputs. build_command runs before packaging with APP_ID and APP_VERSION (0.0.0 in the PR gate, the resolved release version in release) in its environment; package_dir selects the directory to package, e.g. output/<app_id> for ucc-gen. A new "Resolve package directory" step defaults to <app_id>, and fails clearly unless the directory is named after the app id (ADR-0003 tarball invariant) and contains default/app.conf. Callers that set neither input keep the previous behaviour: the build step is skipped and <app_id>/ is packaged. The version source of truth is unchanged: release still reads <app_id>/default/app.conf, which prepare-release stamps; UCC apps use that directory as ucc-gen --source. README documents the inputs, the layout and UCC 6.6.0 gotchas verified locally. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Adds two optional inputs to
app-ci.ymlandrelease.ymlso an app can generate its Splunk app before packaging (the first user is the UCC-based SAP add-on,apius_ta_sap_cloud, per its ADR-0001).build_command""(no build)bash -eo pipefail) run from the repo root before packaging. Env:APP_ID,APP_VERSION(0.0.0in the PR gate, the resolved release version inrelease.yml).package_dir""(=<app_id>)output/<app_id>.A new Resolve package directory step runs before packaging. It fails with a
::error::unless the directory's last path component equalsapp_id, which is the ADR-0003 invariant that the tarball's single top-level dir is the app id, and unless it containsdefault/app.conf.Existing callers are unaffected
Build apphasif: inputs.build_command != '', so it is skipped when the input is unset.Resolve package directoryfalls back to<app_id>, sopackage --app-dirgets the same value as before. The basename check always passes for the fallback. The only visible change is that a missing<app_id>/default/app.confnow fails one step earlier, with a clearer message (it failed before too).resolve, the AppInspect steps, the release/tag logic, the Splunkbase job,prepare-release.ymlor the Python module.Version source of truth
This is unchanged.
prepare-releasestamps<app_id>/default/app.conf, andreleasereads the version back from that source file. It never reads it from the build output. UCC apps use<app_id>/asucc-gen build --source(not UCC's defaultpackage/) and keepglobalConfig.jsonat the repo root, because UCC looks for it in the parent of--source.packagestill re-stamps[launcher] versioninside the tarball.Verified locally (UCC 6.6.0, Python 3.9)
Minimal UCC app: an account tab with an
encrypted: truefield, one input, and a sourcedefault/app.conf. Steps run:current-version→ucc-gen build --source apius_ta_sap_cloud --ta-version "$APP_VERSION"→ resolve step →python -m splunk_app_ci package --app-dir output/apius_ta_sap_cloud.apius_ta_sap_cloud. Itsapp.confhas[launcher] version = 4.1.0, andapp.manifesthas 4.1.0.package_dir: outputand for a missing build output.--excluded-tags manual) and cloud: 0 errors, 0 failures. It reported 2 future_failures, bothpython.requiredmissing on the UCC-generated modinput and restmap stanzas, and warnings only.actionlintis clean.ruff check,ruff format --checkandpytest -qpass (there are no Python changes).UCC gotchas (all written up in the README):
--ta-version.--vergets prefix-matched to--verbose, so the build breaks.--ta-version, UCC sets the version from git (0.0.0+<sha>) and ignores the source app.conf.output/<meta.name>/.[launcher] authoris dropped if it conflicts withapp.manifest.meta.versionandschemaVersionin the sourceglobalConfig.json.Not verified
The tooling checkout inside the workflows still uses
ref: main, which is fine because this PR changes no Python.🤖 Generated with Claude Code