Commit 15c012e
committed
TECH_DEBT: Fail get_deployed_commit.py when the full hash cannot be resolved
The script warned about an unresolved short hash and then published it anyway. The
downstream consumer cannot use it: list-deploy-changes.py fetches both refs with
'git fetch --depth=1 origin <ref>', GitHub rejects unadvertised objects by short SHA,
and that fetch discards stderr and ignores its exit code — so the deployment summary
came out empty with nothing in the log to explain it.
- Replace the short-hash warning with a fail(), reporting the same context on stderr
and exiting nonzero
- Place it ahead of the FromCommit print and the ##vso[task.setvariable] line, so no
unusable value is published
This makes the Summarize job fail whenever the GitHub lookup fails for any reason,
including a rate limit or transport error, and Deploy is gated on Summarize
succeeding.
Verified against qa2 that the normal path is unchanged and exits 0. Forced the
failure path with an unreachable API host: the warning and the ERROR line are both
printed, the exit status is 1, and neither FromCommit nor the ##vso line is emitted.1 parent b6b550f commit 15c012e
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
0 commit comments