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

Remove the "2 Reviews Needed" column automation from the PR board #4657

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

zackkrida
Copy link
Member

Description

This PR removes JavaScript logic from the automations/js/src/project_automation/prs.mjs file which moves cards into the "Needs 2 Reviews" column of our PR project board.

-  } else {
-   await prBoard.moveCard(prCard.id, prBoard.columns.Needs2Reviews)
-  }

This PR also updates the entire file to conform to our prettier config.

Testing Instructions

Review the logic and hope it works!

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@zackkrida zackkrida requested a review from a team as a code owner July 25, 2024 15:29
@openverse-bot openverse-bot added 🧱 stack: mgmt Related to repo management and automations 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Jul 25, 2024
automations/js/src/project_automation/prs.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/prs.mjs Outdated Show resolved Hide resolved
Co-authored-by: Dhruv Bhanushali <[email protected]>
@zackkrida
Copy link
Member Author

@dhruvkb is the reasoning for your suggestions that having 1 approving review is the same as being "APPROVED", now? I just want to make sure I understand how this is working; thanks!

@zackkrida zackkrida requested a review from dhruvkb July 25, 2024 15:38
@zackkrida zackkrida added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 🤖 aspect: dx Concerns developers' experience with the codebase and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Jul 25, 2024
@dhruvkb
Copy link
Member

dhruvkb commented Jul 25, 2024

Yeah, that's exactly it @zackkrida. PRs with one approval will already have reviewDecision === "APPROVED" and we need to send PRs to "Needs 1 Review" by default if they don't fulfill any of the other conditions.

Copy link
Collaborator

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

The logic looks correct now.
We could rename the column to "Needs review" instead of "Needs 1 review" for brevity.

How did the file pass the linting step in CI before? Are these files not linted?

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

The logic looks correct now.
We could rename the column to "Needs review" instead of "Needs 1 review" for brevity.

How did the file pass the linting step in CI before? Are these files not linted?
The PR is failing the linting check. Do we use a different set of rules for these files?

Adding mjs here should fix the CI error:

files: (frontend|automations|packages/js).*?\.(js|ts|vue|json5|json)$

@dhruvkb
Copy link
Member

dhruvkb commented Jul 25, 2024

@obulat automations have their separate Prettier config file for some reason.

@obulat
Copy link
Contributor

obulat commented Jul 25, 2024

@obulat automations have their separate Prettier config file for some reason.

Great find! I guess we need to update the pre-commit to include mjs, and remove this prettier config.

@zackkrida
Copy link
Member Author

Thanks for the suggestions! I've now:

  • Removed the dedicated prettier config for automations
  • Added mjs files to the precommit eslint hook
  • Fixed all of the mjs automations

As for the actual code itself:

  • Renamed the column on the board to "Needs Review"
  • Removed the "Needs 2 Reviews" column
  • Updated the code to reference the "Needs Review" column

I'll merge once CI passes.

@zackkrida zackkrida merged commit c68dcd6 into main Jul 25, 2024
41 checks passed
@zackkrida zackkrida deleted the remove-pr-board-2-review-column-logic branch July 25, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: mgmt Related to repo management and automations
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants