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

ci-connector-ops: declare review requirements on source connectors changes #20303

Merged
merged 44 commits into from Dec 13, 2022

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Dec 9, 2022

What

Closes #20304

This GitHub action can help us check if a set of teams gave a review on a PR by creating a "review requirements" file.
I made a new command in ci-connector-ops to write this file according to the current changes in the branch.

I changed the connector_ops_ci.yml workflow to:

  • Call the new write-review-requirements-file command to write the requirements file. This file structure is defined by the Automattic/action-required-review@v3 action
  • Run the Automattic/action-required-review@v3 if this file was written.

When the requirements are not met, a status check as this one will appear:
Screen Shot 2022-12-12 at 13 48 59

The new following review requirements rules:

  • If a PR touches a GA connector: a review from gl-python team is required
  • If a PR changes the test strictness level in acceptance-test-config.yml: a review from connector-operations teams is required
  • If a PR changes backward compatibility test in acceptance-test-config.yml: a review from connector-operations or connector-extensibility is required.

Suggested review order:

ci_connector_ops python package

connector_ops_ci.yml GitHub action workflow

@alafanechere alafanechere marked this pull request as ready for review December 9, 2022 16:02
@alafanechere alafanechere requested a review from a team December 9, 2022 16:02
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 16:03 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 16:03 — with GitHub Actions Inactive
@alafanechere alafanechere changed the title ci-connector-ops: check if backward compatibility tests are disabled ci-connector-ops: check if a review is required from the connector team Dec 9, 2022
@alafanechere alafanechere changed the title ci-connector-ops: check if a review is required from the connector team ci-connector-ops: check if backward compatibility tests are disabled Dec 9, 2022
@alafanechere alafanechere marked this pull request as draft December 9, 2022 16:38
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 16:51 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 16:51 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 16:58 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 16:59 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 17:10 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 17:10 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 17:18 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 17:18 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 17:25 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 9, 2022 17:25 — with GitHub Actions Inactive
Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

This looks like it will be super helpful! Might be worth sharing this action and how you implemented it (Loom?) to other teams who may be unsatisfied with how static codeowners is

Comment on lines +80 to +84
requirements_file_content = [{
"name": "Required reviewers from the connector org teams",
"paths": "unmatched",
"teams": mandatory_reviewers
}]
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool idea to generate this on each run!

Comment on lines +95 to +98
if isinstance(mandatory_reviewer, dict):
teams += mandatory_reviewer["any-of"]
else:
teams.append(mandatory_reviewer)
Copy link
Contributor

Choose a reason for hiding this comment

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

Doing the any-of check here feels a little un-DRY, since you also manually add any-of in find_mandatory_reviewers -- maybe you could put this logic of adding the any-of into a helper method you call in find_mandatory_reviewers?

if: steps.write-review-requirements-file.outputs.REVIEW_REQUIREMENTS_FILE != ''
uses: Automattic/action-required-review@v3
with:
status: ${{ steps.get-mandatory-reviewers.outputs.MANDATORY_REVIEWERS }}
Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, generating and outputting this separately is a requirement of the github action, right? We can't generate that into connector_org_review_requirements.yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, I added the MANDATORY_REVIEWERS to conveniently display a detailed status like A review is required from teams: A, B, C instead of the default Review required status. But all the essential information is captured in the REVIEW_REQUIREMENTS_FILE whose format is defined by the external action.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, I figured. Strange that you can't configure different status messages for the different sets of requirements in the action 😄

Co-authored-by: Ella Rohm-Ensing <erohmensing@gmail.com>
@alafanechere alafanechere temporarily deployed to more-secrets December 12, 2022 14:55 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 12, 2022 14:55 — with GitHub Actions Inactive
@YowanR
Copy link
Contributor

YowanR commented Dec 12, 2022

This makes sense at a high-level to me. Adding @lazebnyi as a reviewer to make sure that GL is plugged into this conversation.

@alafanechere alafanechere temporarily deployed to more-secrets December 12, 2022 20:53 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 12, 2022 20:53 — with GitHub Actions Inactive
Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

I left a comment and that triggered a failing check!

https://github.com/airbytehq/airbyte/actions/runs/3680412195

[Invalid workflow file: .github/workflows/connector_ops_ci.yml#L49](https://github.com/airbytehq/airbyte/actions/runs/3680412195/workflow)
The workflow is not valid. .github/workflows/connector_ops_ci.yml (Line: 49, Col: 13): Unexpected symbol: '""'. Located at position 74 within expression: steps.write-review-requirements-file.outputs.REVIEW_REQUIREMENTS_FILE != ""

@alafanechere
Copy link
Contributor Author

@evantahler, there was a glitch in the boolean check to conditionally run the final action. I fixed it in e7202ff

@alafanechere alafanechere temporarily deployed to more-secrets December 13, 2022 09:36 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 13, 2022 09:36 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 13, 2022 09:46 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 13, 2022 09:47 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 13, 2022 11:13 — with GitHub Actions Inactive
@alafanechere alafanechere temporarily deployed to more-secrets December 13, 2022 11:14 — with GitHub Actions Inactive
Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

👍 assuming I don't get another failing comment :D

@alafanechere alafanechere merged commit c2895c1 into master Dec 13, 2022
@alafanechere alafanechere deleted the augustin/ci-connector-ops/require-team-review branch December 13, 2022 22:55
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.

ci-connector-ops: require reviews from connector team
6 participants