Skip to content

Conversation

@deresegetachew
Copy link
Owner

This pull request refactors and modernizes the "Require Changeset" GitHub Action by replacing the previous Bash-based workflow with a modular, testable Node.js implementation. The changes introduce a service-oriented architecture, improved error handling, and comprehensive documentation for utility classes. The update also adds automated tests to ensure reliability and maintainability.

Require Changeset Action Refactor:

  • The old Bash-based workflow in .github/actions/require-changeset/action.yaml is removed and replaced by a Node.js implementation using .github/scripts/require-changeset/require-changeset.js and supporting modules. This allows for better modularity, error handling, and testability. [1] [2]

Service Architecture & GitHub Integration:

  • Introduced ChangesetRequirementService in .github/scripts/require-changeset/services/changeset-requirement.service.js, which encapsulates logic for validating changeset requirements, skipping checks for bots/releases/labels, and fetching changed files using multiple strategies for robustness. [1] [2]
  • The main action script dynamically imports GitHub Actions modules from a CDN for runtime flexibility and sets outputs or fails the action based on validation results.

Testing and Reliability:

  • Added a test suite in .github/scripts/require-changeset/require-changeset.test.js using Node.js test and mock APIs, verifying service exports and integration logic.

Utility Class Improvements and Documentation:

  • Enhanced documentation for FSUtil (.github/scripts/utils/fs.util.js) and PackageUtil (.github/scripts/utils/package.util.js), including detailed JSDoc comments and examples for all methods, improving developer experience and maintainability. [1] [2] [3] [4] [5]

Robust Git Operations:

  • GitUtil now supports multiple fallback strategies for detecting changed files between branches/commits, increasing reliability of the changeset check in various CI scenarios.

…tation

- Removed the action.yaml file for the require-changeset GitHub Action.
- Introduced a new JavaScript script (require-changeset.js) to handle changeset validation.
- Created a ChangesetRequirementService class to encapsulate changeset validation logic.
- Added unit tests for the ChangesetRequirementService to ensure functionality.
- Updated the CI workflow to use the new script instead of the action.
- Enhanced utility classes (FSUtil, GitUtil, ShellUtil, PackageUtil) with additional methods and documentation.
@deresegetachew deresegetachew self-assigned this Nov 2, 2025
@github-actions
Copy link

github-actions bot commented Nov 2, 2025

Coverage Summary (2 packages)

Package Lines Statements Branches Functions
@systemcraft/lib-one 100.0% 🟢 +100.0% 100.0% 🟢 +100.0% 77.8% 🟢 +77.8% 100.0% 🟢 +100.0%
@systemcraft/lib-two

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

💂‍♂️ CodeQL Security Scan 💂‍♂️

Total alerts: 0

By severity (security_severity_level):

  • critical: 0
  • high: 0
  • medium: 0
  • low: 0

By result level:

This comment updates automatically when new analysis runs.

- Deleted setup.js, fs.util.js, fs.util.test.js, git.util.js, git.util.test.js, package.util.js, package.util.test.js, shell.util.js, and shell.util.test.js as they are no longer needed.
- Updated CI workflow to integrate new changeset validation and release steps.
- Adjusted GitHub Actions to use new action implementations for changeset validation and release management.
@deresegetachew deresegetachew added the [skip changeset check] Skip the changeset validation check label Nov 8, 2025
@deresegetachew deresegetachew added the duplicate This issue or pull request already exists label Nov 16, 2025
@deresegetachew deresegetachew merged commit 2089b56 into main Nov 16, 2025
51 checks passed
@deresegetachew deresegetachew deleted the fix/release-scripts branch November 16, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists [skip changeset check] Skip the changeset validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants