Skip to content

refactor: rename preflight role to validate_environment - #110

Merged
sabre1041 merged 8 commits into
redhat-cop:v2from
vvaldez:rename-preflight
Oct 29, 2026
Merged

sabre1041 merged 8 commits into
redhat-cop:v2from
vvaldez:rename-preflight

Conversation

@vvaldez

@vvaldez vvaldez commented Oct 23, 2026

Copy link
Copy Markdown

Summary

Renames the preflight role to validate_environment, pairing with validate_migration (companion PR #108, post-migration validation). Plain descriptive names replace the aviation metaphor; the pair stays symmetric.

Compatibility

Clean break: v2 is unreleased and nothing in-repo consumed the old names. Renamed surfaces:

  • Role dir roles/preflight → roles/validate_environment
  • Playbook vmf_preflight.yml → vmf_validate_environment.yml
  • User variables preflight_* → validate_environment_* (including internal __preflight_* facts)
  • Test target preflight_report → validate_environment_report
  • GLOSSARY.md (new), architecture diagram node, changelog fragment (rewritten to final-state naming per the unreleased-changelog consolidation)

NOTE: preflight is days old (merged via #107, unreleased), so no external consumers are known. If you have automation referencing the old names, update it when pulling v2.

Validation

  • ansible-lint production profile (strict), full pre-commit
  • Integration target regression run: identical recap pre/post rename
  • Documentation regenerated with the CI-pinned docsible version

Attribution: created using opencode (session: ses_ed904e798ffeTYJVsSCQP9sbvM)

@vvaldez vvaldez self-assigned this Oct 23, 2026
@vvaldez
vvaldez deployed to external-ci October 23, 2026 15:37 — with GitHub Actions Active
Pair symmetry with validate_migration (companion PR redhat-cop#108, post-only).
Clean break: v2 is unreleased and nothing in-repo consumed the old
names. Role dirs, playbooks (vmf_validate_environment.yml), variable
prefixes, test targets, docs, and the changelog fragment all use the
new name.

Assisted-by: opencode:enmaas/rits/zai-org/glm-5-3
@vvaldez
vvaldez deployed to external-ci October 23, 2026 15:59 — with GitHub Actions Active
@vvaldez
vvaldez marked this pull request as ready for review October 23, 2026 16:54
@vvaldez
vvaldez requested a review from sabre1041 as a code owner October 23, 2026 16:54
tech2734
tech2734 previously approved these changes Oct 23, 2026

@tech2734 tech2734 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — clean mechanical rename with no leftover preflight references in the new code. Variable naming, file structure, changelog, architecture diagram, and test target are all consistent. The new GLOSSARY.md is a nice touch for domain vocabulary.

One minor observation (non-blocking): validate_environment_* is verbose (e.g. validate_environment_aap_validate_certs), but the symmetry with validate_migration_* justifies it.

Tested the original preflight role against the homelab in PR #107 review — the logic here is identical, just renamed.

Drop the task-level tags (always/openshift/validate/cnv/mtv/aap/
vcenter/vddk) from validate_environment — no other role in the
collection uses task tags, and all checks already run on every
invocation regardless. Add the empty galaxy_tags key to meta/main.yml
to match the existing roles' metadata shape.

Assisted-by: opencode:enmaas/rits/zai-org/glm-5-3

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvaldez Moving in to the right direction. However, I do not see the conditional that will limit what type of checks are performed (move from tag to property based conditionals)

The tag-convention commit removed the task-level tags, but the role's
docs still advertised per-check tags and --tags debug runs — update the
README, argument_specs, and task comments to describe the one-off CLI
run (-e validate_environment_secure_logging=false) instead. Rename the
remaining "pre-flight" prose in docs/architecture-v2.md to the
"Environment validation" glossary term.

Assisted-by: opencode:enmaas/rits/zai-org/glm-5-3
@vvaldez
vvaldez deployed to external-ci October 26, 2026 13:53 — with GitHub Actions Active
The task-level tags are removed; the regression test comment still
described an 'isolated tagged run' summary path. Rename it to 'isolated
partial run'.

Assisted-by: opencode:enmaas/rits/zai-org/glm-5-3
- Document the actual /api/controller/v2/ default in argument_specs.yml
  (defaults/main.yml already served it; the spec docs claimed /api/v2/)
  and align the defaults comment, which disagreed with the spec about
  AWX.
- Add ignore_errors to the CNV and AAP probe tasks: a module crash
  bypasses failed_when and would abort the run, contradicting the
  documented "checks do not crash the play" claim. Mirrors the existing
  vCenter/OpenShift probe pattern.
- Drop the leftover "check alone" wording from the vCenter failure
  detail: task tags no longer exist, so a per-check run is not possible.

Validated: integration target ok=18/rescued=3 (unchanged), full
pre-commit green.

Assisted-by: opencode:publishers/prelude-maas/models/glm-53-flash
Replace the fixed six-check include sequence with a loop over the new
validate_environment_checks variable (defaults to all six). A one-off
run can now limit the pass, e.g. -e validate_environment_checks=[vcenter]
to debug a single check — the summary report still runs on every
invocation via the always block.

Assisted-by: opencode:publishers/prelude-maas/models/glm-53-flash

@vvaldez vvaldez left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sabre1041 Property-based check selection is in as of 0e485b6. The six includes are replaced by a loop over the new validate_environment_checks variable, defaulting to all six (openshift, cnv, mtv, aap, vcenter, vddk). A one-off run limits the pass with -e validate_environment_checks=[vcenter], now the documented path for debugging a single check. The summary report still runs on every invocation via the always block.

@vvaldez
vvaldez deployed to external-ci October 26, 2026 15:42 — with GitHub Actions Active
CLI -e passes a string (-e validate_environment_checks=[vddk]) where
an inventory var is a real list; loop requires a list and rejected the
string. Normalize the loop input to accept a list, a bare check name,
or a bracketed comma-separated string.

Assisted-by: opencode:publishers/prelude-maas/models/glm-53-flash

@vvaldez vvaldez left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sabre1041 Follow-up on eb1f01c: live validation caught that the CLI form -e validate_environment_checks=[vddk] passes a string where loop requires a list. The loop now normalizes both forms, so the bracketed CLI form, a bare check name, and a real list all work. Validated on pool1: default run (all six, ok=28), [vddk] and [vcenter, vddk] limited runs, and the JSON form.

Issue redhat-cop#121 requires community-module use to document which module, why
it is required over a command, and why the pin range is safe. The
existing justification covered the first two; add the pin-range note:
community.vmware is pinned >=5.5.0 and the task uses only core
connection options, unchanged across 5.x. Also note the pyVmomi
requirement.

Assisted-by: opencode:publishers/prelude-maas/models/glm-53-flash
@vvaldez
vvaldez deployed to external-ci October 26, 2026 18:01 — with GitHub Actions Active

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sabre1041
sabre1041 merged commit eff0691 into redhat-cop:v2 Oct 29, 2026
22 checks passed

This branch was successfully deployed

1 active deployment
external-ci — e0247391 Deployed Oct 26, 2026 by vvaldez via external-approval #789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants