Skip to content

feat: Add CI and CD workflows for automated build, testing, and release - #1

Merged
Wembie merged 17 commits into
mainfrom
dev
May 9, 2026
Merged

feat: Add CI and CD workflows for automated build, testing, and release#1
Wembie merged 17 commits into
mainfrom
dev

Conversation

@Wembie

Copy link
Copy Markdown
Owner

No description provided.

@WembieWembie self-assigned this May 8, 2026
Wembie added 3 commits May 8, 2026 16:14
- Updated `.flake8` to extend ignore for E501.
- Modified `pyproject.toml` to include additional ignore rules for Ruff.
- Refactored type hints in `cli.py`, `config.py`, `engine.py`, `pipeline.py`, `registry.py`, and other files for better clarity and consistency.
- Improved logging and error handling in various modules.
- Enhanced readability by reformatting long lines and ensuring consistent indentation.
- Updated hardcoded credential patterns in `auth.py` and `injection.py` for better regex clarity.
- Adjusted datetime handling to use UTC consistently across models.

CopilotAI 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.

Pull request overview

Adds GitHub Actions CI/CD automation for the SENTINEL Python package, alongside dependency and small codebase cleanups to support consistent linting/testing and versioning.

Changes:

  • Introduces CI workflow to enforce VERSION bumping and run ruff/black/mypy/pytest (with coverage).
  • Introduces CD workflow to build artifacts and create a tag + GitHub Release when VERSION changes on main.
  • Updates packaging/dev-dependency configuration (uv groups) and performs minor typing/formatting refactors across the codebase.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
VERSIONBumps project version to 0.1.4.
uv.lockAdds coverage/pytest-cov and updates lock metadata for new dev dependency grouping.
sentinel/rules/builtin/injection.pyMinor regex string formatting consistency changes.
sentinel/rules/builtin/auth.pyFormatting/line-wrapping adjustments to patterns and exploit-chain construction.
sentinel/reporting/sarif_reporter.pyMinor formatting change for locations fallback expression.
sentinel/reporting/markdown_reporter.pyMinor formatting change in markdown table header lines.
sentinel/parsers/treesitter.pySplits multi-import for clarity/formatting.
sentinel/models/graph.pyMigrates enum types to StrEnum (Py 3.11+) for better string-enum ergonomics.
sentinel/models/finding.pyMigrates to StrEnum and uses datetime.UTC in default timestamp.
sentinel/models/audit.pyMigrates to StrEnum, tightens typing, and cleans up annotations.
sentinel/mcp.pyFormatting cleanup; adds debug logging for parse failures; minor refactors for readability.
sentinel/logging.pyImproves typing and readability around structlog processor configuration.
sentinel/llm/openai.pyMinor formatting of structured-system prompt assembly.
sentinel/llm/claude.pyMinor formatting of structured-system prompt assembly.
sentinel/graph/builder.pyFormatting + safer string conversion for AST child text extraction.
sentinel/graph/backend.pyFormatting cleanup in list comprehensions / path finding.
sentinel/core/registry.pyImproves typing for decorator registration and removes type: ignore via cast().
sentinel/core/pipeline.pyUpdates return type annotation to non-string form (relies on future annotations).
sentinel/core/engine.pyUses datetime.UTC; removes unused import; uses zip(..., strict=True) for safer pairing.
sentinel/config.pyFormatting cleanup in settings source tuple return.
sentinel/cli.pyTyping improvements, Optional modernizations, and some formatting tidy-ups.
pyproject.tomlMoves dev deps to [dependency-groups], adds pytest-cov, and updates ruff ignores.
.github/workflows/ci.ymlAdds CI workflow (lint/format/typecheck/tests + VERSION bump gate).
.github/workflows/cd.ymlAdds CD workflow (build + tag/release on VERSION change).
.flake8Simplifies flake8 config (now only ignores E501).

Comment on lines +24 to +33
- name: Check if VERSION changed
id: ver
run: |
if git diff HEAD~1 HEAD -- VERSION | grep -q '^+[^+]'; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "version=$(cat VERSION | tr -d '[:space:]')" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "version=$(cat VERSION | tr -d '[:space:]')" >> $GITHUB_OUTPUT
fi

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

Implemented in 48dd2ed: CD now checks VERSION changes across the full push range (${{ github.event.before }}..${{ github.sha }}), with a null-SHA fallback path, so multi-commit pushes won’t miss a VERSION bump.

Comment thread.github/workflows/cd.yml Outdated
Comment on lines +43 to +48
- name: Sync version to static manifests
run: python scripts/sync_version.py

- name: Build package
run: uv build

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

Applied in b886a34: CD no longer relies on workflow-time manifest mutation for release output correctness; it now runs sync_version.py and fails if any workspace changes are introduced, so releases only proceed when synced manifest updates are already committed.

Comment on lines +20 to +29
- name: Ensure VERSION was bumped
if: github.event_name == 'pull_request'
shell: bash
run: |
BASE_VERSION="$(git show "${{ github.event.pull_request.base.sha }}:VERSION")"
HEAD_VERSION="$(git show "${{ github.event.pull_request.head.sha }}:VERSION")"
if [ "$BASE_VERSION" = "$HEAD_VERSION" ]; then
echo "::error::VERSION not bumped. Bump VERSION before merging."
exit 1
fi

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

Implemented in b0cae5c: CI now trims whitespace from base/head VERSION values, validates both as semver, and then checks that VERSION was actually bumped. No UI changes in this update.

@Wembie
Wembie merged commit d05f322 into mainMay 9, 2026
1 check passed
Sign up for freeto 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

@Wembie