From e06b8b87330c50c8e4f915f6cd2d52456ee8b1c5 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 08:35:08 +0200 Subject: [PATCH 01/34] test action --- action.yml | 20 +++++++++++++------- infrapatch/action/__main__.py | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index 103162d..70bdc34 100644 --- a/action.yml +++ b/action.yml @@ -37,12 +37,18 @@ runs: using: composite steps: - name: Extract branch name - id: head_branch + id: branch shell: bash run: | - head_branch="origin/${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" - echo "Detected head branch: $head_branch" - echo "branch=$head_branch" >> $GITHUB_OUTPUT + head_branch_origin="origin/${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + head_branch="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + target_branch="${{ inputs.target_branch_name }}" + target_branch_origin="origin/${{ inputs.target_branch_name }}" + echo "Using head branch $head_branch and target branch $target_branch" + echo "head=$head_branch" >> $GITHUB_OUTPUT + echo "head_origin=$head_branch_origin" >> $GITHUB_OUTPUT + echo "target=$target_branch" >> $GITHUB_OUTPUT + echo "target_origin=$target_branch_origin" >> $GITHUB_OUTPUT - name: Install Python uses: actions/setup-python@v4 @@ -78,15 +84,15 @@ runs: shell: bash run: | git fetch origin - git checkout -b "${{ inputs.target_branch_name }}" "origin/${{ inputs.target_branch_name }}" + git checkout -b "${{ steps.branch.outputs.target }}" "${{ steps.branch.outputs.target_origin }}" - name: Rebase target branch if: ${{ steps.create_branch.outputs.created == 'false' }} working-directory: ${{ inputs.working_directory }} shell: bash run: | - echo "Rebasing ${{ inputs.target_branch_name }} on ${{ steps.head_branch.outputs.branch }}" - git rebase -Xtheirs ${{ steps.head_branch.outputs.branch }} + echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head_origin }}" + git rebase -Xtheirs ${{ steps.branch.outputs.head_origin }} - name: Run InfraPatch Action shell: bash diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index 9e70983..0b72775 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -46,6 +46,7 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str main_handler.update_resources(upgradable_resources, True, working_directory, True) main_handler.print_resource_table(upgradable_resources) + main_handler.dump_statistics(upgradable_resources, save_as_json_file=True) def get_credentials_from_string(credentials_string: str) -> dict: From 7e4bf1a931052f95ae24e778abd71f301a32ce38 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 08:41:37 +0200 Subject: [PATCH 02/34] test action --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 70bdc34..39837c6 100644 --- a/action.yml +++ b/action.yml @@ -93,6 +93,7 @@ runs: run: | echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head_origin }}" git rebase -Xtheirs ${{ steps.branch.outputs.head_origin }} + git pull - name: Run InfraPatch Action shell: bash From 2c6ec35a44d4643befab2de388282cba76ba9d26 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 08:45:32 +0200 Subject: [PATCH 03/34] test action --- action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 39837c6..6e8a2ed 100644 --- a/action.yml +++ b/action.yml @@ -93,7 +93,6 @@ runs: run: | echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head_origin }}" git rebase -Xtheirs ${{ steps.branch.outputs.head_origin }} - git pull - name: Run InfraPatch Action shell: bash @@ -119,4 +118,4 @@ runs: working-directory: ${{ inputs.working_directory }} shell: bash run: | - git push + git push -u origin "${{ steps.branch.outputs.target }}" From 9ddd215eb37a577f905aabd6b947f3fd07f2ffdb Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 08:49:14 +0200 Subject: [PATCH 04/34] test action --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 6e8a2ed..7100601 100644 --- a/action.yml +++ b/action.yml @@ -91,8 +91,8 @@ runs: working-directory: ${{ inputs.working_directory }} shell: bash run: | - echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head_origin }}" - git rebase -Xtheirs ${{ steps.branch.outputs.head_origin }} + echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head }}" + git rebase -Xtheirs ${{ steps.branch.outputs.head }} - name: Run InfraPatch Action shell: bash From 4ba6664f9b2dea8d5c28ccab7edb953cdb82020e Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 08:52:27 +0200 Subject: [PATCH 05/34] test action --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 7100601..aa25d5f 100644 --- a/action.yml +++ b/action.yml @@ -91,7 +91,7 @@ runs: working-directory: ${{ inputs.working_directory }} shell: bash run: | - echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head }}" + echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head_origin }}" git rebase -Xtheirs ${{ steps.branch.outputs.head }} - name: Run InfraPatch Action @@ -118,4 +118,4 @@ runs: working-directory: ${{ inputs.working_directory }} shell: bash run: | - git push -u origin "${{ steps.branch.outputs.target }}" + git push -f -u origin "${{ steps.branch.outputs.target }}" From 037b22c178cc7e9b0fb9b48614b989c9791f6d18 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 08:53:34 +0200 Subject: [PATCH 06/34] test action --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index aa25d5f..6090fc6 100644 --- a/action.yml +++ b/action.yml @@ -92,7 +92,7 @@ runs: shell: bash run: | echo "Rebasing ${{ steps.branch.outputs.target }} on ${{ steps.branch.outputs.head_origin }}" - git rebase -Xtheirs ${{ steps.branch.outputs.head }} + git rebase -Xtheirs ${{ steps.branch.outputs.head_origin }} - name: Run InfraPatch Action shell: bash From 74f3e5d0f5ffbab1f42be4c00af652b87dd768f5 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 09:19:40 +0200 Subject: [PATCH 07/34] test action --- action.yml | 8 +------- infrapatch/action/__main__.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 6090fc6..18596be 100644 --- a/action.yml +++ b/action.yml @@ -109,13 +109,7 @@ runs: arguments+=("--registry-secrets-string" "\"${{ inputs.registry_secrets }}\"") fi arguments+=("--github-token" "${{ inputs.github_token }}") + arguments+=("--target-branch" "${{ steps.branch.outputs.target }}") arguments+=("--working-directory" "${{ inputs.working_directory }}") arguments+=("--default-registry-domain" "${{ inputs.default_registry_domain }}") python -m "$module" "${arguments[@]}" - - - name: Push changes - if: ${{ inputs.report_only == 'false' }} - working-directory: ${{ inputs.working_directory }} - shell: bash - run: | - git push -f -u origin "${{ steps.branch.outputs.target }}" diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index 0b72775..c0495ba 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -1,3 +1,4 @@ +import subprocess from pathlib import Path import logging as log import click @@ -14,10 +15,11 @@ @click.option("--default-registry-domain") @click.option("--registry-secrets-string", default=None) @click.option("--github-token") +@click.option("--target-branch") @click.option("--report-only", is_flag=True) @click.option("--working-directory") @catch_exception(handle=Exception) -def main(debug: bool, default_registry_domain: str, registry_secrets_string: str, github_token: str, report_only: bool, +def main(debug: bool, default_registry_domain: str, registry_secrets_string: str, github_token: str, target_branch: str, report_only: bool, working_directory: str): setup_logging(debug) log.debug(f"Running infrapatch with the following parameters: " @@ -48,6 +50,16 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str main_handler.print_resource_table(upgradable_resources) main_handler.dump_statistics(upgradable_resources, save_as_json_file=True) + command = ["git", "push", "-f", "-u", "origin", target_branch] + log.debug(f"Executing command: {' '.join(command)}") + try: + result = subprocess.run(command, capture_output=True, text=True, cwd=working_directory.absolute().as_posix()) + except Exception as e: + raise Exception(f"Error pushing to remote: {e}") + if result.returncode != 0: + log.error(f"Stdout: {result.stdout}") + raise Exception(f"Error pushing to remote: {result.stderr}") + def get_credentials_from_string(credentials_string: str) -> dict: credentials = {} From af4bd2b4091ea45d96a00b433c3432ae8005af93 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 09:31:18 +0200 Subject: [PATCH 08/34] test action --- infrapatch/action/__main__.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index c0495ba..e5f49ee 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -2,7 +2,7 @@ from pathlib import Path import logging as log import click -import pygit2 +from github import Auth, Github from infrapatch.core.composition import build_main_handler from infrapatch.core.log_helper import catch_exception, setup_logging @@ -16,10 +16,12 @@ @click.option("--registry-secrets-string", default=None) @click.option("--github-token") @click.option("--target-branch") +@click.option("--head-branch") +@click.option("--repository-name") @click.option("--report-only", is_flag=True) @click.option("--working-directory") @catch_exception(handle=Exception) -def main(debug: bool, default_registry_domain: str, registry_secrets_string: str, github_token: str, target_branch: str, report_only: bool, +def main(debug: bool, default_registry_domain: str, registry_secrets_string: str, github_token: str, target_branch: str, head_branch: str, repository_name: str, report_only: bool, working_directory: str): setup_logging(debug) log.debug(f"Running infrapatch with the following parameters: " @@ -60,6 +62,17 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str log.error(f"Stdout: {result.stdout}") raise Exception(f"Error pushing to remote: {result.stderr}") + token = Auth.Token(github_token) + github = Github(token) + repo = github.get_repo(repository_name) + pull = repo.get_pulls(state='open', sort='created', base=head_branch, head=target_branch) + if pull.totalCount != 0: + log.info(f"Pull request found from '{target_branch}' to '{head_branch}'") + return + + log.info(f"No pull request found from '{target_branch}' to '{head_branch}'. Creating a new one.") + pull = repo.create_pull(title=f"InfraPatch Module and Provider Update", body=f"InfraPatch Module and Provider Update", base=head_branch, head=target_branch) + def get_credentials_from_string(credentials_string: str) -> dict: credentials = {} From 87782fda81c3239719acd887fc4db6e1d1363867 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 09:35:03 +0200 Subject: [PATCH 09/34] test action --- action.yml | 6 ++++++ requirements.txt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 18596be..1424dfb 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,10 @@ inputs: description: "Name of the branch where changes will be pushed to. Defaults to feature/infrapatch-bot" required: true default: "feature/infrapatch-bot" + repository_name: + description: "Name of the repository to run the action in. Defaults to the current repository" + required: false + default: ${{ github.repository }} default_registry_domain: description: "Default registry domain to use for modules and providers without explicit registry domain set. Defaults to registry.terraform.io" required: false @@ -109,7 +113,9 @@ runs: arguments+=("--registry-secrets-string" "\"${{ inputs.registry_secrets }}\"") fi arguments+=("--github-token" "${{ inputs.github_token }}") + arguments+=("--head-branch" "${{ steps.branch.outputs.head }}") arguments+=("--target-branch" "${{ steps.branch.outputs.target }}") + arguments+=("--repository-name" "${{ inputs.repository_name }}") arguments+=("--working-directory" "${{ inputs.working_directory }}") arguments+=("--default-registry-domain" "${{ inputs.default_registry_domain }}") python -m "$module" "${arguments[@]}" diff --git a/requirements.txt b/requirements.txt index 5f1de4d..d629124 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ pygohcl~=1.0.7 GitPython~=3.1.40 setuptools~=65.5.1 pygit2~=1.13.1 -semantic-version~=2.10.0 \ No newline at end of file +semantic-version~=2.10.0 +PyGithub~=2.1.1 \ No newline at end of file From 48b8e29d97e901925ecfa9e75b732376d7c46c00 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 09:54:36 +0200 Subject: [PATCH 10/34] test action --- .github/workflows/action_integration_test.yml | 1 + infrapatch/action/__main__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 162264a..6d0b1c2 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -3,6 +3,7 @@ name: "GitHub Action integration test" permissions: contents: write pull-requests: write + repository-projects: read on: pull_request: diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index e5f49ee..d6545c4 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -63,7 +63,7 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str raise Exception(f"Error pushing to remote: {result.stderr}") token = Auth.Token(github_token) - github = Github(token) + github = Github(auth=token) repo = github.get_repo(repository_name) pull = repo.get_pulls(state='open', sort='created', base=head_branch, head=target_branch) if pull.totalCount != 0: From 9f204c30f92afa17fa86c6105e8265e4ffbb9f20 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 09:57:30 +0200 Subject: [PATCH 11/34] test action --- .github/workflows/action_integration_test.yml | 1 - infrapatch/action/__main__.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 6d0b1c2..162264a 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -3,7 +3,6 @@ name: "GitHub Action integration test" permissions: contents: write pull-requests: write - repository-projects: read on: pull_request: diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index d6545c4..a476fdc 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -62,6 +62,10 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str log.error(f"Stdout: {result.stdout}") raise Exception(f"Error pushing to remote: {result.stderr}") + create_pr(github_token, head_branch, repository_name, target_branch) + + +def create_pr(github_token, head_branch, repository_name, target_branch): token = Auth.Token(github_token) github = Github(auth=token) repo = github.get_repo(repository_name) @@ -69,7 +73,6 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str if pull.totalCount != 0: log.info(f"Pull request found from '{target_branch}' to '{head_branch}'") return - log.info(f"No pull request found from '{target_branch}' to '{head_branch}'. Creating a new one.") pull = repo.create_pull(title=f"InfraPatch Module and Provider Update", body=f"InfraPatch Module and Provider Update", base=head_branch, head=target_branch) From 99502a8eebdb310a1a173a0383b88f20a6371258 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 10:50:00 +0200 Subject: [PATCH 12/34] test action --- action.yml | 15 +++++++++++++++ infrapatch/action/__main__.py | 22 +++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 1424dfb..9d28172 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,14 @@ inputs: description: "Working directory to run the command in. Defaults to the root of the repository" required: false default: ${{ github.workspace }} +outputs: + target_branch: + description: "Name of the branch where changes will be pushed to" + value: ${{ inputs.target_branch_name }} + pr_number: + description: "Number of the pull request that was created" + value: ${{ steps.statistics.outputs.pr_number }} + runs: using: composite steps: @@ -119,3 +127,10 @@ runs: arguments+=("--working-directory" "${{ inputs.working_directory }}") arguments+=("--default-registry-domain" "${{ inputs.default_registry_domain }}") python -m "$module" "${arguments[@]}" + + - name: Get statistics + id: statistics + shell: pwsh + run: | + $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json + Write-Output "pr_number=$($report.pull_number)" >> $GITHUB_OUTPUT diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index a476fdc..5a26767 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -1,8 +1,10 @@ +import json import subprocess from pathlib import Path import logging as log import click from github import Auth, Github +from github.PullRequest import PullRequest from infrapatch.core.composition import build_main_handler from infrapatch.core.log_helper import catch_exception, setup_logging @@ -52,6 +54,18 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str main_handler.print_resource_table(upgradable_resources) main_handler.dump_statistics(upgradable_resources, save_as_json_file=True) + push_changes(target_branch, working_directory) + + pull = create_pr(github_token, head_branch, repository_name, target_branch) + return_values = {"pr_number": pull.number} + return_value_file = Path("return_values.json") + if return_value_file.exists(): + return_value_file.unlink() + with open(return_value_file, "w") as f: + f.write(json.dumps(return_values)) + + +def push_changes(target_branch, working_directory): command = ["git", "push", "-f", "-u", "origin", target_branch] log.debug(f"Executing command: {' '.join(command)}") try: @@ -62,19 +76,17 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str log.error(f"Stdout: {result.stdout}") raise Exception(f"Error pushing to remote: {result.stderr}") - create_pr(github_token, head_branch, repository_name, target_branch) - -def create_pr(github_token, head_branch, repository_name, target_branch): +def create_pr(github_token, head_branch, repository_name, target_branch) -> PullRequest: token = Auth.Token(github_token) github = Github(auth=token) repo = github.get_repo(repository_name) pull = repo.get_pulls(state='open', sort='created', base=head_branch, head=target_branch) if pull.totalCount != 0: log.info(f"Pull request found from '{target_branch}' to '{head_branch}'") - return + return pull[0] log.info(f"No pull request found from '{target_branch}' to '{head_branch}'. Creating a new one.") - pull = repo.create_pull(title=f"InfraPatch Module and Provider Update", body=f"InfraPatch Module and Provider Update", base=head_branch, head=target_branch) + return repo.create_pull(title=f"InfraPatch Module and Provider Update", body=f"InfraPatch Module and Provider Update", base=head_branch, head=target_branch) def get_credentials_from_string(credentials_string: str) -> dict: From 0b34c8df681369e713b3927d6d313ca5da3ff728 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 10:52:50 +0200 Subject: [PATCH 13/34] test action --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 9d28172..e887c5e 100644 --- a/action.yml +++ b/action.yml @@ -130,6 +130,7 @@ runs: - name: Get statistics id: statistics + if: ${{ inputs.report_only == 'false' }} shell: pwsh run: | $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json From 2bc9f23b3e589d68b8a03490e37e9a9b96b4315f Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:12:00 +0200 Subject: [PATCH 14/34] test action --- .github/workflows/action_integration_test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 162264a..d6dc3d2 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -21,15 +21,21 @@ jobs: - name: Run in report only mode uses: ./ with: - push_changes: false report_only: true - name: Run in update mode uses: ./ with: - push_changes: false report_only: false + - name: Delete PR and target_branch + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr close ${{ steps.create_branch.outputs.pr_number }} + gh branch delete ${{ steps.branch.outputs.target_branch }} --force + From f388ccc588f6a677d53fca2097644119aabf8f9e Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:13:53 +0200 Subject: [PATCH 15/34] test action --- .github/workflows/action_integration_test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index d6dc3d2..b38136a 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -24,6 +24,7 @@ jobs: report_only: true - name: Run in update mode + id: update uses: ./ with: report_only: false @@ -33,8 +34,8 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr close ${{ steps.create_branch.outputs.pr_number }} - gh branch delete ${{ steps.branch.outputs.target_branch }} --force + gh pr close ${{ steps.update.outputs.pr_number }} + gh branch delete ${{ steps.update.outputs.target_branch }} --force From aab237c3634febe6a52f6d5a32c3a9751b12f230 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:19:43 +0200 Subject: [PATCH 16/34] test action --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e887c5e..04271f9 100644 --- a/action.yml +++ b/action.yml @@ -134,4 +134,4 @@ runs: shell: pwsh run: | $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json - Write-Output "pr_number=$($report.pull_number)" >> $GITHUB_OUTPUT + echo "pr_number=$($report.pull_number)" >> $GITHUB_OUTPUT From 2f3513734792abd3a9b6ee05271c4548bb1eb00a Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:22:01 +0200 Subject: [PATCH 17/34] test action --- action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 04271f9..e0fa525 100644 --- a/action.yml +++ b/action.yml @@ -134,4 +134,6 @@ runs: shell: pwsh run: | $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json - echo "pr_number=$($report.pull_number)" >> $GITHUB_OUTPUT + pr_number=$report.pull_number + Write-Host "Found PR $pr_number" + echo "pr_number=$pr_number" >> $GITHUB_OUTPUT From 079f98052636b4ebfab4155100ad57ca1f4889e4 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:26:37 +0200 Subject: [PATCH 18/34] test action --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e0fa525..e29da0d 100644 --- a/action.yml +++ b/action.yml @@ -134,6 +134,6 @@ runs: shell: pwsh run: | $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json - pr_number=$report.pull_number + pr_number = $report.pull_number Write-Host "Found PR $pr_number" echo "pr_number=$pr_number" >> $GITHUB_OUTPUT From 8dd48401999ce890f8923e66ef22a38e54b9b954 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:27:49 +0200 Subject: [PATCH 19/34] test action --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e29da0d..dfcd31f 100644 --- a/action.yml +++ b/action.yml @@ -134,6 +134,6 @@ runs: shell: pwsh run: | $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json - pr_number = $report.pull_number + $pr_number = $report.pull_number Write-Host "Found PR $pr_number" echo "pr_number=$pr_number" >> $GITHUB_OUTPUT From a7d847d4457441155659bf873d1883291b36c6dd Mon Sep 17 00:00:00 2001 From: Noahnc Date: Fri, 27 Oct 2023 11:30:06 +0200 Subject: [PATCH 20/34] test action --- .github/workflows/action_integration_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index b38136a..2980676 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -34,7 +34,6 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr close ${{ steps.update.outputs.pr_number }} gh branch delete ${{ steps.update.outputs.target_branch }} --force From 3f580cd832f8b78b746b310cdcb5a20950368990 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 12:58:55 +0100 Subject: [PATCH 21/34] test action --- .github/workflows/action_integration_test.yml | 11 +++++------ action.yml | 12 ------------ infrapatch/action/__main__.py | 8 +------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 2980676..3bd400c 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -29,12 +29,11 @@ jobs: with: report_only: false - - name: Delete PR and target_branch - shell: bash - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh branch delete ${{ steps.update.outputs.target_branch }} --force + - name: Delete created branch + uses: dawidd6/action-delete-branch@v3 + with: + github_token: ${{github.token}} + branches: ${{ steps.update.outputs.target_branch }} diff --git a/action.yml b/action.yml index dfcd31f..f43adb2 100644 --- a/action.yml +++ b/action.yml @@ -41,9 +41,6 @@ outputs: target_branch: description: "Name of the branch where changes will be pushed to" value: ${{ inputs.target_branch_name }} - pr_number: - description: "Number of the pull request that was created" - value: ${{ steps.statistics.outputs.pr_number }} runs: using: composite @@ -128,12 +125,3 @@ runs: arguments+=("--default-registry-domain" "${{ inputs.default_registry_domain }}") python -m "$module" "${arguments[@]}" - - name: Get statistics - id: statistics - if: ${{ inputs.report_only == 'false' }} - shell: pwsh - run: | - $report = Get-Content "return_values.json" -Raw | ConvertFrom-Json - $pr_number = $report.pull_number - Write-Host "Found PR $pr_number" - echo "pr_number=$pr_number" >> $GITHUB_OUTPUT diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index 5a26767..21d53d1 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -56,13 +56,7 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str push_changes(target_branch, working_directory) - pull = create_pr(github_token, head_branch, repository_name, target_branch) - return_values = {"pr_number": pull.number} - return_value_file = Path("return_values.json") - if return_value_file.exists(): - return_value_file.unlink() - with open(return_value_file, "w") as f: - f.write(json.dumps(return_values)) + create_pr(github_token, head_branch, repository_name, target_branch) def push_changes(target_branch, working_directory): From e55b5546ee3ccb2eda7c569dc9d60a25a70500d6 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:00:25 +0100 Subject: [PATCH 22/34] test action --- .github/workflows/action_integration_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 3bd400c..0a76175 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -34,6 +34,7 @@ jobs: with: github_token: ${{github.token}} branches: ${{ steps.update.outputs.target_branch }} + soft_fail: true From 11c42018a032d88573d7081bd74c38d0523b58b6 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:01:59 +0100 Subject: [PATCH 23/34] test action --- .github/workflows/action_integration_test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 0a76175..715dd1f 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -29,6 +29,20 @@ jobs: with: report_only: false + - name: Check update result + shell: pwsh + run: | + $report = Get-Content $env:report_json_file -Raw | ConvertFrom-Json + if ( -not $report.total_resources -gt 0 ) { + throw "Failed to get resources" + } + if ( -not ( $report.resources_patched -gt 3 ) ) { + throw "No resources should be patched" + } + if ( $report.errors -gt 0 ) { + throw "Errors have been detected" + } + - name: Delete created branch uses: dawidd6/action-delete-branch@v3 with: From 76e5e240235cfb79bc42e329e891e3ae1e2eb881 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:04:32 +0100 Subject: [PATCH 24/34] test action --- .github/workflows/action_integration_test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index 715dd1f..be8b479 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -12,6 +12,9 @@ on: jobs: integration-test: + env: + report_json_file: InfraPatch_Statistics.json + name: "Run GitHub Action integration test" runs-on: ubuntu-latest steps: @@ -43,7 +46,8 @@ jobs: throw "Errors have been detected" } - - name: Delete created branch + - name: Delete created branch$ + if: always() uses: dawidd6/action-delete-branch@v3 with: github_token: ${{github.token}} From c56f7a6c06ce3367da50f39fd694de3b27346480 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:09:23 +0100 Subject: [PATCH 25/34] test action --- infrapatch/core/composition.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index 38b0078..b796844 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -107,8 +107,7 @@ def update_resources(self, resources: list[VersionedTerraformResource], confirm: def _compose_resource_table(self, resources: list[VersionedTerraformResource], title: str): table = Table(show_header=True, - title=title, - width=cs.CLI_WIDTH + title=title ) table.add_column("Name") table.add_column("Current Version") From 42f7973e0c3d5a48007d479400b95391de650a70 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:10:56 +0100 Subject: [PATCH 26/34] test action --- InfraPatch_Statistics.json | 1 + infrapatch/core/composition.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 InfraPatch_Statistics.json diff --git a/InfraPatch_Statistics.json b/InfraPatch_Statistics.json new file mode 100644 index 0000000..3d2cd9b --- /dev/null +++ b/InfraPatch_Statistics.json @@ -0,0 +1 @@ +{"errors": 0, "resources_patched": 0, "resources_pending_update": 6, "total_resources": 76, "modules_count": 67, "providers_count": 9, "modules": [{"name": "webservices_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "webservices_spoke", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "webservices_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "webservices_vm_admins", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "hostingwebserver_firewall_policies", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_vm.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "hostingwebserver_subnet_nsg", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_vm.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_networksecuritygroup/azure", "source": "spacelift.io/cminformatik/azure_security_networksecuritygroup/azure"}, {"name": "hostingwebserver_vm", "current_version": "5.2.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_vm.tf", "newest_version": "5.2.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_virtualmachine/azure", "source": "spacelift.io/cminformatik/azure_compute_virtualmachine/azure"}, {"name": "ais_mssql_database", "current_version": "1.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "1.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_mssql_database/azure", "source": "spacelift.io/cminformatik/azure_storage_mssql_database/azure"}, {"name": "cdws_managers", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "cdws_managers_bastion_access", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "hostingwebserver-cdws_firewall_policies", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "hostingwebserver-cdws_subnet_nsg", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_networksecuritygroup/azure", "source": "spacelift.io/cminformatik/azure_security_networksecuritygroup/azure"}, {"name": "hostingwebserver-cdws_vm", "current_version": "5.2.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "5.2.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_virtualmachine/azure", "source": "spacelift.io/cminformatik/azure_compute_virtualmachine/azure"}, {"name": "cmi-azure_security_keyvaultipmanager", "current_version": "0.5.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "0.5.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi-azure_security_keyvaultipmanager/cmi", "source": "spacelift.io/cminformatik/cmi-azure_security_keyvaultipmanager/cmi"}, {"name": "global_vm_administrators_role_assignment", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_roles_assignment/azure", "source": "spacelift.io/cminformatik/azure_admin_roles_assignment/azure"}, {"name": "main_internal_dns_zone", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_zone/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_zone/azure"}, {"name": "main_key_vault", "current_version": "3.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "3.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_keyvault/azure", "source": "spacelift.io/cminformatik/azure_storage_keyvault/azure"}, {"name": "main_maintenance_configuration", "current_version": "2.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "2.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_maintenance_configuration/azure", "source": "spacelift.io/cminformatik/azure_maintenance_configuration/azure"}, {"name": "main_network_watcher", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_networkwatcher/azure", "source": "spacelift.io/cminformatik/azure_networking_networkwatcher/azure"}, {"name": "main_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "recovery_service_vault_main", "current_version": "1.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_recoveryservicevault/azure", "source": "spacelift.io/cminformatik/azure_storage_recoveryservicevault/azure"}, {"name": "operations_run_team_cmi-cloud_permissions", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/permissions.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "hub_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "main_hub_bastion", "current_version": "1.0.3", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.3", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_bastion/azure", "source": "spacelift.io/cminformatik/azure_admin_bastion/azure"}, {"name": "main_hub_firewall", "current_version": "1.3.10", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.3.10", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall/azure"}, {"name": "main_hub_network_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "main_hub_vnet", "current_version": "1.0.3", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.3", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet/azure"}, {"name": "spoke_routing_table", "current_version": "1.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_routingtable/azure", "source": "spacelift.io/cminformatik/azure_networking_routingtable/azure"}, {"name": "aks_spoke_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "main_aks_cluster", "current_version": "1.0.9", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.9", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_kubernetes_cluster/azure", "source": "spacelift.io/cminformatik/azure_compute_kubernetes_cluster/azure"}, {"name": "main_aks_firewall_rules", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "main_aks_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "main_aks_spoke", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "main_aks_storage_account", "current_version": "4.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "4.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccount/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccount/azure"}, {"name": "cmi-azure_montorin_grafanacollector", "current_version": "1.1.3", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/grafana-agent.tf", "newest_version": "1.1.3", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi-azure_montorin_grafanacollector/cmi", "source": "spacelift.io/cminformatik/cmi-azure_montorin_grafanacollector/cmi"}, {"name": "global_subnets_switzerlandnorth", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/global_settings.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "postgres_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "postgres_server", "current_version": "1.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_pgsql_server/azure", "source": "spacelift.io/cminformatik/azure_storage_pgsql_server/azure"}, {"name": "postgres_server_spoke_vnet", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "postgres_spoke_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "shared_mssql_server", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_mssql_server/azure", "source": "spacelift.io/cminformatik/azure_storage_mssql_server/azure"}, {"name": "lehreroffice_managers", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "lehreroffice_managers_bastion_access", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "lehreroffice_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "lehreroffice_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "lehreroffice_custom_sftp_cname_record", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "lehreroffice_firewall_policies", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "lehreroffice_spoke", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "lehreroffice_webserver_subnet_nsg", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_networksecuritygroup/azure", "source": "spacelift.io/cminformatik/azure_security_networksecuritygroup/azure"}, {"name": "lehreroffice_webserver_vm", "current_version": "5.2.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "5.2.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_virtualmachine/azure", "source": "spacelift.io/cminformatik/azure_compute_virtualmachine/azure"}, {"name": "lehrerofficenet_dns_records", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "lehreroffice_storage_account_managers_rbac_policy", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "lehreroffice_webserver_appservice", "current_version": "3.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "3.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_appservice/azure", "source": "spacelift.io/cminformatik/azure_compute_appservice/azure"}, {"name": "lehreroffice_webserver_appserviceplan", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_appserviceplan/azure", "source": "spacelift.io/cminformatik/azure_compute_appserviceplan/azure"}, {"name": "lehreroffice_webserver_container_config", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccountcontainer/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccountcontainer/azure"}, {"name": "lehreroffice_webserver_container_webdata", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccountcontainer/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccountcontainer/azure"}, {"name": "lehreroffice_webserver_share_lhdfiles", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccountshare/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccountshare/azure"}, {"name": "lehreroffice_webserver_storage_account", "current_version": "4.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "4.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccount/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccount/azure"}, {"name": "pgadmin", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/pgadmin.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_kubernetes_deployment/azure", "source": "spacelift.io/cminformatik/azure_compute_kubernetes_deployment/azure"}, {"name": "contactsync_deployment", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/contactsync.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_kubernetes_deployment/azure", "source": "spacelift.io/cminformatik/azure_compute_kubernetes_deployment/azure"}, {"name": "octopus_volume_contributor", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/contactsync.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "app_gateway_001", "current_version": "0.7.4", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/main.tf", "newest_version": "0.7.4", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_applicationgateway/azure", "source": "spacelift.io/cminformatik/azure_networking_applicationgateway/azure"}, {"name": "shared_applicationgateways_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "lehrerofficenet_dns_records_webserver", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/lehreroffice.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "cdws_webserver_dns_records", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/webservices.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "webservices_ag_cname_record", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/webservices.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "cmi-spacelift-stacks", "current_version": "1.4.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/Spacelift-Resources/main.tf", "newest_version": "1.4.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/spacelift_admin_stacks/spacelift", "source": "spacelift.io/cminformatik/spacelift_admin_stacks/spacelift"}], "providers": [{"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "dns", "current_version": "3.3.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/meta.tf", "newest_version": "3.3.2", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/dns", "source": "hashicorp/dns"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "azuread", "current_version": "2.44.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/meta.tf", "newest_version": "2.45.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azuread", "source": "hashicorp/azuread"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "kubernetes", "current_version": "2.23.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/meta.tf", "newest_version": "2.23.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/kubernetes", "source": "hashicorp/kubernetes"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "spacelift", "current_version": "1.6.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/Spacelift-Resources/meta.tf", "newest_version": "1.6.0", "status": "unpatched", "base_domain": null, "identifier": "spacelift-io/spacelift", "source": "spacelift-io/spacelift"}]} \ No newline at end of file diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index b796844..4aa9870 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -120,7 +120,7 @@ def _compose_resource_table(self, resources: list[VersionedTerraformResource], t resource.newest_version, str(not resource.installed_version_equal_or_newer_than_new_version()) ) - console = Console() + console = Console(width=cs.CLI_WIDTH) console.print(table) def dump_statistics(self, resources, save_as_json_file: bool = False): From 3b5ea00ac0a14effcb3828c73d88a6e30f0cc3f3 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:14:03 +0100 Subject: [PATCH 27/34] test action --- infrapatch/core/composition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index 4aa9870..41f059c 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -159,4 +159,4 @@ def dump_statistics(self, resources, save_as_json_file: bool = False): str(statistics["modules_count"]), str(statistics["providers_count"]) ) - Console().print(table) + Console(width=cs.CLI_WIDTH).print(table) From ef225b743d9ba5d01c31c0c35440d7d8a0d5e272 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:21:25 +0100 Subject: [PATCH 28/34] test action --- InfraPatch_Statistics.json | 1 - infrapatch/core/composition.py | 15 +++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 InfraPatch_Statistics.json diff --git a/InfraPatch_Statistics.json b/InfraPatch_Statistics.json deleted file mode 100644 index 3d2cd9b..0000000 --- a/InfraPatch_Statistics.json +++ /dev/null @@ -1 +0,0 @@ -{"errors": 0, "resources_patched": 0, "resources_pending_update": 6, "total_resources": 76, "modules_count": 67, "providers_count": 9, "modules": [{"name": "webservices_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "webservices_spoke", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "webservices_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "webservices_vm_admins", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/main.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "hostingwebserver_firewall_policies", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_vm.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "hostingwebserver_subnet_nsg", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_vm.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_networksecuritygroup/azure", "source": "spacelift.io/cminformatik/azure_security_networksecuritygroup/azure"}, {"name": "hostingwebserver_vm", "current_version": "5.2.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_vm.tf", "newest_version": "5.2.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_virtualmachine/azure", "source": "spacelift.io/cminformatik/azure_compute_virtualmachine/azure"}, {"name": "ais_mssql_database", "current_version": "1.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "1.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_mssql_database/azure", "source": "spacelift.io/cminformatik/azure_storage_mssql_database/azure"}, {"name": "cdws_managers", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "cdws_managers_bastion_access", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "hostingwebserver-cdws_firewall_policies", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "hostingwebserver-cdws_subnet_nsg", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_networksecuritygroup/azure", "source": "spacelift.io/cminformatik/azure_security_networksecuritygroup/azure"}, {"name": "hostingwebserver-cdws_vm", "current_version": "5.2.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/webserver_cdws.tf", "newest_version": "5.2.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_virtualmachine/azure", "source": "spacelift.io/cminformatik/azure_compute_virtualmachine/azure"}, {"name": "cmi-azure_security_keyvaultipmanager", "current_version": "0.5.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "0.5.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi-azure_security_keyvaultipmanager/cmi", "source": "spacelift.io/cminformatik/cmi-azure_security_keyvaultipmanager/cmi"}, {"name": "global_vm_administrators_role_assignment", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_roles_assignment/azure", "source": "spacelift.io/cminformatik/azure_admin_roles_assignment/azure"}, {"name": "main_internal_dns_zone", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_zone/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_zone/azure"}, {"name": "main_key_vault", "current_version": "3.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "3.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_keyvault/azure", "source": "spacelift.io/cminformatik/azure_storage_keyvault/azure"}, {"name": "main_maintenance_configuration", "current_version": "2.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "2.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_maintenance_configuration/azure", "source": "spacelift.io/cminformatik/azure_maintenance_configuration/azure"}, {"name": "main_network_watcher", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_networkwatcher/azure", "source": "spacelift.io/cminformatik/azure_networking_networkwatcher/azure"}, {"name": "main_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "recovery_service_vault_main", "current_version": "1.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/main.tf", "newest_version": "1.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_recoveryservicevault/azure", "source": "spacelift.io/cminformatik/azure_storage_recoveryservicevault/azure"}, {"name": "operations_run_team_cmi-cloud_permissions", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/permissions.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "hub_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "main_hub_bastion", "current_version": "1.0.3", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.3", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_bastion/azure", "source": "spacelift.io/cminformatik/azure_admin_bastion/azure"}, {"name": "main_hub_firewall", "current_version": "1.3.10", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.3.10", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall/azure"}, {"name": "main_hub_network_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "main_hub_vnet", "current_version": "1.0.3", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.3", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet/azure"}, {"name": "spoke_routing_table", "current_version": "1.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/network.tf", "newest_version": "1.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_routingtable/azure", "source": "spacelift.io/cminformatik/azure_networking_routingtable/azure"}, {"name": "aks_spoke_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "main_aks_cluster", "current_version": "1.0.9", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.9", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_kubernetes_cluster/azure", "source": "spacelift.io/cminformatik/azure_compute_kubernetes_cluster/azure"}, {"name": "main_aks_firewall_rules", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "main_aks_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "main_aks_spoke", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "main_aks_storage_account", "current_version": "4.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/kubernetes_cluster.tf", "newest_version": "4.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccount/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccount/azure"}, {"name": "cmi-azure_montorin_grafanacollector", "current_version": "1.1.3", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/grafana-agent.tf", "newest_version": "1.1.3", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi-azure_montorin_grafanacollector/cmi", "source": "spacelift.io/cminformatik/cmi-azure_montorin_grafanacollector/cmi"}, {"name": "global_subnets_switzerlandnorth", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/global_settings.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "postgres_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "postgres_server", "current_version": "1.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_pgsql_server/azure", "source": "spacelift.io/cminformatik/azure_storage_pgsql_server/azure"}, {"name": "postgres_server_spoke_vnet", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "postgres_spoke_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "shared_mssql_server", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/database.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_mssql_server/azure", "source": "spacelift.io/cminformatik/azure_storage_mssql_server/azure"}, {"name": "lehreroffice_managers", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "lehreroffice_managers_bastion_access", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "lehreroffice_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "lehreroffice_subnets", "current_version": "1.0.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/main.tf", "newest_version": "1.0.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/cmi_networking_subnetobjectcreator/cmi", "source": "spacelift.io/cminformatik/cmi_networking_subnetobjectcreator/cmi"}, {"name": "lehreroffice_custom_sftp_cname_record", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "lehreroffice_firewall_policies", "current_version": "1.2.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "1.2.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure", "source": "spacelift.io/cminformatik/azure_networking_firewall_policyrulecollectiongroup/azure"}, {"name": "lehreroffice_spoke", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_vnet_spoke/azure", "source": "spacelift.io/cminformatik/azure_networking_vnet_spoke/azure"}, {"name": "lehreroffice_webserver_subnet_nsg", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_networksecuritygroup/azure", "source": "spacelift.io/cminformatik/azure_security_networksecuritygroup/azure"}, {"name": "lehreroffice_webserver_vm", "current_version": "5.2.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "5.2.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_virtualmachine/azure", "source": "spacelift.io/cminformatik/azure_compute_virtualmachine/azure"}, {"name": "lehrerofficenet_dns_records", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_vm.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "lehreroffice_storage_account_managers_rbac_policy", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "lehreroffice_webserver_appservice", "current_version": "3.0.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "3.0.2", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_appservice/azure", "source": "spacelift.io/cminformatik/azure_compute_appservice/azure"}, {"name": "lehreroffice_webserver_appserviceplan", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_appserviceplan/azure", "source": "spacelift.io/cminformatik/azure_compute_appserviceplan/azure"}, {"name": "lehreroffice_webserver_container_config", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccountcontainer/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccountcontainer/azure"}, {"name": "lehreroffice_webserver_container_webdata", "current_version": "1.1.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.1.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccountcontainer/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccountcontainer/azure"}, {"name": "lehreroffice_webserver_share_lhdfiles", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccountshare/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccountshare/azure"}, {"name": "lehreroffice_webserver_storage_account", "current_version": "4.1.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/webserver_appservice.tf", "newest_version": "4.1.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_storage_storageaccount/azure", "source": "spacelift.io/cminformatik/azure_storage_storageaccount/azure"}, {"name": "pgadmin", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/pgadmin.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_kubernetes_deployment/azure", "source": "spacelift.io/cminformatik/azure_compute_kubernetes_deployment/azure"}, {"name": "contactsync_deployment", "current_version": "1.0.6", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/contactsync.tf", "newest_version": "1.0.6", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_compute_kubernetes_deployment/azure", "source": "spacelift.io/cminformatik/azure_compute_kubernetes_deployment/azure"}, {"name": "octopus_volume_contributor", "current_version": "2.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/contactsync.tf", "newest_version": "2.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_security_rbac_policy/azure", "source": "spacelift.io/cminformatik/azure_security_rbac_policy/azure"}, {"name": "app_gateway_001", "current_version": "0.7.4", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/main.tf", "newest_version": "0.7.4", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_applicationgateway/azure", "source": "spacelift.io/cminformatik/azure_networking_applicationgateway/azure"}, {"name": "shared_applicationgateways_rg", "current_version": "1.0.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/main.tf", "newest_version": "1.0.1", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_admin_resourcegroup/azure", "source": "spacelift.io/cminformatik/azure_admin_resourcegroup/azure"}, {"name": "lehrerofficenet_dns_records_webserver", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/lehreroffice.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "cdws_webserver_dns_records", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/webservices.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "webservices_ag_cname_record", "current_version": "2.3.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/webservices.tf", "newest_version": "2.3.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/azure_networking_dns_record/azure", "source": "spacelift.io/cminformatik/azure_networking_dns_record/azure"}, {"name": "cmi-spacelift-stacks", "current_version": "1.4.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/Spacelift-Resources/main.tf", "newest_version": "1.4.0", "status": "unpatched", "base_domain": "spacelift.io", "identifier": "cminformatik/spacelift_admin_stacks/spacelift", "source": "spacelift.io/cminformatik/spacelift_admin_stacks/spacelift"}], "providers": [{"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Web-Services/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "dns", "current_version": "3.3.2", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Base-Infrastructure/meta.tf", "newest_version": "3.3.2", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/dns", "source": "hashicorp/dns"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Lehreroffice/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "azuread", "current_version": "2.44.1", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/meta.tf", "newest_version": "2.45.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azuread", "source": "hashicorp/azuread"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "kubernetes", "current_version": "2.23.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Kubernetes-Deployments/meta.tf", "newest_version": "2.23.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/kubernetes", "source": "hashicorp/kubernetes"}, {"name": "azurerm", "current_version": "~>3.77.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/CMI-Cloud_Azure/Shared-ApplicationGateways/meta.tf", "newest_version": "~>3.78.0", "status": "unpatched", "base_domain": null, "identifier": "hashicorp/azurerm", "source": "hashicorp/azurerm"}, {"name": "spacelift", "current_version": "1.6.0", "source_file": "/Users/noahcanadea/GitHub/cmi-cloud-prod-infrastructure/Spacelift-Resources/meta.tf", "newest_version": "1.6.0", "status": "unpatched", "base_domain": null, "identifier": "spacelift-io/spacelift", "source": "spacelift-io/spacelift"}]} \ No newline at end of file diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index 41f059c..b39658b 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -3,6 +3,7 @@ from pathlib import Path import click +import rich from git import Repo from rich import progress from rich.console import Console @@ -23,13 +24,14 @@ def build_main_handler(default_registry_domain: str, credentials_file_path: str if credentials_dict is None: credentials_dict = get_registry_credentials(hcl_handler, credentials_file_path) registry_handler = RegistryHandler(default_registry_domain, credentials_dict) - return MainHandler(hcl_handler, registry_handler) + return MainHandler(hcl_handler, registry_handler, Console(width=cs.CLI_WIDTH)) class MainHandler: - def __init__(self, hcl_handler: HclHandler, registry_handler: RegistryHandler): + def __init__(self, hcl_handler: HclHandler, registry_handler: RegistryHandler, Console: rich.Console): self.hcl_handler = hcl_handler self.registry_handler = registry_handler + self._console = Console def get_all_terraform_resources(self, project_root: Path) -> list[VersionedTerraformResource]: log.info(f"Searching for .tf files in {project_root.absolute().as_posix()} ...") @@ -107,7 +109,8 @@ def update_resources(self, resources: list[VersionedTerraformResource], confirm: def _compose_resource_table(self, resources: list[VersionedTerraformResource], title: str): table = Table(show_header=True, - title=title + title=title, + expand=True ) table.add_column("Name") table.add_column("Current Version") @@ -121,7 +124,7 @@ def _compose_resource_table(self, resources: list[VersionedTerraformResource], t str(not resource.installed_version_equal_or_newer_than_new_version()) ) console = Console(width=cs.CLI_WIDTH) - console.print(table) + self._console.print(table) def dump_statistics(self, resources, save_as_json_file: bool = False): providers = [resource for resource in resources if isinstance(resource, TerraformProvider)] @@ -143,7 +146,7 @@ def dump_statistics(self, resources, save_as_json_file: bool = False): f.write(json.dumps(statistics)) table = Table(show_header=True, title="Statistics", - width=cs.CLI_WIDTH + expand=True ) table.add_column("Total Resources") table.add_column("Resources Pending Update") @@ -159,4 +162,4 @@ def dump_statistics(self, resources, save_as_json_file: bool = False): str(statistics["modules_count"]), str(statistics["providers_count"]) ) - Console(width=cs.CLI_WIDTH).print(table) + self._console.print(table) From 6107a1f768e73956337bf31a0b6c27763c8ea37e Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:23:23 +0100 Subject: [PATCH 29/34] test action --- infrapatch/core/composition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index b39658b..8e9e7b9 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -28,10 +28,10 @@ def build_main_handler(default_registry_domain: str, credentials_file_path: str class MainHandler: - def __init__(self, hcl_handler: HclHandler, registry_handler: RegistryHandler, Console: rich.Console): + def __init__(self, hcl_handler: HclHandler, registry_handler: RegistryHandler, console: Console): self.hcl_handler = hcl_handler self.registry_handler = registry_handler - self._console = Console + self._console = console def get_all_terraform_resources(self, project_root: Path) -> list[VersionedTerraformResource]: log.info(f"Searching for .tf files in {project_root.absolute().as_posix()} ...") From fc349706d76063daed5f3b5aabc3e285ec36d0bc Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:47:19 +0100 Subject: [PATCH 30/34] test action --- infrapatch/core/composition.py | 9 ++++++--- infrapatch/core/constants.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index 8e9e7b9..5632d8b 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -112,13 +112,16 @@ def _compose_resource_table(self, resources: list[VersionedTerraformResource], t title=title, expand=True ) - table.add_column("Name") - table.add_column("Current Version") - table.add_column("Newest Version") + table.add_column("Name", overflow="fold") + table.add_column("Source", overflow="fold") + table.add_column("Current") + table.add_column("Newest") table.add_column("Upgradeable") for resource in resources: + name = resource.identifier if isinstance(resource, TerraformProvider) else resource.name table.add_row( resource.name, + resource.source, resource.current_version, resource.newest_version, str(not resource.installed_version_equal_or_newer_than_new_version()) diff --git a/infrapatch/core/constants.py b/infrapatch/core/constants.py index 92a5987..98620b1 100644 --- a/infrapatch/core/constants.py +++ b/infrapatch/core/constants.py @@ -1,5 +1,5 @@ # Width of the cli interface -CLI_WIDTH = 130 +CLI_WIDTH = 160 # Name of this App. Used all over the place in the cli APP_NAME = "InfraPatch" From 2815f45d9a3470f0c910143b6ed5ed3e9a224024 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:55:28 +0100 Subject: [PATCH 31/34] test action --- infrapatch/core/composition.py | 1 - 1 file changed, 1 deletion(-) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index 5632d8b..2d91a2d 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -126,7 +126,6 @@ def _compose_resource_table(self, resources: list[VersionedTerraformResource], t resource.newest_version, str(not resource.installed_version_equal_or_newer_than_new_version()) ) - console = Console(width=cs.CLI_WIDTH) self._console.print(table) def dump_statistics(self, resources, save_as_json_file: bool = False): From ebda4eb43a15820099358a19b9e7ad9a5a18fdae Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:57:19 +0100 Subject: [PATCH 32/34] test action --- infrapatch/core/composition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index 2d91a2d..d30a518 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -103,7 +103,7 @@ def update_resources(self, resources: list[VersionedTerraformResource], confirm: continue if commit_changes: repo.index.add([resource.source_file.absolute().as_posix()]) - repo.index.commit(f"Updated {resource.resource_name} '{resource.name}' from version '{resource.current_version}' to '{resource.newest_version}'.") + repo.index.commit(f"Bump {resource.resource_name} '{resource.name}' from version '{resource.current_version}' to '{resource.newest_version}'.") resource.set_patched() return upgradable_resources From 312b742951a097fc88928adea1610ae75fdc7306 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 13:59:32 +0100 Subject: [PATCH 33/34] test action --- infrapatch/action/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index 21d53d1..083673b 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -50,8 +50,8 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str log.info("No upgradable resources found.") return - main_handler.update_resources(upgradable_resources, True, working_directory, True) main_handler.print_resource_table(upgradable_resources) + main_handler.update_resources(upgradable_resources, True, working_directory, True) main_handler.dump_statistics(upgradable_resources, save_as_json_file=True) push_changes(target_branch, working_directory) From 53b021a88558959f00804e9b1f3111312c5b2a82 Mon Sep 17 00:00:00 2001 From: Noahnc Date: Sun, 29 Oct 2023 14:06:02 +0100 Subject: [PATCH 34/34] test action --- .github/workflows/action_integration_test.yml | 1 + infrapatch/action/__main__.py | 1 - infrapatch/cli/cli.py | 11 +++++------ infrapatch/core/composition.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/action_integration_test.yml b/.github/workflows/action_integration_test.yml index be8b479..8228a1e 100644 --- a/.github/workflows/action_integration_test.yml +++ b/.github/workflows/action_integration_test.yml @@ -31,6 +31,7 @@ jobs: uses: ./ with: report_only: false + target_branch_name: "feat/infrapatch_test_${{ github.run_number }}" - name: Check update result shell: pwsh diff --git a/infrapatch/action/__main__.py b/infrapatch/action/__main__.py index 083673b..7658a1f 100644 --- a/infrapatch/action/__main__.py +++ b/infrapatch/action/__main__.py @@ -50,7 +50,6 @@ def main(debug: bool, default_registry_domain: str, registry_secrets_string: str log.info("No upgradable resources found.") return - main_handler.print_resource_table(upgradable_resources) main_handler.update_resources(upgradable_resources, True, working_directory, True) main_handler.dump_statistics(upgradable_resources, save_as_json_file=True) diff --git a/infrapatch/cli/cli.py b/infrapatch/cli/cli.py index 4c283dc..ed56178 100644 --- a/infrapatch/cli/cli.py +++ b/infrapatch/cli/cli.py @@ -14,7 +14,7 @@ from infrapatch.core.utils.hcl_handler import HclHandler from infrapatch.core.utils.registry_handler import RegistryHandler -main_handler = None +main_handler: MainHandler = None @click.group(invoke_without_command=True) @@ -48,15 +48,14 @@ def report(project_root: str, only_upgradable: bool, dump_json_statistics: bool) @main.command() -@click.option("project_root", "--project-root", default=None, - help="Root directory of the project. If not specified, the current working directory is used. If commit-changes is set, this has to be the root of a git repository.") +@click.option("project_root", "--project-root", default=None, help="Root directory of the project. If not specified, the current working directory is used.") @click.option("--confirm", is_flag=True, help="Apply changes without confirmation.") @click.option("--dump-json-statistics", is_flag=True, help="Creates a json file containing statistics about the updated resources in the cwd.") -@click.option("--commit-changes", is_flag=True, help="Commits the changes to a git repository.") @catch_exception(handle=Exception) -def update(project_root: str, confirm: bool, dump_json_statistics: bool, commit_changes: bool): +def update(project_root: str, confirm: bool, dump_json_statistics: bool): + """Finds all modules and providers in the project_root and updates them to the newest version.""" if project_root is None: project_root = Path.cwd() global main_handler resources = main_handler.get_all_terraform_resources(Path(project_root)) - main_handler.update_resources(resources, confirm, Path(project_root), commit_changes) + main_handler.update_resources(resources, confirm, Path(project_root)) main_handler.dump_statistics(resources, dump_json_statistics) diff --git a/infrapatch/core/composition.py b/infrapatch/core/composition.py index d30a518..f2bde81 100644 --- a/infrapatch/core/composition.py +++ b/infrapatch/core/composition.py @@ -89,8 +89,8 @@ def update_resources(self, resources: list[VersionedTerraformResource], confirm: if repo.bare: raise Exception("Working directory is not a git repository.") log.info(f"Committing changes to git branch '{repo.active_branch.name}'.") + self.print_resource_table(resources, True) if not confirm: - self.print_resource_table(resources, True) if not click.confirm("Do you want to apply the changes?"): print("Aborting...") return []