Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Mar 11, 2021

Using this has two draw-backs for us.

  1. MEMBER applies to anyone in the org, not just members/commiters to this repo
  2. The value of this setting depends upon the user's "visiblity" in the org. I.e. if they hide their membership of the org, the author_association will show up as "CONTRIBUTOR" instead.

Both of these combined mean we should instead use an alternative list. Airflow committers is a scret that contains a list of GH user ids, such as ["ashb", "..."] etc.

Using this has two draw-backs for us.

1. MEMBER applies to _anyone in the org_, not just members/commiters to
   this repo
2. The value of this setting depends upon the user's "visiblity" in the
   org. I.e. if they hide their membership of the org, the
   author_association will show up as "CONTRIBUTOR" instead.

Both of these combined mean we should instead use an alternative list.
Airflow committers is a scret that contains a list of GH user ids, such
as `["ashb", "..."]` etc.
@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

Hmmm.

The workflow is not valid. .github/workflows/ci.yml (Line: 76, Col: 14): Unrecognized named-value: 'secrets'. Located at position 94 within expression: ( ( github.event_name == 'push' || github.event_name == 'schedule' || contains(secrets.AIRFLOW_COMMITERS, github.actor) ) && github.repository == 'apache/airflow' ) && 'self-hosted' || 'ubuntu-20.04'

@ashb ashb marked this pull request as draft March 11, 2021 11:25
@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

Damn, It seems you can't reference secrets nor env in the runs-on step :/ Hmmm what to do.

@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

Trying to include a hard-coded list in the ci.yaml (it's verifired/checked again on the runner so is "safe") fails too:

Unexpected symbol: '['.

Damn, not sure this is actually possible :/

@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

contains(fromJSON('["ashb"]'), github.actor) works, but is... ugly.

@github-actions
Copy link

The Workflow run is cancelling this PR. Building image for the PR has been cancelled

@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

Down to at least one hard-coded list now.

@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

There, working, and not too horrible/duplictative. I would have liked to be able to use secrets, but sadly not possible.

@ashb ashb marked this pull request as ready for review March 11, 2021 12:30
@ashb
Copy link
Member Author

ashb commented Mar 11, 2021

Jobs after the first are running on self-hosted runners, don't need to wait on tests.

@ashb ashb merged commit 4213487 into apache:master Mar 11, 2021
@ashb ashb deleted the dont-user-author-assocation-selfhosted branch March 11, 2021 12:33

env:

AIRFLOW_COMMITERS: ${{ secrets.AIRFLOW_COMMITERS }}
Copy link
Member

@potiuk potiuk Mar 11, 2021

Choose a reason for hiding this comment

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

I guess we can remove this one? That turned out to be not working for forked PRs I believe?

potiuk added a commit to potiuk/airflow that referenced this pull request Mar 12, 2021
The change apache#14718 by mistake left the 'self-hosted" runs-on in case of
push or schedule. This caused failures on non-apache repositories.
potiuk added a commit that referenced this pull request Mar 12, 2021
The change #14718 by mistake left the 'self-hosted" runs-on in case of
push or schedule. This caused failures on non-apache repositories.
potiuk pushed a commit that referenced this pull request Mar 23, 2021
…n. (#14718)

Using this has two draw-backs for us.

1. MEMBER applies to _anyone in the org_, not just members/commiters to
   this repo
2. The value of this setting depends upon the user's "visiblity" in the
   org. I.e. if they hide their membership of the org, the
   author_association will show up as "CONTRIBUTOR" instead.

Both of these combined mean we should instead use an alternative list.

We can't use a secret as the `secrets.` context is not available in the runs-on
stanza, so we have to have a hard-coded list in the workflow file :( This is as
secure as the runner still checks the author against it's own list.

(cherry picked from commit 4213487)
potiuk added a commit that referenced this pull request Mar 23, 2021
The change #14718 by mistake left the 'self-hosted" runs-on in case of
push or schedule. This caused failures on non-apache repositories.

(cherry picked from commit 945a5b9)
ashb added a commit that referenced this pull request Apr 15, 2021
…n. (#14718)

Using this has two draw-backs for us.

1. MEMBER applies to _anyone in the org_, not just members/commiters to
   this repo
2. The value of this setting depends upon the user's "visiblity" in the
   org. I.e. if they hide their membership of the org, the
   author_association will show up as "CONTRIBUTOR" instead.

Both of these combined mean we should instead use an alternative list.

We can't use a secret as the `secrets.` context is not available in the runs-on
stanza, so we have to have a hard-coded list in the workflow file :( This is as
secure as the runner still checks the author against it's own list.

(cherry picked from commit 4213487)
ashb pushed a commit that referenced this pull request Apr 15, 2021
The change #14718 by mistake left the 'self-hosted" runs-on in case of
push or schedule. This caused failures on non-apache repositories.

(cherry picked from commit 945a5b9)
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.

3 participants