Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

@kumarUjjawal kumarUjjawal commented Jul 2, 2025

Description

Added a new Github workflow to run cargo semvar checks on every PR.

Closes #357

@github-actions github-actions bot added the A-ci Area: CI (Continuous Integration) label Jul 2, 2025
Copy link
Member

@seqre seqre left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @kumarUjjawal! Instead of it being a separate workflow, please add it to our Rust CI workflow as another job!

@kumarUjjawal
Copy link
Contributor Author

Thank you for your contribution @kumarUjjawal! Instead of it being a separate workflow, please add it to our Rust CI workflow as another job!

Ok Sure!

@kumarUjjawal
Copy link
Contributor Author

@seqre Should I add if after the miri ?

@seqre
Copy link
Member

seqre commented Jul 2, 2025

@kumarUjjawal, just add it at the end, but make it require our Build & test job.

@codecov
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
rust 89.25% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@m4tx m4tx left a comment

Choose a reason for hiding this comment

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

Two cents from me:

  1. I don't think we should compare with the latest tag. We should compare with PR's destination branch (usually master, but could be something else), so that we only get warnings/errors about current PR, rather than everything since the last release (which isn't very informative, especially when there's a lot of changes since the last release).
  2. I think it would be ideal for this to create a GitHub comment with a summary of the checks (similarly to what codecov creates). However, if this would require a non-trivial amount of work, I'm fine with keeping this as is now—as a check in our workflow (which fails if there's a non-zero number of errors). (any thoughts on this @seqre?)

@m4tx m4tx changed the title Run cargo semvar checks on PR chore(ci): run cargo semver checks on PRs Jul 2, 2025
@kumarUjjawal
Copy link
Contributor Author

Two cents from me:

  1. I don't think we should compare with the latest tag. We should compare with PR's destination branch (usually master, but could be something else), so that we only get warnings/errors about current PR, rather than everything since the last release (which isn't very informative, especially when there's a lot of changes since the last release).

Does this aligns with what you intended?

- name: Determine merge base
  id: merge_base
  run: |
    git fetch origin ${{ github.base_ref || 'master' }}
    echo "base=$(git merge-base HEAD origin/${{ github.base_ref || 'main' }})" >> $GITHUB_OUTPUT
  1. I think it would be ideal for this to create a GitHub comment with a summary of the checks (similarly to what codecov creates). However, if this would require a non-trivial amount of work, I'm fine with keeping this as is now—as a check in our workflow (which fails if there's a non-zero number of errors). (any thoughts on this @seqre?)

I will wait for @seqre for the comments about this one.

Copy link
Member

@seqre seqre left a comment

Choose a reason for hiding this comment

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

Regarding the above question, I'd skip the automatic comment creation for now. In most cases, there should not be violations, so that comment would only clutter the conversation. In the few instances where there is an unexpected violation, we can simply check the job logs.

@kumarUjjawal kumarUjjawal requested a review from seqre July 4, 2025 16:31
Copy link
Member

@seqre seqre left a comment

Choose a reason for hiding this comment

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

LGTM! We'll just have to test it now and see if it works

Copy link
Member

@m4tx m4tx left a comment

Choose a reason for hiding this comment

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

@kumarUjjawal the workflow does not run:

The workflow is not valid. .github/workflows/rust.yml (Line: 384, Col: 9): Unexpected value '' .github/workflows/rust.yml (Line: 385, Col: 5): Unexpected value 'RUSTC_WRAPPER'

https://github.com/cot-rs/cot/actions/runs/16079459652

Please fix the issue and then we should be able to merge this.

@kumarUjjawal
Copy link
Contributor Author

@kumarUjjawal the workflow does not run:

The workflow is not valid. .github/workflows/rust.yml (Line: 384, Col: 9): Unexpected value '' .github/workflows/rust.yml (Line: 385, Col: 5): Unexpected value 'RUSTC_WRAPPER'

https://github.com/cot-rs/cot/actions/runs/16079459652

Please fix the issue and then we should be able to merge this.

There was an identation issue, should work now.

@kumarUjjawal kumarUjjawal requested a review from m4tx July 5, 2025 04:30
Copy link
Member

@m4tx m4tx left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks a lot for the contribution!

@m4tx m4tx merged commit 2366503 into cot-rs:master Jul 5, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci Area: CI (Continuous Integration)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run cargo-semver-checks in PRs

3 participants