Skip to content

Commit b68a69f

Browse files
github-actions[bot]P403n1x87ZStriker19
authored
ci: make configuration generation script fail on error [backport 1.18] (#6866)
Backport 50c2a0f from #6833 to 1.18. ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [x] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [x] This PR doesn't touch any of that. Co-authored-by: Gabriele N. Tornetta <[email protected]> Co-authored-by: Zachary Groves <[email protected]>
1 parent ade3559 commit b68a69f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/gen_circleci_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def gen_c_check(template: dict) -> None:
145145
LOGGER.info("Loading configuration template from %s", CONFIG_TEMPLATE_FILE)
146146
config = yaml.load(CONFIG_TEMPLATE_FILE)
147147

148+
has_error = False
148149
LOGGER.info("Configuration generation steps:")
149150
for name, func in dict(globals()).items():
150151
if name.startswith("gen_"):
@@ -155,7 +156,10 @@ def gen_c_check(template: dict) -> None:
155156
end = time()
156157
LOGGER.info("- %s: %s [took %dms]", name, desc, int((end - start) / 1e6))
157158
except Exception as e:
158-
LOGGER.error("- %s: %s [reason: %s]", name, desc, str(e))
159+
LOGGER.error("- %s: %s [reason: %s]", name, desc, str(e), exc_info=True)
160+
has_error = True
159161

160162
LOGGER.info("Writing generated configuration to %s", CONFIG_GEN_FILE)
161163
yaml.dump(config)
164+
165+
sys.exit(has_error)

0 commit comments

Comments
 (0)