Parse Azure authorization with JSON format#1541
Conversation
🦋 Changeset detectedLatest commit: 54e6338 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
|
faabc83 to
54e6338
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates the PagoPA Azure authorization workflow in @pagopa/dx-cli from editing HCL terraform.tfvars files to editing JSON-formatted terraform.tfvars.json files, updating parsing/validation and refactoring tests accordingly.
Changes:
- Switched authorization file parsing and update logic from regex-based HCL editing to JSON parsing + Zod validation, and updated the target file path to
terraform.tfvars.json. - Refactored and expanded unit tests to cover JSON-specific scenarios (invalid JSON, missing keys, preserving existing fields).
- Updated Nx
testtarget defaults to depend on upstream builds.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| nx.json | Makes test depend on ^build in target defaults. |
| apps/cli/src/adapters/pagopa-technology/authorization.ts | Updates authorization file handling to parse/validate/update JSON and changes the file extension to .json. |
| apps/cli/src/adapters/pagopa-technology/tests/authorization.test.ts | Refactors fixtures/assertions to JSON and adds coverage for new behaviors. |
| .changeset/curvy-pugs-wave.md | Adds a patch changeset describing the JSON migration. |
54e6338 to
9a8d3d4
Compare
|
|
This pull request updates the PagoPA Azure authorization workflow to use JSON-formatted authorization files instead of HCL, and refactors the related code and tests accordingly. The main changes include switching file parsing and validation to JSON, updating file paths, improving error handling, and enhancing test coverage for the new format.
Warning
Before merging this PR, we need to migrate the files of the Azure Authorization repository to JSON
Depends on https://github.com/pagopa/eng-azure-authorization/pull/2051
Closes CES-1887