Skip to content

Conversation

@pkuczynski
Copy link
Collaborator

@pkuczynski pkuczynski commented Nov 10, 2025

Description of change

  1. Tests if docs builds
  2. Detect changes in the PR
  3. Runs certain jobs depending on the changes in the PR

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change

Summary by CodeRabbit

  • Chores
    • CI now detects which areas changed and runs only the relevant jobs.
    • Formatting runs only for lint-related changes.
    • Docs, build, tests, and coverage jobs trigger conditionally based on detected changes.
    • Jobs are gated by a centralized change-detection step, removing unconditional push-triggered runs.

@pkuczynski pkuczynski self-assigned this Nov 10, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Warning

Rate limit exceeded

@pkuczynski has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 2 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between eafd9e5 and 512a13e.

📒 Files selected for processing (1)
  • .github/workflows/commit-validation.yml (3 hunks)

Walkthrough

Refactors the GitHub Actions workflow to add a detect-changes job that classifies path-based changes and exposes outputs; downstream jobs (formatting, docs, build, platform tests, coverage) are now gated and run conditionally based on those detected change categories.

Changes

Cohort / File(s) Summary
Workflow main file
\.github/workflows/commit-validation.yml
Replaces unconditional push dispatch with a detect-changes job that applies path filters (package-json, docs, src-or-tests, lint) and exposes a changes output; adds a formatting job triggered only on lint changes; runs docs, build, tests (linux/windows) and coverage conditionally based on detect-changes outputs and adjusts needs/dependencies and artifact handling accordingly.

Sequence Diagram(s)

sequenceDiagram
    participant Event as Push/PR
    participant Detect as detect-changes
    participant Format as formatting
    participant Docs as docs
    participant Build as build
    participant TestLinux as tests-linux
    participant TestWin as tests-windows
    participant Coverage as coverage

    Event->>Detect: start workflow
    activate Detect
    Detect->>Detect: evaluate path filters<br/>emit outputs (lint/docs/src-or-tests/...)
    deactivate Detect

    par Conditional branches
        alt lint detected
            Detect->>Format: run formatting
            activate Format
            Format-->>Format: format checks/changes
            deactivate Format
        end

        alt docs detected
            Detect->>Docs: run docs job (cwd: ./docs)
            activate Docs
            Docs-->>Docs: build docs
            deactivate Docs
        end

        alt src-or-tests detected
            Detect->>Build: run build
            activate Build
            Build-->>Build: install/compile/upload artifacts
            Build->>TestLinux: trigger platform tests (depends on build)
            Build->>TestWin: trigger platform tests (depends on build)
            deactivate Build

            par platform tests
                TestLinux-->>Coverage: report results
                TestWin-->>Coverage: report results
            end

            Coverage->>Coverage: aggregate/generate coverage
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify detect-changes path filters and emitted output values.
  • Validate if conditions and needs to ensure correct gating and no deadlocks.
  • Check artifact upload/download adjustments between build and tests/coverage.
  • Confirm formatting job runs only when lint changes are detected.

Poem

🐰
I sniff the diff with twitching nose,
Skip idle runs where no change grows.
Jobs now hop where paths have led,
A gentle spring from bed to bed.
Tiny paws — CI neatly fed.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding conditional CI job execution based on detected changes, with emphasis on the docs build task.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/commit-validation.yml (1)

23-23: Remove temporary code before merge.

Based on a prior review comment, the .github/workflows/** path on line 23 in the docs filter is temporary and should be removed before this PR is merged.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51fbcf4 and 7910f79.

📒 Files selected for processing (1)
  • .github/workflows/commit-validation.yml (3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/commit-validation.yml

106-106: property "detect-changes" is not defined in object type {tests-linux: {outputs: {}; result: string}; tests-windows: {outputs: {}; result: string}}

(expression)

🔇 Additional comments (2)
.github/workflows/commit-validation.yml (2)

8-9: Verify the detect-changes output format.

Multiple jobs reference needs.detect-changes.outputs.changes with contains(), assuming it's a string listing filter names. However, the dorny/paths-filter@v3 action typically outputs individual boolean flags for each filter (e.g., docs: 'true', src-or-tests: 'false'), not a combined changes string.

Verify that this output format is correct and that the conditions work as intended. If the action's default behavior has changed or you're using a custom configuration, this is fine; otherwise, the conditions may need adjustment (e.g., if: needs.detect-changes.outputs.src-or-tests == 'true').

Also applies to: 44-44, 57-57, 72-72, 89-89, 100-100, 107-107


33-33: Verify the test workflows path.

The path workflows/test/**/* on line 33 appears unusual. Verify this is the correct path for matching test workflow files. Given the context, did you intend .github/workflows/tests-*.yml or a similar pattern?

