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

[CLI] Check with multiple arguments #91

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

jaudiger
Copy link
Contributor

Part of #75

I added the ability to set more than one registry and project when calling brioche check command. This is separated in two commits. The first updates the check command, while the second commit refactor the code of the format command to mimic what was done with the check.

This has been done to extend more easily the next commands, cited in #75.

@jaudiger
Copy link
Contributor Author

Conflict with #90. Depending on the one merged first, I'll update the code of the second PR.

Copy link
Member

@kylewlacy kylewlacy left a comment

Choose a reason for hiding this comment

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

LGTM, just had two minor suggestions for some things to reword slightly

crates/brioche/src/check.rs Outdated Show resolved Hide resolved
crates/brioche/src/check.rs Outdated Show resolved Hide resolved
Copy link
Member

@kylewlacy kylewlacy left a comment

Choose a reason for hiding this comment

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

LGTM (I just noticed one unnecessary import but will merge after it gets removed, plus the remaining conflicts)

use std::process::ExitCode;
use std::vec;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use std::vec;

@jaudiger
Copy link
Contributor Author

@kylewlacy do you prefer a rebase or a merge to resolve the merge conflicts ?

@kylewlacy
Copy link
Member

@kylewlacy do you prefer a rebase or a merge to resolve the merge conflicts ?

Generally, I prefer merges specifically because GitHub's PR reviews work better with it (I can click "show changes since last review" and get a nice diff, but that tends to break when force pushing / rebasing). I always use "Squash and merge" when merging PRs anyway, so the final result in the main branch ends up basically the same either way

@jaudiger
Copy link
Contributor Author

@kylewlacy do you prefer a rebase or a merge to resolve the merge conflicts ?

Generally, I prefer merges specifically because GitHub's PR reviews work better with it (I can click "show changes since last review" and get a nice diff, but that tends to break when force pushing / rebasing). I always use "Squash and merge" when merging PRs anyway, so the final result in the main branch ends up basically the same either way

Sorry..... I didn't see when I was preparing the change locally... I'm used to rebase, since I like having work commit. But I'll now switch to the merge strategy for my other PRs! Basically, what I did was just to integrate the reporter stuff inside the three commits. If for the sake of review it doesn't suit you, please let me know.

At least, for this time, the compare option seems to kind of work: https://github.com/brioche-dev/brioche/compare/e12668f5dc67886b70e1120773ea087deb9de9af..9a7244a230fcf59bb6402b04bc26778f5e7218cc (except I didn't touch the publish file)

) -> Result<bool, anyhow::Error> {
let num_lockfiles_updated = projects.commit_dirty_lockfiles().await?;
if num_lockfiles_updated > 0 {
tracing::info!(num_lockfiles_updated, "updated lockfiles");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One thing, I didn't touch this line, but should I?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine as-is, is there a reason it should be changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I don't think so. I just wanted to raise the attention to this single call to tracing::info.

@kylewlacy
Copy link
Member

Sorry..... I didn't see when I was preparing the change locally... I'm used to rebase, since I like having work commit. But I'll now switch to the merge strategy for my other PRs! Basically, what I did was just to integrate the reporter stuff inside the three commits. If for the sake of review it doesn't suit you, please let me know.

Not a problem 😄 It's basically just a personal preference, but more important is making sure it's a project where you and other contributors can use a workflow you're comfortable with first and foremost (which is also why I always go with "Squash and merge" when merging PRs into main, it seems like the middle ground between folks that like "merge" vs. "rebase", keeping the history clean while still including the commit messages and a link to the PR)

@kylewlacy kylewlacy merged commit 45411ff into brioche-dev:main Jul 17, 2024
5 checks passed
@jaudiger jaudiger deleted the check-multiple-arguments branch July 17, 2024 07:37
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