Skip to content

Parse Azure authorization with JSON format#1541

Merged
kin0992 merged 8 commits intomainfrom
refactors/use-json-instead-of-hcl
Apr 13, 2026
Merged

Parse Azure authorization with JSON format#1541
kin0992 merged 8 commits intomainfrom
refactors/use-json-instead-of-hcl

Conversation

@kin0992
Copy link
Copy Markdown
Contributor

@kin0992 kin0992 commented Apr 1, 2026

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

🦋 Changeset detected

Latest commit: 54e6338

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@pagopa/dx-cli Patch

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

@dpulls
Copy link
Copy Markdown

dpulls bot commented Apr 1, 2026

⚠️ Dpulls not installed on repository pagopa/eng-azure-authorization. Checkout our quickstart for how to install.

@kin0992 kin0992 force-pushed the refactors/use-json-instead-of-hcl branch from faabc83 to 54e6338 Compare April 1, 2026 09:43
@kin0992 kin0992 marked this pull request as ready for review April 1, 2026 10:31
@kin0992 kin0992 requested a review from a team as a code owner April 1, 2026 10:31
Copilot AI review requested due to automatic review settings April 1, 2026 10:31
Copy link
Copy Markdown
Contributor

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 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 test target 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.

Comment thread apps/cli/src/adapters/pagopa-technology/authorization.ts
@kin0992 kin0992 force-pushed the refactors/use-json-instead-of-hcl branch from 54e6338 to 9a8d3d4 Compare April 1, 2026 15:02
@dpulls
Copy link
Copy Markdown

dpulls bot commented Apr 8, 2026

⚠️ Dpulls not installed on repository pagopa/eng-azure-authorization. Checkout our quickstart for how to install.

@kin0992 kin0992 merged commit 93c8931 into main Apr 13, 2026
7 checks passed
@kin0992 kin0992 deleted the refactors/use-json-instead-of-hcl branch April 13, 2026 07:48
@dx-pagopa-bot dx-pagopa-bot mentioned this pull request Apr 13, 2026
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