Commit 6de291f
fix(repo-info): preserve full CI-detected repo path in repo_info.name (#1017)
* fix(repo-info): preserve full CI-detected repo path in repo_info.name
The --repository flag defaults to a short repo name in some CIs
(GitLab's CI_PROJECT_NAME, Bitbucket's slug) while getGitRepoInfoFrom*
detects the full path (GitLab's CI_PROJECT_PATH). Because
mergeGitRepoInfo always applied the flag value, the short default
clobbered the full CI-detected name, so repo_info.name lost its
namespace (e.g. "creator" instead of "cyber-dojo/creator").
Only override the CI-detected name when --repository is set explicitly
(or when no CI name was detected), threading repoNameExplicit through
the attest/begin-trail commands. The GitLab API ProjectID path is
untouched. Also fixes the same latent issue for Bitbucket.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(repo-info): add wiring regression test and clarify GitLab PR comment
Add RepoInfoWiringTestSuite covering the three run() paths that build
repo_info (attest generic, begin trail, attest artifact): the CI-detected
full-path name is used by default and an explicit --repository overrides
it. A mutation (removing a repoNameExplicit assignment) fails the
explicit cases, so the suite guards the command wiring.
Also add a mergeGitRepoInfo unit case for a fully-populated base with no
flags, and a comment on attestPRGitlab clarifying that GitlabConfig.
Repository (short, for the API ProjectID) is separate from repo_info.name
(full CI_PROJECT_PATH).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Remove stray committed file
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 20b8f04 commit 6de291f
17 files changed
Lines changed: 209 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
0 commit comments