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: add design complete automation #7184

Merged
merged 4 commits into from
Jun 16, 2023

Conversation

geospatialem
Copy link
Member

@geospatialem geospatialem commented Jun 15, 2023

Related Issue: n/a

Summary

Adds automation for our design complete process, where when the design-complete label is added the following occurs:

  • Remove the design and 1 - assigned labels
    • Achieved through two separate removeLabel API calls, as there is not an API call to remove more than one without removing all labels.
  • Add the 0 - new and needs milestone labels
  • Clear the assignee(s) and milestone
  • CC @brittneytewks and I in the issue's body
    • Achieved via the CALCITE_MANAGERS secret (current value: geospatialem, brittneytewks)

Leverages the ADMIN_TOKEN secret 🔒 for admin access to update the labels with the proper permissions. Updated to our default PAT using write permissions

@geospatialem geospatialem added the skip visual snapshots Pull requests that do not need visual regression testing. label Jun 15, 2023
@geospatialem geospatialem requested a review from benelan June 15, 2023 22:41
@geospatialem geospatialem requested a review from a team as a code owner June 15, 2023 22:41
@github-actions github-actions bot added the chore Issues with changes that don't modify src or test files. label Jun 15, 2023
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

⚡🤖⚡

/* Modify labels */

// Remove "Design" label
await github.rest.issues.removeLabel({
Copy link
Member

Choose a reason for hiding this comment

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

The API calls are pretty expressive, so one suggestion to remove some comments with duplicate info is to use an object for common props and spread into each call:

const commonProps = { 
  issue_number: context.issue.number,
  owner: context.repo.owner,
  repo: context.repo.repo
};

await github.rest.issues.removeLabel({
  name: "design",
  ...commonProps
});

await github.rest.issues.removeLabel({
  name: "1 - assigned",
  ...commonProps
});

@geospatialem geospatialem merged commit 91cd4e3 into master Jun 16, 2023
@geospatialem geospatialem deleted the geospatialem/ci-design-complete-automation branch June 16, 2023 15:02
@github-actions github-actions bot added this to the 2023 June patch priorities milestone Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issues with changes that don't modify src or test files. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants