New Workflow for pull requests#1
Conversation
MichielDean
commented
May 23, 2025
- Adding a PR workflow
There was a problem hiding this comment.
Pull Request Overview
This PR is adding a new GitHub Actions workflow to run CI on pull requests.
- Added a lint-and-format job that checks code formatting and linting.
- Added a build-and-test job that builds the application and runs tests after dependencies are installed.
There was a problem hiding this comment.
Pull Request Overview
Adds end-to-end CI validation, local formatting enforcement, and cleanup helpers to ensure tests don’t hang in CI environments.
- Introduces Jest and system-test teardown scripts to force-clear pending timers and GC handles
- Configures Husky and lint-staged for pre-commit formatting checks
- Adds a GitHub Actions workflow to run format checks, linting, build, and tests on every pull request
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/closeHandles.js | New Jest globalTeardown helper to close open timers and GC handles |
| tests/system/teardown.ts | Extended system-test teardown with a timer‐cleanup loop |
| test-format.js | Intentionally unformatted file to validate the pre-commit hook |
| package.json | Added test:ci script, bumped type versions, and Husky/lint-staged |
| .husky/pre-commit | Pre-commit hook invoking lint-staged |
| .github/workflows/pullRequest.yml | New PR CI workflow for format, lint, build, and tests |
Comments suppressed due to low confidence (2)
tests/utils/closeHandles.js:20
- [nitpick] The variable name
timerIdssuggests multiple values but holds a single handle reference. Consider renaming it to something likelastTimeoutHandlefor clarity.
for (let i = 1; i < timerIds; i++) {
test-format.js:1
- [nitpick] Consider adding a more descriptive header or moving this file under a dedicated tests directory so its purpose is clearer to new contributors.
// This is an intentionally unformatted file to test our pre-commit hook
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…into prWorkflow
There was a problem hiding this comment.
Pull Request Overview
Adds a GitHub Actions workflow and related tooling to enforce formatting, linting, and teardown procedures in CI.
- Introduces a pull request CI workflow (
.github/workflows/pullRequest.yml) that runs formatting checks, linting, builds, and tests. - Adds global and system test teardown helpers to close hanging handles and timers.
- Configures pre-commit hooks, lint-staged,
.gitattributes, and updatespackage.jsonscripts and dependencies.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/closeHandles.js | New Jest globalTeardown helper closing timers/handles |
| tests/system/teardown.ts | Adds timer cleanup in system test teardown |
| test-format.js | Unformatted file to validate pre-commit formatting |
| package.json | Expanded format targets, added test:ci script, lint-staged config, bumped deps |
| CODEOWNERS | Assigns code ownership |
| .prettierrc | Enforce LF line endings |
| .husky/pre-commit | Registers lint-staged in pre-commit hook |
| .github/workflows/pullRequest.yml | CI workflow for PRs |
| .gitattributes | Normalize line endings across file types |
Comments suppressed due to low confidence (2)
tests/utils/closeHandles.js:21
- The
Timeoutconstructor isn’t defined in this module. Consider importing it from thetimersmodule (e.g.,const { Timeout } = require('timers');) or use a built-in check such astypeof handle.refresh === 'function'.
if (handle instanceof Timeout) {
CODEOWNERS:3
- The entry is missing a file pattern. To assign ownership to all files, use
* @MichielDeanwithout a leading dash.
- @MichielDean
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Adds a PR-specific CI workflow, enforces consistent formatting with pre-commit hooks, and introduces teardown utilities to clean up lingering handles in tests.
- Introduce
.github/workflows/pullRequest.ymlfor lint, format, build, and test jobs - Add Husky and lint-staged pre-commit hook, update
.prettierrcand.gitattributesfor LF normalization - Implement
closeHandles.jsand enhance system teardown to avoid hanging handles
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/closeHandles.js | New Jest globalTeardown helper to force‐close timers/handles |
| tests/system/teardown.ts | Added dummy timeout cleanup in system teardown |
| test-format.js | Unformatted file used to validate pre-commit formatting hook |
| package.json | Extended format scripts, added test:ci, Husky & lint-staged |
| CODEOWNERS | Added an owner entry |
| .prettierrc | Set endOfLine to lf |
| .husky/pre-commit | Hook to run lint-staged |
| .github/workflows/pullRequest.yml | New CI workflow |
| .gitattributes | Normalize LF endings for text files |
Comments suppressed due to low confidence (3)
tests/utils/closeHandles.js:21
Timeoutis not defined in this scope and will cause a ReferenceError. Consider importing the correct timer class or checking handles via their constructor name or available methods (e.g., checking forhandle.hasRef).
if (handle instanceof Timeout) {
tests/utils/closeHandles.js:31
TEARDOWN_DELAY_MSis not defined, leading to a ReferenceError at runtime. Define this constant or replace it with an explicit delay value.
await new Promise(resolve => setTimeout(resolve, TEARDOWN_DELAY_MS));
CODEOWNERS:3
- The entry uses a leading dash with no path pattern, so it won’t match any files. CODEOWNERS requires a glob or path followed by owner(s) (e.g.,
* @MichielDean).
- @MichielDean
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new CI workflow for pull requests and enhances local/CI test teardown and formatting support.
- Adds a GitHub Actions workflow to lint, format, and run all tests (including Docker-based system tests).
- Introduces a Jest global teardown helper to explicitly close hanging handles.
- Updates local scripts and configurations: Docker compose commands, Prettier settings, Husky hooks, lint-staged, CODEOWNERS, and line-ending rules.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/pullRequest.yml | New CI workflow for PR linting, formatting, and test execution. |
| tests/utils/closeHandles.js | New Jest globalTeardown helper to clear open handles. |
| tests/system/teardown.ts | Adds extra timer cleanup in system test teardown. |
| tests/system/setup.ts(.new/functions) | Normalizes Docker compose invocation across system tests. |
| .husky/pre-commit & lint-staged | Sets up pre-commit formatting checks. |
| package.json | Expanded format targets, added test:ci, updated deps. |
| .gitattributes & .prettierrc | Enforces LF line endings across text files. |
| CODEOWNERS | Defines repository ownership. |
Comments suppressed due to low confidence (2)
tests/system/teardown.ts:70
- This zero-delay timer setup and immediate
clearTimeoutis effectively a no-op; you can remove this block or replace it with more explicit cleanup logic for lingering operations.
const timeout = setTimeout(() => {}, 0);
CODEOWNERS:3
- The leading dash is invalid in CODEOWNERS syntax; each entry should follow the pattern
<file-pattern> @owner. Remove the dash and add a file pattern (e.g.,* @MichielDean).
- @MichielDean
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>