Skip to content

Commit

Permalink
Merge branch 'equinix:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdhulipala authored Nov 15, 2024
2 parents 8ce93eb + 305e2fc commit d2dc9df
Show file tree
Hide file tree
Showing 38 changed files with 3,717 additions and 230 deletions.
65 changes: 64 additions & 1 deletion .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
pull-requests: write

jobs:
main:
check-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -43,3 +43,66 @@ jobs:
with:
header: pr-title-lint-error
delete: true

enforce-packages:
name: Prevent new files in `equinix` package
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
id: check_added_files
with:
result-encoding: string
retries: 3
script: |
const files = await github.paginate(github.rest.pulls.listFiles,{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
const blockedFiles = []
for (const file of files) {
if (file.status === "added" && file.filename.match(/equinix\/[^\/]*\.go/)) {
blockedFiles.push("- " + file.filename)
}
}
var errorMessage = ""
if (blockedFiles.length > 0) {
errorMessage = `The following files were added to the \`equinix\` package and must be moved somewhere else:
${blockedFiles.join("\n")}
`
core.setFailed(errorMessage)
}
return errorMessage
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.check_added_files.outputs.result != '')
with:
header: files-added-to-equinix-error
message: |
We are actively working to reduce the amount of code in the `equinix`
package to avoid unintentional code sharing.
New files should be added in an isolated package instead of adding
more code to the `equinix` package. You may need to refactor and/or
temporarily duplicate existing code in order to move your new code
to an isolated package.
Details:
```
${{ steps.check_added_files.outputs.result }}
```
# Delete a previous comment when the issue has been resolved
- if: steps.check_added_files.outputs.result == ''
uses: marocchino/sticky-pull-request-comment@v2
with:
header: files-added-to-equinix-error
delete: true
8 changes: 4 additions & 4 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @equinix/governor-devrel-engineering
/cmd/migration-tool @equinix/governor-metal-client-interfaces
*metal* @equinix/governor-metal-client-interfaces
docs/guides/network_types.md @equinix/governor-metal-client-interfaces
*fabric* @equinix/governor-digin-fabric
*connection_e2e* @equinix/governor-digin-fabric
*resource_network_* @equinix/governor-ne-network-edge-engineering
*data_source_network_* @equinix/governor-ne-network-edge-engineering
**/edge-networking @equinix/governor-ne-network-edge-engineering
docs/**/network_* @equinix/governor-ne-network-edge-engineering
templates/**/network_* @equinix/governor-ne-network-edge-engineering
edge-networking @equinix/governor-ne-network-edge-engineering
network_* @equinix/governor-ne-network-edge-engineering
docs/guides/network_types.md @equinix/governor-metal-client-interfaces
equinix_network_* @equinix/governor-ne-network-edge-engineering
Loading

0 comments on commit d2dc9df

Please sign in to comment.