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

Add forced focus option #262

Merged
merged 3 commits into from
Sep 29, 2024
Merged

Add forced focus option #262

merged 3 commits into from
Sep 29, 2024

Conversation

Kaspazza
Copy link
Contributor

@Kaspazza Kaspazza commented Sep 17, 2024

Hi, it's me again.

We've been using previously programmatic API, but due to compatibility issues with Babashka, we've moved to CLI.
Currently, there is no option in CLI to force a specific version of the dependency to update.

Our use case to be more specific, is that we want to update to the non-existing yet version as we are deploying multiple co-dependent apps together. Which was possible in API by just supplying deps and target version we want it to update.

The CLI focus option seems best for me for that feature, as we want to focus on that dependency and update it to a specific version.
In terms of syntax, exclude follows a similar syntax of being able to exclude dep completely or specific version, currently focus was not leveraging the version option, so I've added this behavior under that versioning syntax.
--focus=artifact[@VERSION]

The feature was implemented in a manner that should not affect any existing behaviors that user may call. This is completely separate new feature.

Previously calling focus with [@VERSION] will result in empty deps to update, as it was considering whole string as a dependency name. Now if @ appears, it considers it as forced-focus feature, otherwise as it was previously.

Example usage is described in .md and tests.
I use it like that:
Let's assume current version of artifact org.clojars.hephaistox/automaton-build in clojars is 3.1.0

I run
clojure -M:antq --upgrade --force --focus=org.clojars.hephaistox/[email protected]

And in my deps.edn, I expect all references to org.clojars.hephaistox/automaton-build to be updated to 3.2.0
So whatever is set after @ in focus options is treated as source of truth for new version setting.

@liquidz
Copy link
Owner

liquidz commented Sep 18, 2024

@Kaspazza Thanks for your contribution!

The CLI focus option seems best for me for that feature, as we want to focus on that dependency and update it to a specific version.

Make sence! I'll have a look :)

@liquidz liquidz self-assigned this Sep 18, 2024
src/antq/core.clj Outdated Show resolved Hide resolved
src/antq/core.clj Outdated Show resolved Hide resolved
src/antq/core.clj Outdated Show resolved Hide resolved
src/antq/core.clj Outdated Show resolved Hide resolved
src/antq/core.clj Outdated Show resolved Hide resolved
src/antq/core.clj Outdated Show resolved Hide resolved
@Kaspazza
Copy link
Contributor Author

Kaspazza commented Sep 22, 2024

Thanks for the review @liquidz, I've applied your suggestions.
WDYT?

@Kaspazza Kaspazza requested a review from liquidz September 23, 2024 13:12
@liquidz
Copy link
Owner

liquidz commented Sep 25, 2024

@Kaspazza Thanks! I'll have a look this weekend :)

Copy link
Owner

@liquidz liquidz left a comment

Choose a reason for hiding this comment

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

@Kaspazza Overall, looks good!
Could you fix few minor revisions at the end?

src/antq/core.clj Outdated Show resolved Hide resolved
src/antq/core.clj Outdated Show resolved Hide resolved
@Kaspazza
Copy link
Contributor Author

@liquidz Done

Copy link
Owner

@liquidz liquidz left a comment

Choose a reason for hiding this comment

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

@Kaspazza Thank you so much!

@liquidz liquidz merged commit c83562f into liquidz:main Sep 29, 2024
1 check passed
@liquidz
Copy link
Owner

liquidz commented Sep 29, 2024

@Kaspazza Just released v2.10.1241 :)

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