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

Return providers instead of struct from rule impl functions #755

Merged
merged 2 commits into from
Mar 29, 2019

Conversation

alex1545
Copy link
Contributor

This addresses the incompatible change via the ----incompatible_disallow_struct_provider_syntax flag described here.

@alex1545
Copy link
Contributor Author

This is blocked by file_test returning a struct and scala_import returning a struct.

@alex1545 alex1545 changed the title DO NOT REVIEW Return providers instead of struct from rule impl functions Return providers instead of struct from rule impl functions Mar 26, 2019
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@alex1545 alex1545 force-pushed the fix-incompatible-flag branch from 70e92c2 to b222896 Compare March 28, 2019 19:21
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@alex1545
Copy link
Contributor Author

As discussed offline with @nlopezgi, we will merge this now, but not test with the --incompatible_disallow_struct_provider_syntax flag because of external dependencies that still haven't addressed this issue.

Copy link
Contributor

@nlopezgi nlopezgi left a comment

Choose a reason for hiding this comment

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

lgtm/ Please leave upgrade instructions (and pointer to bazelbuild/bazel-toolchains#383 as example) in commit message so users upgrading can get guidance.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alex1545, nlopezgi
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:

If they are not already assigned, you can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Mar 29, 2019
@alex1545
Copy link
Contributor Author

IMPORTANT
This PR changes the return value type from some rule implementation functions from struct to a list of providers.

No action is required if you are already using the providers returned by the below mentioned rules as described here (e.g. target[ProviderName].fieldName).

Your action may be required if you are using either the implementation function or any targets of the following rules (in your own rule implementation functions or macros):

  • container_bundle (in container/bundle.bzl)
  • container_image (in container/imagebzl)
  • container_import (in container/import.bzl)
  • filter_layer (in lang/image.bzl)

Actions Required by Rule

  • container_bundle
    If you use the container_images and/or the stamp field of the returned struct, then get these fields from the returned BundleInfo provider as shown here.
  • container_image
    If you use the container_parts field of the returned struct, then get this field from the returned ImageInfo provider as shown here
  • container_import
    If you use the container_parts field of the returned struct, then get this field from the returned ImportInfo provider (e.g. target[ImportInfo].container_parts instead of target.container_parts)
  • filter_layer
    If you use the py field of the returned struct as target.py, then get this field using the returned PyInfo provider as target[PyInfo].

Note
If you access the returned providers with the following syntax:
target.providers[<index>].<field>
then you most likely need to change this to:
target[<index>].<field>

@alex1545 alex1545 merged commit 0475563 into bazelbuild:master Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants