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

feat: add new build.local.bazel entry for local, build-level Bazel configuration #9230

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ar3s3ru
Copy link
Contributor

@ar3s3ru ar3s3ru commented Dec 21, 2023

Description
This PR adds a new configuration field in build.local specific to Bazel, to specify some build-level parameters for (or to pass to) Bazel.

Example usecase: passing --config=ci argument.

Before:

apiVersion: skaffold/v4beta6
kind: Config
build:
  artifacts:
    - image: hello
      bazel:
        target: //path/to:hello.tar
profiles:
  - name: ci
    patches:
      - op: add
        path: /build/artifacts/0/bazel/args
        value: [--config=ci]

After:

apiVersion: skaffold/v4beta6
kind: Config
build:
  artifacts:
    - image: hello
      bazel:
        target: //path/to:hello.tar
profiles:
  - name: ci
    build:
      local:
        bazel:
          args: [--config=ci]

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 295 lines in your changes are missing coverage. Please review.

Comparison is base (290280e) 70.48% compared to head (6cbd3a3) 63.65%.
Report is 1081 commits behind head on main.

Files Patch % Lines
cmd/skaffold/app/cmd/exec.go 16.32% 40 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/filter.go 47.27% 22 Missing and 7 partials ⚠️
cmd/skaffold/app/cmd/lsp.go 28.12% 23 Missing ⚠️
cmd/skaffold/app/cmd/verify.go 23.33% 23 Missing ⚠️
cmd/skaffold/app/cmd/fix.go 51.16% 17 Missing and 4 partials ⚠️
cmd/skaffold/app/cmd/inspect_job_manifest_paths.go 60.00% 15 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/inspect_namespaces.go 50.00% 13 Missing and 1 partial ⚠️
...md/skaffold/app/cmd/inspect_config_dependencies.go 45.83% 12 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/lint.go 42.85% 12 Missing ⚠️
cmd/skaffold/app/cmd/inspect_build_env.go 60.71% 11 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9230      +/-   ##
==========================================
- Coverage   70.48%   63.65%   -6.83%     
==========================================
  Files         515      632     +117     
  Lines       23150    32559    +9409     
==========================================
+ Hits        16317    20727    +4410     
- Misses       5776    10238    +4462     
- Partials     1057     1594     +537     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ar3s3ru ar3s3ru marked this pull request as ready for review December 21, 2023 10:11
@ar3s3ru
Copy link
Contributor Author

ar3s3ru commented Dec 21, 2023

CI error doesn't seem to be related to changes:

time="2023-12-21T10:10:15Z" level=debug msg="Skipped loading environment variables from file \"skaffold.env\": stat skaffold.env: no such file or directory" subtask=-1 task=DevLoop

@ar3s3ru
Copy link
Contributor Author

ar3s3ru commented Jan 4, 2024

Gentle ping @ericzzzzzzz @renzodavid9 could you take a look at your earliest convenience? 🙏🏻

@ericzzzzzzz
Copy link
Contributor

ericzzzzzzz commented Jan 9, 2024

hi @ar3s3ru sorry for the late review, but I think the existing behavior makes more sense , the bazel config should not be put under build environment stanza, it seems confusing to me why local build has this config, while other cluster, cloudbuild don't. This config is applying buildargs to bazel artifacts, it also seems to suggest that other builder should have corresponding config under local or cloudbuild stanza as well. Another thing is that, we also need to handle conflicts between this args configured through this stanza and those configured in bazel artifacts, should we do a merge or full replacement? Which should have higher priority? This will make things more complex, also ss you can basically achieve the same thing by a little bit repetitions, we probably don't need this change.

@ericzzzzzzz ericzzzzzzz self-assigned this Jan 9, 2024
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.

2 participants