Skip to content

ci: unify verification commands and test reports - #813

Draft
yeongseon wants to merge 17 commits into
mainfrom
ci/standardize-verification-evidence
Draft

yeongseon wants to merge 17 commits into
mainfrom
ci/standardize-verification-evidence

Conversation

@yeongseon

@yeongseon yeongseon commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Use consistent verification commands locally and in CI, with structured test reports for troubleshooting.

Changes

  • Add canonical Makefile commands and keep check-all as an alias for verify.
  • Move test orchestration into Python helpers under tools/ and add regression tests.
  • Generate redacted reports under gitignored test-results/, with explicit pass, fail, incomplete, and not-applicable states.
  • Run lint, typing, security, offline tests, Functions host/Azurite integration, and package checks through the shared commands.
  • Reuse the same reporting approach in CI without changing required job names, release gates, or publication artifacts.
  • Avoid repeated Hatch bootstrap and preserve the existing deep-clean command.

Validation

  • Locally passed: make doctor, make check, make test, make lint-workflows, make perf, make build, make docs, make integration, make verify, make report, and make clean.
  • Tests: 1,437 passed, 95.11% coverage on Python 3.11.15. All six local verification lanes passed.
  • Unconfigured make e2e-azure correctly returned INCOMPLETE.
  • Remote CI matrix, live Azure certification, and non-dry-run bootstrap commands were not verified locally.

Related Issues

Closes #811

Copilot AI 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.

🟡 Changes recommended

Credential redaction can expose secrets and corrupt saved evidence, and verification reliability issues remain unresolved.

5 open issues
What changed in this PR

Standardizes local and CI verification for the OpenAPI library, with shared runners and saved evidence for issue #811.

Changes:

  • Defines canonical Makefile commands and separates offline tests, managed integration, and Azure certification.
  • Adds verification helpers for process cleanup, reporting, redaction, and wheel smoke checks.
  • Updates CI artifact uploads, regression tests, and contributor documentation.
File Description
tools/​verification.py Orchestrates verification lanes and aggregate results.
tools/​verification_wheel.py Adds installed-wheel smoke verification.
tools/​verification_process.py Manages subprocess timeouts, cleanup, and logs.
tools/​verification_host.py Runs managed Functions-host and Azurite checks.
tools/​verification_evidence.py Collects, redacts, saves, and renders evidence.
tools/​verification_environment.py Adds prerequisite diagnostics and artifact cleanup.
tools/​__init__.py Establishes the tools package.
tests/​test_verification_evidence.py Tests evidence classification, serialization, and redaction.
tests/​test_verification_commands.py Tests command contracts and process lifecycle.
tests/​test_validate_http_shorthand_conflict.py Adds a typed helper for optional validator imports.
tests/​test_ci_workflow_hardening.py Checks shared runners and always-run uploads.
pyproject.toml Routes tests through the runner and expands type checking.
Makefile Defines canonical commands and delegates orchestration.
docs/​testing.md Explains test lanes and CI evidence.
docs/​development.md Documents commands and evidence layout.
docs/​contributing.md Updates contributor validation guidance.
docs/​agent-playbook.md Updates automated-development verification guidance.
CONTRIBUTING.md Documents setup, verification, and evidence contracts.
AGENTS.md Updates canonical commands and the local merge gate.
.gitignore Excludes generated verification evidence.
.github/​workflows/​publish-pypi.yml Uses the shared library-test runner and uploads evidence.
.github/​workflows/​e2e-azure.yml Integrates Azure verification evidence and JUnit paths.
.github/​workflows/​ci-test.yml Adopts shared runners and evidence uploads across CI lanes.

Review effort: Balanced

