Skip to content

Test CI quality checks workflow with TypeScript file changes#33

Closed
pjurczynski wants to merge 6 commits into
devill:mainfrom
pjurczynski:test/ci-quality-check-workflow
Closed

Test CI quality checks workflow with TypeScript file changes#33
pjurczynski wants to merge 6 commits into
devill:mainfrom
pjurczynski:test/ci-quality-check-workflow

Conversation

@pjurczynski

@pjurczynski pjurczynski commented Jul 9, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Add test file with intentional quality issues to verify CI workflow
  • Test that quality checks run correctly on changed TypeScript files
  • Verify fetch-depth: 2 setting allows git diff to work properly

Test Plan

  • Create TypeScript file with multiple quality issues:
    • Method with too many parameters (5 parameters)
    • High cyclomatic complexity with nested conditions
    • Comments that trigger comment-related quality checks
    • Feature envy pattern
    • Console statements (ESLint violations)
  • Verify CI workflow correctly identifies changed .ts files
  • Check that quality checks run only on changed files
  • Confirm quality issues are properly reported in CI output
  • Verify no "bad object" errors occur with git diff

Expected Behavior

The CI workflow should:

  1. Detect that src/test-ci-quality.ts has changed
  2. Run quality checks specifically on this file
  3. Report the intentional quality issues found
  4. Complete without git diff errors

🤖 Generated with Claude Code

pjurczynski and others added 6 commits July 9, 2025 23:51
The quality script already includes linting along with other comprehensive code quality checks (complexity, duplication, code smells, etc.), so the separate lint step is redundant.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
GitHub Actions uses shallow clones by default (fetch-depth: 1) which only
fetches the latest commit. Our quality check script uses `git diff --name-only
HEAD~1 HEAD` to identify changed files in push events, but HEAD~1 doesn't
exist in a shallow clone with only one commit.

Setting fetch-depth: 2 ensures that both HEAD and HEAD~1 are available,
allowing the script to compare the current commit with its parent to determine
which TypeScript files have changed and need quality checking.

This prevents the "fatal: bad object [SHA]" error that occurs when the script
tries to reference HEAD~1 in a shallow clone environment.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This file intentionally contains quality issues to test that the CI workflow
correctly runs quality checks on changed TypeScript files:

- Method with too many parameters (5 parameters)
- High cyclomatic complexity with nested conditions
- Comments that may trigger comment-related quality checks
- Potential feature envy pattern

This will help verify that:
1. The CI workflow correctly identifies changed .ts files
2. Quality checks run only on changed files
3. The fetch-depth: 2 setting allows git diff to work properly
4. Quality issues are properly reported in the CI output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pjurczynski pjurczynski closed this Jul 9, 2025
@pjurczynski
pjurczynski deleted the test/ci-quality-check-workflow branch July 9, 2025 22:20
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.

1 participant