Skip to content

Commit 9252707

Browse files
committed
Stop manual release AMI publishing
1 parent c2fc51e commit 9252707

4 files changed

Lines changed: 32 additions & 5 deletions

File tree

doc/developer_guide/aws.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
2. Open a pull request and let the PR CI validate the release version through the `Check Version Number` step in [.github/workflows/ci.yaml](https://github.com/exasol/ai-lab/blob/main/.github/workflows/ci.yaml)
1010
3. Merge the pull request
1111
4. Push the release version tag
12-
5. The `Release` GitHub Actions workflow authenticates to AWS via GitHub OIDC, runs `ai-lab release check`, `build`, `notes`, and `publish`, builds the AMI and VM artifacts, and publishes the Docker release image for that tag
12+
5. The tagged `Release` GitHub Actions workflow authenticates to AWS via GitHub OIDC, runs `ai-lab release check`, `build`, `notes`, and `publish`, builds the AMI and VM artifacts, and publishes the Docker release image for that tag
1313

1414
## AWS Infrastructure Workflow
1515

@@ -42,6 +42,9 @@ The release now runs in GitHub Actions. PR CI validates the release version, whi
4242
tagged `Release` workflow both authenticate to AWS via OIDC, run the release workflow commands, build the AMI and VM
4343
artifacts, and publish the Docker image.
4444

45+
Manual `workflow_dispatch` runs are treated as draft test releases: they still generate release notes and a draft GitHub
46+
release, but they do not make the AMI public or publish the Docker image.
47+
4548
### IAM permissions for GitHub Actions
4649

4750
The AWS-backed CI and the tagged release workflow both authenticate to AWS via GitHub OIDC. The CI role should get the

doc/developer_guide/commands.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ The following commands are used during the GitHub Actions release flow:
2222

2323
`release` commands:
2424
* `check`: Validate that the repository versions and changelog are ready for a release.
25-
* `build`: Create the AMI and VM images via AWS APIs and publish the Docker image.
25+
* `build`: Create the AMI and VM images via AWS APIs and publish the Docker image for tagged releases.
2626
* `notes`: Generate the GitHub release notes and artifact list.
2727
* `publish`: Create the GitHub release from the generated notes.
2828

2929
The release workflow commands require AWS credentials when building the AMI and VM images.
3030
The `build` command requires environment variable `RELEASE_DEFAULT_PASSWORD` for the temporary VM login password used during the build.
31-
The `build` command publishes only when environment variables `DOCKER_REGISTRY_USER` and `DOCKER_REGISTRY_PASSWORD` are set.
31+
The `build` command publishes only for tagged releases, and only then when environment variables `DOCKER_REGISTRY_USER`
32+
and `DOCKER_REGISTRY_PASSWORD` are set. Manual `workflow_dispatch` test releases skip publication.
3233

3334
## Developer commands
3435

exasol/ds/sandbox/lib/release_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def run_build(context: ReleaseContext, aws_access: AwsAccess) -> None:
7979
run_start_release_build(
8080
default_config_object,
8181
aws_access=aws_access,
82-
publish=True,
82+
publish=not context.release_is_manual,
8383
asset_id=context.release_asset_id,
8484
)
8585

test/unit/test_release_workflow.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,33 @@ def test_run_build_uses_asset_id(monkeypatch):
9898
args, kwargs = run_start_release_build.call_args
9999
assert args == (default_config_object,)
100100
assert kwargs["aws_access"] is aws_access
101-
assert kwargs["publish"] is True
101+
assert kwargs["publish"] is False
102102
assert kwargs["asset_id"] == "Draft Release"
103103

104104

105+
def test_run_build_publishes_tagged_releases(monkeypatch):
106+
run_start_release_build = Mock()
107+
monkeypatch.setattr(
108+
"exasol.ds.sandbox.lib.release_workflow.run_start_release_build",
109+
run_start_release_build,
110+
)
111+
context = ReleaseContext(
112+
mode="push",
113+
release_tag="5.1.0",
114+
release_version="5.1.0",
115+
release_ref="5.1.0",
116+
release_title_input="",
117+
release_asset_id="5.1.0",
118+
release_is_manual=False,
119+
release_notes_dir=Path("/tmp/release-notes"),
120+
)
121+
aws_access = AwsAccess(None)
122+
123+
run_build(context, aws_access)
124+
125+
assert run_start_release_build.call_args.kwargs["publish"] is True
126+
127+
105128
def test_run_notes_uses_manual_title(monkeypatch, tmp_path):
106129
write_release_notes = Mock()
107130
monkeypatch.setattr(

0 commit comments

Comments
 (0)