Giter Club home page Giter Club logo

Comments (5)

ash2k avatar ash2k commented on July 1, 2024

I don't see how being able to pass commands via command line changes anything? It will still not be possible to specify labels like //.../vendor/...:%go_test.

from bazel-tools.

ash2k avatar ash2k commented on July 1, 2024

Why cannot you put all your delete //services/myservice/vendor/...:%go_test commands into a file?

from bazel-tools.

negz avatar negz commented on July 1, 2024

@ash2k Doing so would require us to continually keep our commands file updated with all the paths we wanted buildozer to manage. That's a lot of paths owned by a lot of teams so I think that pattern would break down pretty fast.

You're correct that the wildcard //.../vendor/...:%go_test still won't work when passed as an argument to buildozer directly, but supporting arguments in addition to the commands file would allow us to keep our current pattern, but using bazel run rather than an external buildozer binary.

i.e. Today our documentation instructs engineers to run the following to update their BUILD files for whatever path of the monorepo they're working on:

$ bazel run //:gazelle -- fix services/myservice
$ buildozer delete //services/myservice/vendor/...:%go_test

I'd like to be able to simply change that documentation to be:

$ bazel run //:gazelle -- fix services/myservice
$ bazel run //:buildozer -- delete //services/myservice/vendor/...:%go_test

I feel that this is a more sustainable/maintainable pattern than having a large group of people maintain a buildozer commands file and run buildozer against the entire monorepo regularly.

from bazel-tools.

ash2k avatar ash2k commented on July 1, 2024

Ok, I understand your use case now, thank you. Feel free to submit a PR (don't forget to sign the CLA).
However, if I were you, I'd instead do these two things:

  • Open an issue (or a PR) with buildozer to add support for label wildcards like what you need //.../vendor/...:%go_test
  • Instead of recommending engineers to run buildozer delete //services/myservice/vendor/...:%go_test add a bazel target that generates the commands file with directories that you want fixed. Use something like find . -type d -name vendor in the script. And then have the buildozer rule depend on that generated commands file. That way your engineers would not need to maintain that pattern per service and only run bazel run //:buildozer to fix all vendor folders. This may require some experimentation with glob() to declare dependencies of that generator rule... I'm not 100% it will work nicely, but worth a try.

from bazel-tools.

ash2k avatar ash2k commented on July 1, 2024

I think this was implemented in #107.

from bazel-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.