eslint-plugin-traceability 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,59 +39,84 @@ Currently, version bumping requires manual intervention through direct package.j
39
39
 
40
40
  ## Decision Outcome
41
41
 
42
- Chosen option: "npm version command with automated execution in CI/CD", because it provides direct integration with npm tooling, maintains simplicity in the CI/CD pipeline, allows for both automated and manual control when needed, and follows established npm ecosystem practices without requiring complex semantic analysis tooling.
42
+ Chosen option: "Version Increment Without Git Commits", because it eliminates CI/CD loop complexity, requires no git write permissions, solves the immediate npm publish failures, and provides the simplest implementation while maintaining full automation.
43
43
 
44
44
  ### Implementation Strategy
45
45
 
46
- The CI/CD pipeline will be modified to:
46
+ The CI/CD pipeline will use in-memory version increments without git write-back:
47
47
 
48
- 1. **Pre-publish Version Check**: Before attempting to publish, check if the current package.json version already exists on npm
49
- 2. **Automatic Patch Increment**: If the version exists, automatically increment the patch version using `npm version patch`
50
- 3. **Commit and Tag**: Create a version commit and git tag as part of the pipeline
51
- 4. **Publish with New Version**: Proceed with npm publish using the incremented version
52
- 5. **Changelog Update**: Automatically update CHANGELOG.md with the new version entry
48
+ 1. **Pre-publish Version Check**: Before attempting to publish, check if the current package.json version already exists on npm using `npm view eslint-plugin-traceability@<version>`
49
+ 2. **In-Memory Version Increment**: If the version exists on npm, increment the patch version in the pipeline workspace using `npm version patch --no-git-tag-version`
50
+ 3. **Immediate Publish**: Proceed with npm publish using the incremented version without any git operations
51
+ 4. **Pipeline Logging**: Log the version increment action for visibility and debugging
52
+ 5. **No Git Write-Back**: The incremented version exists only in the pipeline workspace and is never committed back to the repository
53
+
54
+ ### Primary Approach Considered
55
+
56
+ **Git Write-Back with Version Commits**: Increment version in pipeline, publish to npm, then commit version changes and create git tags with `[skip ci]` to prevent recursion. This approach was rejected due to complexity concerns including git write permissions, infinite loop prevention, post-publish failure handling, and potential race conditions in concurrent pipeline runs.
53
57
 
54
58
  ### Consequences
55
59
 
56
60
  - Good, because prevents all npm publish failures due to version conflicts
57
- - Good, because maintains automated delivery without manual intervention
58
- - Good, because creates proper git tags and version history
61
+ - Good, because maintains fully automated delivery without any manual intervention
62
+ - Good, because eliminates infinite CI/CD loop risks entirely
63
+ - Good, because requires no git write permissions or credentials in CI/CD
59
64
  - Good, because uses standard npm tooling that developers understand
60
- - Good, because allows for emergency manual version bumps when needed
61
- - Good, because integrates cleanly with existing CI/CD infrastructure
62
- - Neutral, because requires CI/CD pipeline to have git write access
63
- - Neutral, because creates additional commits in the main branch for version bumps
65
+ - Good, because simplest possible implementation with minimal failure modes
66
+ - Good, because each pipeline run is completely independent
67
+ - Good, because immediate resolution to publish failures with no complexity overhead
68
+ - Neutral, because package.json version may lag behind published npm version
69
+ - Neutral, because developers can check published version via `npm view eslint-plugin-traceability version`
64
70
  - Bad, because does not automatically determine semantic version type (major/minor/patch)
65
- - Bad, because may create noise in git history with automated version commits
71
+ - Bad, because no automatic git tags or version history created
66
72
 
67
73
  ### Confirmation
68
74
 
69
75
  Implementation compliance will be confirmed through:
70
76
 
71
77
  - CI/CD pipeline successfully publishes without version conflicts
72
- - Git repository contains version tags matching published npm versions
73
- - CHANGELOG.md automatically updated with version entries
78
+ - No npm publish failures due to existing version numbers
79
+ - No git write operations or credentials required in CI/CD
80
+ - No infinite pipeline loops or `[skip ci]` complexity needed
81
+ - Pipeline logs clearly show when version increments occur
82
+ - Published npm versions can be verified via `npm view eslint-plugin-traceability versions`
74
83
  - No manual intervention required for routine publishing
75
- - Version bumps traceable through git commit history
76
- - package.json version always synchronized with published npm version
77
84
 
78
85
  ## Pros and Cons of the Options
79
86
 
80
- ### npm version command with automated execution in CI/CD
87
+ ### Version Increment Without Git Commits
88
+
89
+ In-memory version increments during pipeline execution without any git write-back operations.
90
+
91
+ - Good, because eliminates all CI/CD loop complexity and infinite recursion risks
92
+ - Good, because requires no git write permissions or credentials in CI/CD environment
93
+ - Good, because simplest possible implementation with minimal failure modes
94
+ - Good, because each pipeline run is completely independent with no race conditions
95
+ - Good, because immediate resolution to npm publish failures
96
+ - Good, because uses standard npm version tooling familiar to developers
97
+ - Good, because no complex error handling for git operations required
98
+ - Neutral, because package.json version may not reflect latest published version
99
+ - Neutral, because published version always discoverable via npm registry
100
+ - Bad, because no automatic git tags created for release tracking
101
+ - Bad, because requires manual version management for major/minor releases
102
+ - Bad, because no automated version commit history
103
+
104
+ ### Git Write-Back with Version Commits
81
105
 
