Skip to content

Conversation

JakubBiel
Copy link
Contributor

  1. Add support for tag type in environments' deployment branch policies - see https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy
  2. Update docs.
  3. Update unit tests for environments.

@JakubBiel
Copy link
Contributor Author

Hey @decyjphr. Can I ask for review please?

@decyjphr decyjphr requested a review from Copilot April 1, 2025 14:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the 'tag' type in deployment branch policies for environments, updates unit tests to cover the new functionality, and revises the documentation accordingly.

  • Adjust unit tests to validate both branch and tag policies.
  • Update the logic in the environments plugin to correctly transform custom branch policies.
  • Revise documentation to reflect the new policy types and updated schema.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/unit/lib/plugins/environments.test.js Updated tests for policy naming changes and added 'tag' policy support.
lib/plugins/environments.js Modified processing and sorting of custom branch policies to include policy type.
docs/github-settings/6. deployment-environments.md Updated examples and descriptions to reflect custom branch policies as arrays of policy objects.
Comments suppressed due to low confidence (1)

docs/github-settings/6. deployment-environments.md:137

  • The documentation states that custom_branch_policies is a 'boolean or object', but the examples and code indicate it should be an array of policy objects. Please update the documentation to accurately reflect that custom_branch_policies must be an array.
<p>&emsp;<code>custom_branch_policies</code><span style="color:gray;">&emsp;<i>boolean or object</i>&emsp;</span></p>

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

Copy link
Collaborator

@decyjphr decyjphr left a comment

Choose a reason for hiding this comment

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

This will cause any settings that use the old way of declaring custom branch policies to break, right. But I think this is necessary to add support for tag type.

So the question is can we still support array of strings and assume those would be converts to branch type policy.

@JakubBiel JakubBiel requested a review from decyjphr April 2, 2025 15:45
Copy link
Collaborator

@decyjphr decyjphr left a comment

Choose a reason for hiding this comment

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

Thanks!

@decyjphr decyjphr merged commit cabd7c2 into github:main-enterprise Apr 2, 2025
2 checks passed
@martinjackson-itv
Copy link

@decyjphr this looks great, I'm keen to use the functionality. Do you know when this will get released? Thank you.

@decyjphr
Copy link
Collaborator

decyjphr commented Apr 4, 2025

@martinjackson-itv I am still in the middle of testing all the PRs that have been merged and it's taking longer but I hope to release in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants