Skip to content

fix(appstream): isolate CI env vars in resolver tests - #157

Merged
abn merged 1 commit into
mainfrom
fix_main_ci_failure
Aug 23, 2026
Merged

fix(appstream): isolate CI env vars in resolver tests#157
abn merged 1 commit into
mainfrom
fix_main_ci_failure

Conversation

@abn

@abn abn commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Root Cause

During tag/release workflow runs, CI environment variables like GITHUB_REF (refs/tags/v0.33.0), GITHUB_REF_TYPE, and GITHUB_REF_NAME are populated in the runner's ambient environment. Because pkg/appstream/resolver_test.go did not isolate CI environment variables, TestResolveRelease_GitMock matched the ambient CI environment variable branch before reaching the mocked Git command branch, failing the assertions.

Solution

  1. Added environment variable isolation (clearCIEnv) using t.Setenv in pkg/appstream/resolver_test.go for all tests.
  2. Added comprehensive subtests for all CI environments and Git tag fallback cases.
  3. Updated pkg/appstream/resolver.go to retain rawGitTag when matching CI tag environment variables so commit dates can also be extracted via Git log when available.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 23, 2026
@abn
abn force-pushed the fix_main_ci_failure branch from cf4862a to 22e3cdd Compare August 23, 2026 20:31
@abn
abn merged commit 9a23e73 into main Aug 23, 2026
6 checks passed
@abn
abn deleted the fix_main_ci_failure branch August 23, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant