Create PR to add Bootstrap Identity to eng-azure-authorization#1256
Create PR to add Bootstrap Identity to eng-azure-authorization#1256
Conversation
🦋 Changeset detectedLatest commit: bf1872b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds a new CLI use case to open a PR against pagopa/eng-azure-authorization by updating a subscription’s terraform.tfvars, extending the GitHub adapter to support branch/file operations, and documenting the required PAT permissions.
Changes:
- Extend
GitHubService+OctokitGitHubServicewithcreateBranch,getFileContent, andupdateFile(with related tests). - Introduce
TfvarsServicefor updatingdirectory_readers.service_principals_name(with unit tests). - Add
requestAzureAuthorizationuse case and tests; update PAT docs to includeContentspermission.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/website/docs/dx-cli/github-pat.md | Documents Contents: Read and write permission needed for file read/update automation. |
| apps/cli/src/use-cases/request-azure-authorization.ts | New use case implementing the “edit tfvars → branch → commit → PR” workflow. |
| apps/cli/src/use-cases/tests/request-azure-authorization.test.ts | Unit tests covering success and failure paths for the new use case. |
| apps/cli/src/index.ts | Wires TfvarsService and instantiates the new use case in the CLI bootstrap. |
| apps/cli/src/domain/tfvars.ts | Defines tfvars domain errors, service interface, and zod schema for use case input. |
| apps/cli/src/domain/github.ts | Extends GitHub domain API with branch creation, file read, and file update primitives. |
| apps/cli/src/domain/dependencies.ts | Adds tfvarsService to the global dependency container. |
| apps/cli/src/domain/tests/data.ts | Updates dependency mocks to include tfvarsService. |
| apps/cli/src/adapters/tfvars/index.ts | Regex-based implementation for editing terraform.tfvars directory readers list. |
| apps/cli/src/adapters/tfvars/tests/index.test.ts | Tests for tfvars parsing and update behavior (duplicates, invalid format, formatting). |
| apps/cli/src/adapters/octokit/index.ts | Implements new GitHub operations via Octokit REST APIs. |
| apps/cli/src/adapters/octokit/tests/index.test.ts | Tests for new Octokit adapter methods and error handling. |
f0aacdd to
3fa6819
Compare
88455e1 to
9495312
Compare
|
Here is the outcome of the function: https://github.com/pagopa-dx/eng-azure-authorization/pull/3 |
d8df03a to
324cc93
Compare
324cc93 to
50eddf1
Compare
b6fee57 to
32633bb
Compare
32633bb to
c268b1f
Compare
…ition when updating the file
024c012 to
dacd7d5
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-mud-0405c6703-1256.westeurope.1.azurestaticapps.net |
After workspace initialization, the `init` command now automatically requests Azure authorization for each newly initialized cloud account by creating a PR on `eng-azure-authorization` to add the bootstrap identity to directory readers. This wires the `requestAuthorization` use case (introduced in #1256) into the init flow. Closes CES-1522 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This pull request adds new functionality to the
OctokitGitHubServicefor branch creation, file content retrieval, and file updates, along with comprehensive tests for these features. Additionally, it introduces a newTfvarsServicefor manipulating.tfvarsfiles, including robust unit tests for its behavior. These changes enhance the CLI's GitHub integration and improve the handling of Terraform variable files.