Skip to content

New Workflow for pull requests#1

Merged
MichielDean merged 34 commits into
mainfrom
prWorkflow
May 23, 2025
Merged

New Workflow for pull requests#1
MichielDean merged 34 commits into
mainfrom
prWorkflow

Conversation

@MichielDean
Copy link
Copy Markdown
Owner

  • Adding a PR workflow

Copilot AI review requested due to automatic review settings May 23, 2025 21:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@MichielDean MichielDean enabled auto-merge (squash) May 23, 2025 21:18
@MichielDean MichielDean requested a review from Copilot May 23, 2025 22:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 timerIds suggests multiple values but holds a single handle reference. Consider renaming it to something like lastTimeoutHandle for 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

Comment thread tests/utils/closeHandles.js Outdated
Comment thread tests/system/teardown.ts Outdated
Comment thread .github/workflows/pullRequest.yml Outdated
@MichielDean MichielDean requested a review from Copilot May 23, 2025 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 updates package.json scripts 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 Timeout constructor isn’t defined in this module. Consider importing it from the timers module (e.g., const { Timeout } = require('timers');) or use a built-in check such as typeof handle.refresh === 'function'.
if (handle instanceof Timeout) {

CODEOWNERS:3

  • The entry is missing a file pattern. To assign ownership to all files, use * @MichielDean without a leading dash.
- @MichielDean

Comment thread tests/utils/closeHandles.js Outdated
Comment thread tests/utils/closeHandles.js Outdated
MichielDean and others added 2 commits May 23, 2025 16:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MichielDean MichielDean requested a review from Copilot May 23, 2025 22:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml for lint, format, build, and test jobs
  • Add Husky and lint-staged pre-commit hook, update .prettierrc and .gitattributes for LF normalization
  • Implement closeHandles.js and 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

  • Timeout is 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 for handle.hasRef).
      if (handle instanceof Timeout) {

tests/utils/closeHandles.js:31

  • TEARDOWN_DELAY_MS is 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

@MichielDean MichielDean requested a review from Copilot May 23, 2025 23:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 clearTimeout is 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

Comment thread tests/utils/closeHandles.js Outdated
Comment thread .husky/pre-commit
MichielDean and others added 3 commits May 23, 2025 17:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MichielDean MichielDean merged commit 041386a into main May 23, 2025
4 checks passed
@MichielDean MichielDean deleted the prWorkflow branch May 23, 2025 23:17
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.

2 participants