Coder Social home page Coder Social logo

bazel-rules's People

Contributors

ar3s3ru avatar carlosgamezf avatar charlesoconor avatar chester-p avatar chickenandpork avatar danigar avatar fralvarop avatar gutmox avatar lucqui avatar marksmithson avatar nickdecooman avatar pmoncadaisla avatar tomich87 avatar vmax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bazel-rules's Issues

Why does helm_release require a chart package?

If I use helm_push to push a package to a chart repo (e.g. chart museum), should I not be able to specify a chart name for a release? Otherwise, each release has to come from the full package. Seems the chart argument should more closely match helm's own spec, which says:

The chart argument can be either: a chart reference('example/mariadb'), a path to a chart directory, a packaged chart, or a fully qualified URL.

Though I assume this would also mean requiring the other arguments from helm_push for specifying the repo.

helm_push: support Sonatype Nexus repositories

Hi!

Thank you for wrapping Helm in Bazel rules! There's one caveat that we've discovered: without altering the rule, it is impossible to upload built artifacts into the Helm repositories hosted by Sonatype Nexus. Most probably, that's happening due to Nexus having a separate upload method from one that usual Helm repos support. Nexus documentation claims here that one must use --upload-file to achieve said task:

curl -u <username>:<password> http://<host>:<port>/repository/<repository_name>/ --upload-file mysql-1.4.0.tgz -v

Configure Chart.yaml values via bazel attrs

For example, in:

apiVersion: v1
description: Mas Subscriptions
name: mas-subscriptions
icon: https://cdnres.masmovil.es/assets/images/metas/logo_masmovil.png
version: 0.1.0

be able to configure some of them via bazel directly:

helm_chart(
    name = "chart",
    srcs = glob(["charts/"+get_name()+"/**"]),
    image_tag = get_version(),
    helm_chart_version = get_version(),
    package_name = get_name(),
)

so we don't get:

Error: directory name (mas-subscriptions) and Chart.yaml name (deployment-manager-bigquery) must match

Workspace example doesn't work

https://github.com/masmovil/bazel-rules#getting-started

 bazel build //...
INFO: Invocation ID: 097bf422-1e4e-4758-945c-c30c6f28495b
ERROR: error loading package '': Every .bzl file must have a corresponding package, but '@com_github_masmovil_bazel_rules//repositories:repositories.bzl' does not have one. Please create a BUILD file in the same or any parent directory. Note that this BUILD file does not need to do anything except exist.
INFO: Elapsed time: 0.521s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
gsagula@mlll9944:~/src/magicleap/service-template-go$ bazel build //...
INFO: Invocation ID: 0690c958-1b35-4c44-a92f-737871a9023f
INFO: Repository com_github_masmovil_bazel_rules instantiated at:
  /home/gsagula/src/magicleap/service-template-go/WORKSPACE:102:15: in <toplevel>
Repository rule git_repository defined at:
  /home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'com_github_masmovil_bazel_rules':
   Traceback (most recent call last):
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git.bzl", line 181, column 30, in _git_repository_implementation
                update = _clone_or_update(ctx)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_update
                git_ = git_repo(ctx, directory)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo
                _update(ctx, git_repo)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 104, column 10, in _update
                reset(ctx, git_repo)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 148, column 9, in reset
                _git(ctx, git_repo, "reset", "--hard", git_repo.reset_ref)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 169, column 15, in _git
                _error(ctx.name, start + list(args), st.stderr)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 190, column 9, in _error
                fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr))
Error in fail: error running 'git reset --hard commit-ref' while working with @com_github_masmovil_bazel_rules:
fatal: ambiguous argument 'commit-ref': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ERROR: /home/gsagula/src/magicleap/service-template-go/WORKSPACE:102:15: fetching git_repository rule //external:com_github_masmovil_bazel_rules: Traceback (most recent call last):
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git.bzl", line 181, column 30, in _git_repository_implementation
                update = _clone_or_update(ctx)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_update
                git_ = git_repo(ctx, directory)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo
                _update(ctx, git_repo)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 104, column 10, in _update
                reset(ctx, git_repo)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 148, column 9, in reset
                _git(ctx, git_repo, "reset", "--hard", git_repo.reset_ref)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 169, column 15, in _git
                _error(ctx.name, start + list(args), st.stderr)
        File "/home/gsagula/.cache/bazel/_bazel_gsagula/2f04c0081ad09c5c6296366d26717d29/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 190, column 9, in _error
                fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr))
Error in fail: error running 'git reset --hard commit-ref' while working with @com_github_masmovil_bazel_rules:
fatal: ambiguous argument 'commit-ref': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ERROR: no such package '@com_github_masmovil_bazel_rules//repositories': error running 'git reset --hard commit-ref' while working with @com_github_masmovil_bazel_rules:
fatal: ambiguous argument 'commit-ref': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

