Skip to content

feat: add CI command#1114

Merged
jschoedl merged 12 commits intomainfrom
worktree-feature+ci-flag
Apr 2, 2026
Merged

feat: add CI command#1114
jschoedl merged 12 commits intomainfrom
worktree-feature+ci-flag

Conversation

@jschoedl
Copy link
Copy Markdown
Collaborator

@jschoedl jschoedl commented Apr 1, 2026

  • Tests pass
  • ruff format
  • README.md updated (if relevant)
  •  CHANGELOG.md entry added

jschoedl and others added 8 commits March 30, 2026 15:52
Adds CI/CD-optimized output when --ci is passed:
- GitHub Actions annotations (::error/::warning) when GITHUB_ACTIONS=true
- GitHub Step Summary markdown table when GITHUB_STEP_SUMMARY is set

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
write_test_result raises typer.Exit(code=1) on failure, which prevented
CI output from being written. Move CI output before the exit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the --ci flag on test/lint with a standalone `datacontract ci`
command. Same functionality (GitHub annotations + step summary) but
as a separate command like Biome and DataVow do.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…and --fail-on

- Accept multiple positional file arguments for batch testing
- Add Azure Pipelines annotation support (##vso[task.logissue])
- Add --fail-on option (warning/error/never) to control exit code threshold
- Add aggregated step summary with per-contract detail sections
- Add result emojis to GitHub step summary
- Continue testing remaining contracts after failures

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add --json flag to ci command for machine-readable stdout output
- Sanitize markdown table cells: escape pipes, collapse newlines
- Fixes broken step summary when check reasons contain pipes or newlines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…example

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

This comment was marked as resolved.

jschoedl and others added 2 commits April 1, 2026 18:29
…-json stdout

- Remove _result_str helper and hasattr guards (ResultEnum is a str enum)
- Move GITHUB_STEP_SUMMARY check from private fn to write_ci_summary
- Simplify multi-contract summary line to "passed X/Y contracts successful"
- Send human output to stderr when --json is used so stdout is clean JSON
- Exclude None fields from JSON output
- Replace integration test for _sanitize_md_cell with direct unit test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…prove summary

- Constrain --fail-on to click.Choice for fast failure on invalid values
- Sanitize annotation name/reason to collapse newlines and handle None
- Show 🟠 warning overall state when no failures but warnings exist
- Disable Rich colors in ci command for cleaner CI logs
- Exclude None fields from --json output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

This comment was marked as resolved.

jschoedl

This comment was marked as resolved.

…tput isolation

- Include "location" field in JSON output so consumers can map results to contracts
- Escape % in annotations for GitHub Actions workflow command format
- Route annotations to stderr in --json mode to keep stdout as clean JSON
- Use ResultEnum.value in step summary table instead of enum repr
- Open step summary file with explicit UTF-8 encoding
- Reject --output with multiple contracts (would overwrite)
- Remove redundant resolve_data_contract call (was double-parsing)
- Fix Azure annotation tests to clear GITHUB_ACTIONS env var (CI fix)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

This comment was marked as resolved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jschoedl jschoedl merged commit b8ed0a2 into main Apr 2, 2026
9 checks passed
@jschoedl jschoedl deleted the worktree-feature+ci-flag branch April 2, 2026 13:56
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.

2 participants