Copy link
Collaborator

@mguida22 mguida22 left a comment

Choose a reason for hiding this comment

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

thanks!

pkuczynski and others added 2 commits November 11, 2025 01:25
Co-authored-by: Mike Guida <mike@mguida.com>
Co-authored-by: Mike Guida <mike@mguida.com>
@@ -1,22 +1,49 @@
name: Commit Validation
on:
push:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This didn't make a lot of sense to me, as we always work via PRs, so no need to verify manual pushes, which should never happen...

branches:
- "**"
paths-ignore:
- "docs/**"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why docs where excluded, but certainly they can't now. We want to test if docs still builds with the changes from the PR...

- docs/**/*
- .github/workflows/**
src: &src
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Possibly this could be named better as it's a bit wider than only the source. I typically name it app, but does not fit this repo. Any suggestions welcome!

# Conflicts:
#	.github/workflows/commit-validation.yml
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3efc3ff and eafd9e5.

📒 Files selected for processing (1)
  • .github/workflows/commit-validation.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
.github/workflows/commit-validation.yml (6)

43-54: Formatting job structure looks good.

Condition, dependency, and steps are correctly configured. The job will conditionally run when lint changes are detected.

Later in the file (lines 64–65), other jobs use actions/checkout@v5 and actions/setup-node@v5. Please verify these action versions are current and not outdated. The current versions of these actions may be v4 or higher.


56-69: Docs job structure is correct.

Condition, dependency, and working directory are properly configured. The job will build documentation only when docs changes are detected, isolated to the ./docs directory.


71-86: Build job structure is correct.

Condition, dependency, and artifact upload are properly configured. Compilation output is uploaded for downstream test jobs to consume.


88-97: Tests-linux job structure is correct.

Condition and dependencies properly gated. The job will run matrix tests across Node versions 18 and 20 only when source/test changes are detected, and depends on build to consume artifacts.


99-104: Tests-windows job structure is correct.

Condition and dependencies properly configured. The job will run on Node 20 only when source/test changes are detected.


106-113: Coverage job structure is correct.

The previous critical issue (missing detect-changes in needs) has been properly resolved. Dependencies now correctly include detect-changes, tests-linux, and tests-windows. The job will run only after all test jobs complete when source/test changes are detected.

@pkuczynski pkuczynski merged commit 5a28729 into typeorm:master Nov 11, 2025
61 checks passed
@pkuczynski pkuczynski deleted the ci/test-docs branch November 11, 2025 11:35
@coveralls
Copy link

Coverage Status

coverage: 76.433%. remained the same
when pulling 512a13e on pkuczynski:ci/test-docs
into ba3319d on typeorm:master.

@alumni
Copy link
Collaborator

alumni commented Nov 18, 2025

@pkuczynski The tests are no longer running after this PR was merged. Could you please take a look?

CC: @mguida22 @gioboa

@pkuczynski
Copy link
Collaborator Author

@alumni what do you mean they don't run? I can see them run #11774 or #11769

@alumni
Copy link
Collaborator

alumni commented Nov 18, 2025

in the master branch, this commit should have run all the tests: 2681051

@pkuczynski
Copy link
Collaborator Author

They were run on PR (check here), so what's the point on runing them again on master? Our pipeline is already super slow...

@pkuczynski
Copy link
Collaborator Author

There is no way to merge PR currently if the CI did not run

@alumni
Copy link
Collaborator

alumni commented Nov 18, 2025

what's the point on runing them again on master?

We want to ensure that the main branch in this repo is stable, regardless of the PR status.

@pkuczynski
Copy link
Collaborator Author

We want to ensure that the main branch in this repo is stable, regardless of the PR status.

If nobody can merge a PR which is not ahead of master and nobody can commit to master without a PR, than running the same 30min pipeline seems totaly obsolete to me.

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.

5 participants