Comment thread tools/verification_evidence.py Outdated
Comment on lines +38 to +44
text = re.sub(r"(?im)(authorization[\"']?\s*[:=]\s*)[^\r\n<\"]+", r"\1[REDACTED]", text)
text = re.sub(r"(https?://)[^/@\s]+:[^/@\s]+@", r"\1[REDACTED]@", text)
text = re.sub(
r"(?i)(?<![\w-])((?:[\w-]*(?:token|password|secret|connectionstring)|AccountKey|"
r"SharedAccessSignature|AzureWebJobsStorage|x-functions-key|code|sig)"
r"[\"']?\s*[:=]\s*[\"']?)[^\s;&<\"']+",
r"\1[REDACTED]",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verified already fixed by a94d522; additional regression coverage in 7f64309. Existing parametrized tests cover quoted Authorization/Proxy-Authorization, whitespace passwords, delimiters, escaped quotes, connection-string keys, XML validity, JSON serialization, binary preservation and symlink safety. test_overlapping_escaped_environment_secrets_are_replaced_longest_first additionally proves longest-first replacement of overlapping JSON-escaped environment secrets and nested tuple/string-leaf serialization. Full suite passes at 95.11% coverage; CI green at b1cc3ed. No thread resolved.

Comment thread Makefile Outdated
Comment on lines +77 to +80
check: format-check typecheck security lint-workflows
@$(RUN) -m ruff check src tests tools/verification*.py
@$(RUN) scripts/lint_mermaid.py
@$(RUN) scripts/check_screenshots.py --strict

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 926eba6. make check now enters the shared evidence runner before invoking make check-commands, so all prerequisites run inside the recorded check lane. summary.json, redacted logs and Job Summary survive prerequisite failure and the original nonzero result propagates. test_check_saves_prerequisite_evidence covers both success and a failing prerequisite containing a credential canary (failed before the fix). CI green at b1cc3ed, including the quality job.

Comment thread Makefile Outdated
@echo "Azure Function Core Tools version:" && func --version || echo "func not found"
@echo "Pre-commit hook installed:"
@if [ -f .git/hooks/pre-commit ]; then echo yes; else echo no; fi
@$(RUN) -m tools.verification doctor

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 926eba6 for doctor, report and clean. Maintenance resolves an existing interpreter read-only (active environment, .venv, hatch env find, then compatible system Python) without hatch run/create/sync. Missing required modules produce development environment not created: run make install. test_maintenance_never_bootstraps_hatch executes all three commands in fresh checkout mirrors with CI unset, empty HATCH_DATA_DIR and a pip-free environment; it asserts no provisioning and no pyvenv.cfg under Hatch data. These cases failed before the fix. CI green at b1cc3ed.

assert process.poll() is not None


def test_verify_runs_every_required_lane_even_after_failure(

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 7555b1d with an autouse fixture redirecting GITHUB_STEP_SUMMARY for every verification test module. Regression test_verification_tests_leave_outer_summary_untouched in 926eba6 launches the deliberately failing/missing-prerequisite tests in a subprocess with an outer summary sentinel and proves it remains byte-for-byte unchanged. Tests that explicitly inspect summaries still use their own temporary destination. CI green at b1cc3ed.

Comment thread tools/verification_host.py Outdated
with urlopen(url, timeout=1) as response:
if response.status < 500:
return
except URLError:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 926eba6. The bounded readiness loop retries OSError (including TimeoutError, ConnectionError and URL errors) and http.client.HTTPException rather than aborting startup. The other readiness loop already catches OSError. test_readiness_retries_transient_failure covers each transient failure followed by success; all four failed before the fix. Both real-host CI jobs pass at b1cc3ed.

@yeongseon

Copy link
Copy Markdown
Owner Author

All five inline findings replied with commit and test evidence; overview adds no other findings. CI green at b1cc3ed. Integration note for #817: preserve this branch’s check wrapper/check-commands and maintenance interpreter; add its separate security Make target block and security: security-bandit dependency, plus both tool typecheck sets. security.yml needs this branch’s selected-interpreter setup and #817’s always-run evidence collectors. No threads resolved and no PR merged.

@yeongseon
yeongseon marked this pull request as draft October 24, 2026 02:13
@yeongseon yeongseon changed the title ci: standardize canonical verification commands and evidence ci: unify verification commands and test reports Oct 25, 2026
@yeongseon

Copy link
Copy Markdown
Owner Author

Superseded by #843 (CI test evidence retention) and #844 (integration, wheel-smoke and verify targets), which implement the remaining #811 items minimally on current main. This draft now conflicts with main in 7 files and adds tooling the issue lists as out of scope. Leaving it open for the maintainer to close.

This branch has not been deployed

No deployments
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.

ci: align command contracts and close real-host and lane coverage gaps

2 participants