ci: run Molecule on every same-repo pull request and print the Renovate report shape #46
No files matched your search
@@ -21,13 +21,6 @@ on: # yamllint disable-line rule:truthy
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
|
||||||
- 'roles/**'
|
|
||||||
- 'extensions/**'
|
|
||||||
- 'plugins/**'
|
|
||||||
- 'meta/**'
|
|
||||||
- 'galaxy.yml'
|
|
||||||
- '.gitea/workflows/molecule.yml'
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@@ -50,12 +43,14 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
molecule:
|
molecule:
|
||||||
# Same-repo, non-bot branches only; a push to main or a manual dispatch always runs.
|
# Same-repo branches only (bot branches included: a Renovate pin pull request is what tests a new
|
||||||
|
# image); a push to main or a manual dispatch always runs. No paths filter on pull requests, so
|
||||||
|
# that Molecule can be a required check: a required check that a pull request never starts would
|
||||||
|
# block it. A fork pull request is skipped (and the repository takes none).
|
||||||
if: >-
|
if: >-
|
||||||
github.repository == 'mortis/kamino' &&
|
github.repository == 'mortis/kamino' &&
|
||||||
(github.event_name != 'pull_request' ||
|
(github.event_name != 'pull_request' ||
|
||||||
(github.event.pull_request.head.repo.full_name == github.repository &&
|
github.event.pull_request.head.repo.full_name == github.repository)
|
||||||
!startsWith(github.head_ref, 'renovate/')))
|
|
||||||
runs-on: [kamino-molecule]
|
runs-on: [kamino-molecule]
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -103,6 +103,15 @@ jobs:
|
|||||||
problems = list(report.get("problems", []))
|
problems = list(report.get("problems", []))
|
||||||
for repo in report.get("repositories", {}).values():
|
for repo in report.get("repositories", {}).values():
|
||||||
problems.extend(repo.get("problems", []))
|
problems.extend(repo.get("problems", []))
|
||||||
|
# The shape of the report, once, so that a check on a failed post-upgrade task can be
|
||||||
|
# written against a real field: top-level keys, then per branch its keys and short values.
|
||||||
|
print("Renovate report keys: " + ", ".join(sorted(report)))
|
||||||
|
for name, repo in report.get("repositories", {}).items():
|
||||||
|
print("repository " + name + " keys: " + ", ".join(sorted(repo)))
|
||||||
|
for branch in repo.get("branches", []):
|
||||||
|
print(" branch: " + ", ".join(
|
||||||
|
k + "=" + str(v)[:60].replace("\n", " ") for k, v in sorted(branch.items())
|
||||||
|
if k != "upgrades"))
|
||||||
bad = [p for p in problems if p.get("level", 0) >= 50]
|
bad = [p for p in problems if p.get("level", 0) >= 50]
|
||||||
for p in bad:
|
for p in bad:
|
||||||
print("::error::Renovate problem: " + str(p.get("msg", "")))
|
print("::error::Renovate problem: " + str(p.get("msg", "")))
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ protection, or create tags: those are the operator's.
|
|||||||
- Lint and Build run in the `ci` image. After the checkout they compare the pin files with the
|
- Lint and Build run in the `ci` image. After the checkout they compare the pin files with the
|
||||||
checksums baked into the image: a PR that changes `requirements-dev.txt` or
|
checksums baked into the image: a PR that changes `requirements-dev.txt` or
|
||||||
`.pre-commit-config.yaml` takes the slower path that installs the pinned tools.
|
`.pre-commit-config.yaml` takes the slower path that installs the pinned tools.
|
||||||
|
- Molecule runs on every same-repo pull request, Renovate's included (a new image is tested by its own pin
|
||||||
|
pull request), with no path filter, so that it can be a required check. Fork pull requests are skipped.
|
||||||
- Molecule discovers `extensions/molecule/*/` and `roles/*/molecule/*/`. The `image-smoke`
|
- Molecule discovers `extensions/molecule/*/` and `roles/*/molecule/*/`. The `image-smoke`
|
||||||
and `image-smoke-2604` scenarios test the molecule images themselves (24.04 and 26.04); a role scenario that
|
and `image-smoke-2604` scenarios test the molecule images themselves (24.04 and 26.04); a role scenario that
|
||||||
must pass on both takes `image: ${MOLECULE_IMAGE}` or `${MOLECULE_IMAGE_2604}` per platform.
|
must pass on both takes `image: ${MOLECULE_IMAGE}` or `${MOLECULE_IMAGE_2604}` per platform.
|
||||||
|
|||||||
Reference in new issue
Block a user