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

Make @unpinned_maven//:pin always visible #492

Merged
merged 1 commit into from
Dec 5, 2020

Conversation

dmivankov
Copy link
Contributor

@dmivankov dmivankov commented Dec 3, 2020

Allows to run :pin via multirun target regardless of strict visibility setting

Use-case is still to run it a a part of manual command, like

# TODO: fix multirun handling of *_binary.args, it just exec-s files_to_execute at the moment
load("@com_github_atlassian_bazel_tools//multirun:def.bzl", "command", "multirun")
command(
    name = "pin-update",
    arguments = ["$(rootpath //:jq)"],
    command = "@unpinned_maven//:pin",
    data = ["//:jq"], # may also try using jq from rules_jvm_external
)
multirun(
    name = "maven-update",
    commands = [
        ":pin-update",
        ":some-other-update-task", # for example update checked-in generated pom.xml that can trigger dependabot PRs/alerts
        ":maybe a task that reports something",
    ]
)

Making pin public may also allow using it at build or test time, bur probably not that useful unless it starts accepting arguments like target maven_install.json location

Allows to run :pin via multirun target regardless of strict visibility setting
@shs96c
Copy link
Collaborator

shs96c commented Dec 4, 2020

Thank you for the PR!

I'm just trying to understand what the use-case for this is: I've always imagined that the pin target is run by a user on the command-line, but this suggests your doing something else. Could you please edit the commit message to explain why this would be useful to someone? I'd be very happy to merge this after that change is made!

@dmivankov
Copy link
Contributor Author

Added an example 👍

Copy link
Collaborator

@shs96c shs96c 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!

@shs96c
Copy link
Collaborator

shs96c commented Dec 5, 2020

Thank you for the update. That makes a lot of sense.

@shs96c shs96c merged commit 9d07997 into bazel-contrib:master Dec 5, 2020
@jin jin mentioned this pull request Jan 6, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants