Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 of the action #21

Merged
merged 24 commits into from Feb 27, 2023
Merged

V2 of the action #21

merged 24 commits into from Feb 27, 2023

Conversation

mgr0dzicki
Copy link
Collaborator

@mgr0dzicki mgr0dzicki commented Jan 3, 2023

Uses cargo-semver-checks built-in logic instead of the bash scripts (closes #23).
Introduces option manifest-path (closes #18).
Introduces option verbose (closes #16).
Uses pre-built binaries (closes #8).

Because the default behavior is changed and inputs crate-target and version-tag-prefix are removed, a version bump to v2 is necessary.

@mgr0dzicki
Copy link
Collaborator Author

While testing the draft of new action on GitHub windows-latest runner, I ran into a following error:

C:\Users\runneradmin\.cargo\bin\cargo.exe semver-checks check-release
Error: failed to make directory 'C:\Users\runneradmin\.cargo\registry/index\github.com-1ecc6299db9ec823': The system cannot find the path specified.
; class=Os (2)

Caused by:
    failed to make directory 'C:\Users\runneradmin\.cargo\registry/index\github.com-1ecc6299db9ec823': The system cannot find the path specified.
    ; class=Os (2)
Error: The process 'C:\Users\runneradmin\.cargo\bin\cargo.exe' failed with exit code 1

@obi1kenobi do you think it is a problem with the setup done by the action? Or might it be an issue with the cargo-semver-checks itself? I don't have a working Windows installation, so I didn't check it locally yet.

@obi1kenobi
Copy link
Owner

Or might it be an issue with the cargo-semver-checks itself?

This looks like a bug in cargo-semver-checks itself: it looks like it isn't properly constructing subdirectory names and using the wrong directory separator (the Unix / instead of the Windows \). Nice catch! Would you care to reproduce the problem in the cargo-semver-checks repo itself, and then debug and resolve it?

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Excited to see this coming together nicely! 🎉

README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
src/main.ts Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
@mgr0dzicki
Copy link
Collaborator Author

I've found another (and the last) issue causing the tool to fail on Windows - the directory .cargo\registry\index does not exist at the beginning and therefore the creation of its subdirectory fails. The current workaround is 851a833.

@obi1kenobi, I've seen that you were successful in debugging the previous issue and fixing it in frewsxcv/rust-crates-index#94. Could you have a look at this problem too? I believe it shouldn't take you much time, as it is probably another simple fix in rust-crates-index code, which you've already worked with. Of course if you don't have enough time then I will take it ;) However I think I would first need to setup a virtual machine with Windows to debug it locally...

BTW, I'm back to work and hope to get v2 of the action finished soon!

@obi1kenobi
Copy link
Owner

I've found another (and the last) issue causing the tool to fail on Windows - the directory .cargo\registry\index does not exist at the beginning and therefore the creation of its subdirectory fails. The current workaround is 851a833.

This seems like it probably means cargo-semver-checks on Windows itself is broken too. Would you mind extracting a test case from this and adding it to the integration suite for cargo-semver-checks? I don't think you'd need a Windows VM for this.

Once we have that minimal test case, it will be easy to figure out whether it's something that cargo-semver-checks does incorrectly or whether we need an upstream fix in one of our dependencies, and if you'd prefer then I can take over from there.

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Definitely moving in the right direction! Just a few "setting ourselves up for future success" suggestions.

src/main.ts Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
@mgr0dzicki
Copy link
Collaborator Author

This seems like it probably means cargo-semver-checks on Windows itself is broken too. Would you mind extracting a test case from this and adding it to the integration suite for cargo-semver-checks? I don't think you'd need a Windows VM for this.

Sure, I'm currently working on that :).

.github/workflows/test-build.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@obi1kenobi
Copy link
Owner

Needs a bit of polish on the README, otherwise looks in pretty good shape!

What else does it need before it's ready to merge? I know we wanted to add baseline rustdoc caching, but we can do that in a separate PR and it'll be easier to review that way.

@mgr0dzicki
Copy link
Collaborator Author

Needs a bit of polish on the README, otherwise looks in pretty good shape!

What else does it need before it's ready to merge? I know we wanted to add baseline rustdoc caching, but we can do that in a separate PR and it'll be easier to review that way.

Thank you for all the comments and remarks, they are really valuable! I think the action is ready itself. I still want to add some workflow testing the action inputs (none of them is used at the moment). And then I think that polishing README and adding caching will be the only things remaining.

@obi1kenobi
Copy link
Owner

Sounds great! Thanks for all the awesome work you've been putting in!

@mgr0dzicki
Copy link
Collaborator Author

I polished the README, please take a look and let me know what do you think now :)

In the meanwhile, I'll start to work on rustdoc caching in a separate PR and notify you once it is ready for review.

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Minor polish items, I think this should be the last iteration before we merge this 🚀

.github/workflows/test-inputs.yml Outdated Show resolved Hide resolved
.github/workflows/test-action.yml Outdated Show resolved Hide resolved
.github/workflows/test-action.yml Show resolved Hide resolved
README.md Show resolved Hide resolved
mgr0dzicki and others added 2 commits February 27, 2023 19:21
Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

Just some lint-level nitpicks, otherwise looks ready to merge. I'm sure I only spotted them because I was looking at this in the PR diff view instead of an editor. consider doing a self-review of the PR to catch these yourself and reduce the number of back-and-forth iterations we need over tiny issues.

Once you've had a chance for that final tiny round of polish, just mark the PR as no longer a draft and I'd be happy to merge.

.github/workflows/setup-test-workspace/action.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/setup-test-workspace/action.yml Outdated Show resolved Hide resolved
@mgr0dzicki
Copy link
Collaborator Author

Just some lint-level nitpicks, otherwise looks ready to merge. I'm sure I only spotted them because I was looking at this in the PR diff view instead of an editor. consider doing a self-review of the PR to catch these yourself and reduce the number of back-and-forth iterations we need over tiny issues.

I have to admit, I was using the editor and not looked at the PR diff view, my mistake. Sorry for all these issues! I try to double-check everything, but this PR is quite huge and I'm looking at it for a week now, so finding such mistakes becomes increasingly difficult...

I'll correct what you found in a moment and then self-review everything as you suggested.

@obi1kenobi
Copy link
Owner

Sorry for all these issues! I try to double-check everything, but this PR is quite huge and I'm looking at it for a week now, so finding such mistakes becomes increasingly difficult...

No worries and no need to apologize. Every experience is something we can learn from, and the top objective is the learning itself much more so than the artifact being produced in the PR itself.

I also feel the same way about the PR being huge and difficult to (re-)review over and over. In retrospect, both of us could probably have predicted this as a risk and structured it differently so we don't have to merge it all-or-nothing like this. We'll do better next time!

@mgr0dzicki mgr0dzicki marked this pull request as ready for review February 27, 2023 21:14
@mgr0dzicki
Copy link
Collaborator Author

Hope this is finally it... ;)

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

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

It looks good enough to merge, let's do that and move forward. I'm highlighting two small additional issues that we should try to fix in a subsequent PR.

Comment on lines 4 to 5
description: 'Git reference (branch name, tag or commit hash) of the ref_slice test fork to checkout'
required: false
Copy link
Owner

Choose a reason for hiding this comment

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

Should this be required: true? Otherwise, what's the behavior if this input value isn't supplied?

Any time we make something optional, we're adding more modes of operation -- which means more things to test, and more things that can fail. Are we losing anything if we make this value required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My aim was to make the default behavior the same as for the checkout action, but you're right - since we don't use it, it's better to make the input required then wonder what the default behavior exactly is and try documenting it here.

@@ -7,11 +7,9 @@ inputs:
package:
description: 'The package whose API to check for semver (in Package Id Specification format, see https://doc.rust-lang.org/cargo/reference/pkgid-spec.html for reference). If not set, all packages in the workspace are processed.'
required: false
default: ''
manifest-path:
description: 'Path to Cargo.toml of crate or workspace to check.'
Copy link
Owner

Choose a reason for hiding this comment

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

The inputs here are generally great at documenting what the default behavior is when a required: false input isn't set. Let's document that behavior here as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've done this and the above one in #25

@obi1kenobi obi1kenobi merged commit 1fb47cb into obi1kenobi:main Feb 27, 2023
@mgr0dzicki mgr0dzicki mentioned this pull request Feb 28, 2023
@mgr0dzicki mgr0dzicki deleted the v2 branch March 22, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants