Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: terraform-ibm-modules/common-dev-assets
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2bb5809a121a141dc5354e976434957984976c76
Choose a base ref
...
head repository: terraform-ibm-modules/common-dev-assets
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b015de0299601ed8849ee4788aedb318b05d83d2
Choose a head ref
  • 6 commits
  • 7 files changed
  • 5 contributors

Commits on Dec 5, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b313171 View commit details
  2. Copy the full SHA
    d2b23a5 View commit details

Commits on Dec 6, 2023

  1. added ge ops and KP details (#830)

    * added ge ops and KP details
    
    * addressed review comments
    Ak-sky authored Dec 6, 2023
    Copy the full SHA
    3d9abe5 View commit details

Commits on Dec 8, 2023

  1. Copy the full SHA
    6f339c1 View commit details
  2. Copy the full SHA
    d5bdf01 View commit details

Commits on Dec 9, 2023

  1. Copy the full SHA
    b015de0 View commit details
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-06-02T23:10:06Z",
"generated_at": "2023-12-09T00:18:36Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
@@ -118,7 +118,7 @@
}
]
},
"version": "0.13.1+ibm.61.dss",
"version": "0.13.1+ibm.62.dss",
"word_list": {
"file": null,
"hash": null
5 changes: 0 additions & 5 deletions commitlint.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion common-go-assets/cloudinfo-region-secmgr-prefs.yaml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
useForTest: true
testPriority: 4
- name: eu-es
useForTest: true
useForTest: false # we do not have an increased quota for trial SM instances in this region
testPriority: 5
- name: eu-gb
useForTest: true
9 changes: 9 additions & 0 deletions common-go-assets/common-permanent-resources.yaml
Original file line number Diff line number Diff line change
@@ -69,3 +69,12 @@ imported_certificate_sm_region: "us-south"
imported_certificate_intermediate_secret_id: "1a5dba6b-eec7-578d-0973-26994233ab5c"
imported_certificate_public_secret_id: "029457f1-e9f6-ff13-4afa-ffe7f14d29bc"
imported_certificate_private_secret_id: "c54fb897-8737-46d3-d8f3-3b59fc32f38d"

# GE Ops Account Id
ge_ops_account_id: "9f9af00a96104f49b6509aa715f9d6a5" # pragma: allowlist secret

# GE Ops KP Instance and Root Keys
kp_us_south_guid: "44f9c10d-99f5-4547-9e9f-2a1c84b5f0a4"
kp_us_south_name: "perm-KP-base-ocp"
kp_us_south_rg: "Default"
kp_us_south_root_key_crn: "crn:v1:bluemix:public:kms:us-south:a/9f9af00a96104f49b6509aa715f9d6a5:44f9c10d-99f5-4547-9e9f-2a1c84b5f0a4:key:f6c9f6d0-92f6-437a-b97c-4b617cb3d320"
5 changes: 3 additions & 2 deletions module-assets/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ repos:
files: '\.tf'
# checkov (does not require checkov to be installed locally to run)
- repo: https://github.com/bridgecrewio/checkov.git
rev: 3.1.20
rev: 3.1.27
hooks:
- id: checkov
args:
@@ -87,7 +87,7 @@ repos:
- id: shellcheck
- id: go-fmt
- repo: https://github.com/ibm/detect-secrets
rev: 0.13.1+ibm.61.dss
rev: 0.13.1+ibm.62.dss
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline', '--fail-on-unaudited', '--use-all-plugins']
@@ -141,6 +141,7 @@ repos:
language: python
files: "README.md"
pass_filenames: true
always_run: true
- id: add_overview
name: Add overview section to README
description: Add overview section to README
4 changes: 2 additions & 2 deletions module-assets/ci/install-deps.sh
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ fi
#######################################

# renovate: datasource=github-tags depName=ibm/detect-secrets versioning="regex:^(?<compatibility>.*)-?(?<major>\\d+)\\.(?<minor>\\d+)\\+ibm\\.(?<patch>\\d+)\\.dss$"
DETECT_SECRETS_VERSION=0.13.1+ibm.61.dss
DETECT_SECRETS_VERSION=0.13.1+ibm.62.dss
PACKAGE=detect-secrets
set +e
INSTALLED_DECTECT_SECRETS="$(${PYTHON} -m pip show detect-secrets | grep Version: | cut -d' ' -f2)"
@@ -242,7 +242,7 @@ clean "${TMP_DIR}"
#######################################

# renovate: datasource=github-releases depName=gruntwork-io/terragrunt
TERRAGRUNT_VERSION=v0.53.8
TERRAGRUNT_VERSION=v0.54.0
BINARY=terragrunt
set +e
INSTALLED_TERRAGRUNT_VERSION="$(terragrunt --version | head -1 | cut -d' ' -f3)"
118 changes: 72 additions & 46 deletions module-assets/ci/terraformDocs.py
Original file line number Diff line number Diff line change
@@ -6,50 +6,76 @@

import terraformDocsUtils

for arg in sys.argv:
if arg == sys.argv[0]:
continue
else:
# only run terradocs on readme files with the metadata tags
if terraformDocsUtils.is_hook_exists(
"<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->", arg
):
# temp file
markdown = "tf-docs.md"

# change dir
cwd = os.getcwd()
if arg == "README.md":
dirname = cwd
else:
dirname = os.path.dirname(arg)
os.chdir(dirname)

# get terraform docs content
get_tf_docs_content_command = (
"terraform-docs --hide providers markdown table ."
)
proc = Popen(
get_tf_docs_content_command, stdout=PIPE, stderr=PIPE, shell=True
)
output, error = proc.communicate()

# store tf docs content into temp file and change headings from lvl 2 to lvl 3
with open(markdown, "w") as writer:
writer.write(output.decode("utf-8").strip().replace("##", "###"))

# hard fail if error
if proc.returncode != 0:
print(error)
terraformDocsUtils.remove_markdown(markdown)
os.chdir(cwd)
sys.exit(proc.returncode)

# add tf-docs.md content to README.md
os.system(
f"terraform-docs -c {cwd}/common-dev-assets/module-assets/.terraform-docs-config.yaml ."
)

# remove temp file

def modify_temp_markdown_files(temp_markdown):
# temp markdowns
markdown = "tf-docs.md"
temp_markdowns = []

# Find all previously generated temp markdowns and modify them
for root, dirnames, filenames in os.walk("."):
for name in filenames:
if name == temp_markdown:
# get full markdowns path
markdown_path = os.path.join(root, temp_markdown)
new_markdown_path = os.path.join(root, markdown)

# save all temp markdowns for later to be delete it
temp_markdowns.append(markdown_path)
temp_markdowns.append(new_markdown_path)

# change headings from lvl 2 to lvl 3 and save tf docs content into new temp file
with open(markdown_path, "rt") as reader:
with open(new_markdown_path, "wt") as writer:
for line in reader:
# recursive flag adds BEGIN_TF_DOCS and END_TF_DOCS metatags to a markdown content by default. We do not need this, since we have own metatag
if not ("BEGIN_TF_DOCS" in line or "END_TF_DOCS" in line):
writer.write(line.replace("##", "###"))
return temp_markdowns


def update_docs():
# if modules folder exists then use recursive flag to check for changes inside submodules
modules_exists = os.path.isdir("modules")

# temp markdown name
temp_markdown = "temp-tf-docs.md"

# create temp markdowns for all README tf docs
command = f"terraform-docs --hide providers markdown table {'--recursive' if modules_exists else ''} --output-file {temp_markdown} ."
proc = Popen(command, stdout=PIPE, stderr=PIPE, shell=True)
proc.communicate()

# hard fail if error
if proc.returncode != 0:
print(f"Error creating temp markdowns: {proc.communicate()[1]}")
sys.exit(proc.returncode)

# modify temp markdown files
temp_markdowns = modify_temp_markdown_files(temp_markdown)

# add temp markdown content to README files
command = f"terraform-docs -c common-dev-assets/module-assets/.terraform-docs-config.yaml {'--recursive ' if modules_exists else ''}."
proc = Popen(command, stdout=PIPE, stderr=PIPE, shell=True)
proc.communicate()

# hard fail if error
if proc.returncode != 0:
print(f"Error adding content to README: {proc.communicate()[1]}")
for markdown in temp_markdowns:
terraformDocsUtils.remove_markdown(markdown)
os.chdir(cwd)
sys.exit(proc.returncode)

# remove all temp markdowns
for markdown in temp_markdowns:
terraformDocsUtils.remove_markdown(markdown)


def main():
if terraformDocsUtils.is_hook_exists(
"<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->"
):
update_docs()


main()