GitHub workflows break on missing io/fs

Failure in GitHub integration tests:

go: finding sigs.k8s.io/yaml v1.3.0
[50](https://github.com/chickenandpork/rules_helm/actions/runs/3473491467/jobs/5805560435#step:4:51)
go: finding gopkg.in/yaml.v2 v2.4.0
[51](https://github.com/chickenandpork/rules_helm/actions/runs/3473491467/jobs/5805560435#step:4:52)
go: finding github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2
[52](https://github.com/chickenandpork/rules_helm/actions/runs/3473491467/jobs/5805560435#step:4:53)
build sigs.k8s.io/kind: cannot load io/fs: malformed module path "io/fs": missing dot in first path element
[53](https://github.com/chickenandpork/rules_helm/actions/runs/3473491467/jobs/5805560435#step:4:54)
Error: Process completed with exit code 1.

io/fs is not provided by the PRs being reviewed; instead, the following two lines conflict:
https://github.com/masmovil/bazel-rules/blob/7bd160b5fe0354052e98b1dfb0cc6c4300b58026/.github/workflows/integration-tests.yaml#L17,L18

        go-version: 1.13
    - name: Install latest version of Kind
  • "latest version of kind" uses a recent version of go >= 1.16 by referencing io/fs introduced in go-1.16
  • pinned go == 1.13 doesn't provide it.

Helm chart output archive is not reproducible

The current setup invokes the tar command instead of leveraging on the existing pkg_tar rules. This results in the output archive (.tgz) changing after each new instance invocation, triggering cache invalidation and rebuilds of targets.

We need a delete build target.

Thank you for this work. It lets me spin up a helm chart. But I'm missing a way to delete the chart that I no longer want. I can use the helm binary, but I'd rather have a bazel-native way of wrapping around the helm delete subcommand.

Generate documentation using Stardoc

I've noticed that the rules documentation, currently in the README, are out-of-date from the actual rules implementations. Example: #32 introduced new fields in helm_release, which are not reflected in the README.

An idea to remove this inconsistency could be to use Stardoc to automatically generate documentation.

rules_docker for example uses it for the container_* targets. More info here: bazelbuild/rules_docker#1890

Repo Maintenance Inquiry

Hello,

First, I'd like to thank you for creating and maintaining helm rules for bazel. I've been using it to manage helm charts in my repo and even extended it in my own repo to perform helm linting.

I've noticed that there hasn't been much recent activity, and there are some open issues and potential enhancements that could benefit the community. Moreover, with the introduction of bzlmod this repo will eventually need to be updated to support it. Can you provide any insights into the current state of this repository? Is there a plan to upgrade to support bzlmod?

Cheers.

Filtering of chart files based on Chart.yaml path blocks generated Chart.yaml

I ran into a desire to generate the Chart.yaml file based on other data -- kind of a desire to Don't-Repeat-Yourself in config. This might relate to #2 slightly (@pmoncadaisla)

Problem is, there is a filtering that seem to occur:

     for i, srcfile in enumerate(ctx.files.srcs):
         if srcfile.path.startswith(chart_root_path):
             out = ctx.actions.declare_file(tmp_working_dir + "/" + srcfile.path)

If I generate the Chart.yaml (say, even a genrule()), that ends up as a generated file in the working directory; the other template files -- which are hand-maintained source files in the repo -- are all in another directory. They don't startswith(chart_root_path), if that makes sense.

I'd like to create a method of opting out of that check, with the caveat that I don't know the basis for the check in the first place. A default-false, opt-out-to-skip boolean wold suffice for me.

Prepare for new release based in Go

We have a new release of rules coming, which are backward compatible but they have been rewritten from zero.

Now they are written in Go rather than bash. They solve some race conditions issues and they are friendlier with remote build execution systems.

Missing go.sum entry for github.com/gruntwork-io/terratest

During GitHub workflows, the following was revealed by the fox for #47:

gpg: Total number processed: 5
18 gpg:               imported: 3
19 gpg:              unchanged: 2
20 gpg:       secret keys read: 2
21 gpg:   secret keys imported: 2
22 go: downloading github.com/stretchr/testify v1.4.0
23 go: downloading github.com/pmezard/go-difflib v1.0.0
24 go: downloading github.com/davecgh/go-spew v1.1.1
25 # command-line-arguments
26 Error: tests/rules/package_spec_test.go:6:2: missing go.sum entry for module providing package github.com/gruntwork-io/terratest/modules/helm; to add:
27 	go mod download github.com/gruntwork-io/terratest
28 FAIL	command-line-arguments [setup failed]

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.