82
- Standard npm tooling with CI/CD automation provides reliable version management with minimal complexity.
106
+ Increment version in pipeline, publish to npm, then commit version changes and create git tags.
83
107
 
84
- - Good, because uses native npm version management tools
85
108
  - Good, because creates proper git tags and version commits automatically
86
- - Good, because simple to understand and maintain in CI/CD
87
- - Good, because allows manual override for major/minor version bumps
88
- - Good, because integrates with existing npm publish workflow
89
- - Good, because provides immediate resolution to publish failures
90
- - Good, because maintains compatibility with npm ecosystem tools
109
+ - Good, because maintains package.json synchronization with published versions
110
+ - Good, because provides complete version history in git repository
111
+ - Good, because allows for automated CHANGELOG.md updates
112
+ - Good, because follows traditional npm ecosystem patterns
91
113
  - Neutral, because requires configuration of git credentials in CI/CD
92
- - Neutral, because creates automated commits that may clutter history
93
- - Bad, because defaults to patch-level increments only
94
- - Bad, because does not analyze commit messages for semantic versioning
114
+ - Neutral, because creates automated commits with CI skip directives
115
+ - Bad, because requires complex infinite loop prevention with `[skip ci]`
116
+ - Bad, because potential for git write failures after successful npm publish
117
+ - Bad, because introduces race conditions in concurrent pipeline runs
118
+ - Bad, because requires git write permissions and credential management
119
+ - Bad, because adds multiple failure modes beyond the core publish operation
95
120
 
96
121
  ### Semantic Release with automated version detection
97
122
 
@@ -124,42 +149,46 @@ Requiring manual version increments before publishing with workflow validation.
124
149
  - Bad, because does not solve the original npm publish failure problem
125
150
  - Bad, because creates friction in development workflow
126
151
 
127
- ### Version bumping through GitHub Actions with npm version
152
+ ## More Information
128
153
 
129
- GitHub Actions-specific tooling for automated version management within the existing platform.
154
+ This decision addresses the immediate CI/CD publish failures with the simplest possible solution that eliminates complexity while maintaining full automation. The in-memory version increment approach provides immediate relief from npm publish conflicts without introducing git write-back complexity.
130
155
 
131
- - Good, because native integration with GitHub workflow ecosystem
132
- - Good, because can leverage GitHub-specific features like releases
133
- - Good, because may provide better integration with pull request workflows
134
- - Good, because uses familiar GitHub Actions patterns
135
- - Neutral, because similar capabilities to npm version approach
136
- - Bad, because locks solution to GitHub Actions platform specifically
137
- - Bad, because may require additional GitHub Actions marketplace dependencies
138
- - Bad, because potentially less portable to other CI/CD systems
139
- - Bad, because npm version command is more universally understood
156
+ Key implementation details:
140
157
 
141
- ## More Information
158
+ ```yaml
159
+ - name: Prepare version for publish
160
+ run: |
161
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
162
+ echo "Current package.json version: $CURRENT_VERSION"
142
163
 
143
- This decision addresses the immediate CI/CD publish failures while establishing a foundation for reliable automated delivery. The implementation should be flexible enough to support future migration to semantic release if the project grows to require more sophisticated version management.
164
+ # Check if this version exists on npm
165
+ if npm view eslint-plugin-traceability@$CURRENT_VERSION version >/dev/null 2>&1; then
166
+ echo "Version $CURRENT_VERSION already exists on npm, incrementing..."
167
+ npm version patch --no-git-tag-version
168
+ NEW_VERSION=$(node -p "require('./package.json').version")
169
+ echo "Bumped version to: $NEW_VERSION"
170
+ else
171
+ echo "Version $CURRENT_VERSION is available, proceeding with publish"
172
+ fi
144
173
 
145
- Key implementation considerations:
174
+ - name: Publish package
175
+ run: npm publish --access public
176
+ ```
146
177
 
147
- - Configure CI/CD pipeline with appropriate git credentials for version commits
148
- - Set up git user configuration for automated commits
149
- - Ensure version tags follow consistent naming convention (v1.0.0 format)
150
- - Update CHANGELOG.md generation to work with automated version increments
151
- - Consider branch protection rules that allow CI/CD version commits
152
- - Document manual override process for major/minor version bumps
178
+ Implementation considerations:
153
179
 
154
- This decision should be re-evaluated if:
180
+ - No git credentials or write permissions required in CI/CD
181
+ - Version increments are logged for visibility and debugging
182
+ - Each pipeline run operates independently with no side effects
183
+ - Published versions remain discoverable via `npm view eslint-plugin-traceability versions`
184
+ - Manual version bumps for major/minor releases can still be done via git commits
185
+ - Future migration to git write-back approach remains possible if needed
155
186
 
156
- - Project adopts semantic versioning discipline across the team
157
- - Commit message standardization becomes feasible
158
- - Publishing frequency increases significantly requiring more sophisticated automation
159
- - The simple patch increment approach becomes insufficient for change communication
187
+ This decision should be re-evaluated if:
160
188
 
161
- Related resources:
189
+ - Package.json/npm version drift becomes problematic for development workflow
190
+ - Automatic git tagging becomes a requirement for release management
191
+ - The team adopts semantic versioning discipline requiring commit message analysis
192
+ - Integration with automated changelog generation becomes necessary
162
193
 
163
- - [npm version command documentation](https://docs.npmjs.com/cli/v9/commands/npm-version)
164
- - [GitHub Actions CI/CD Best Practices](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments)
165
- - [Semantic Versioning Specification](https://semver.org/)
194
+ The simplicity of this approach allows for easy migration to more complex solutions later while solving the immediate problem with minimal risk and complexity.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-traceability",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",