From cc461c41d84acaf6faee41aba5ab15971ffa37df Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 15:27:13 +0200 Subject: [PATCH 01/34] feat(PL-PL-4367): add feature upload source map to Instana - do not exit in maps check --- .../upload_source_maps_to_instana.yml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/commands/upload_source_maps_to_instana.yml diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml new file mode 100644 index 0000000..3177e92 --- /dev/null +++ b/src/commands/upload_source_maps_to_instana.yml @@ -0,0 +1,56 @@ +description: > + Upload JS source maps to Instana APM + +parameters: + instana_endpoint: + default: "$INSTANA_ENDPOINT" + type: string + description: Instana API endpoint host + instana_api_token: + default: "$INSTANA_API_TOKEN" + type: string + description: Instana API token + # tenant: + # default: "trustedshops" + # description: "Tenant part in the Instana host name" + # type: string + # unit: + # description: "Unit part in the Instana host name, must match stage (dev, test or prod)" + # type: string + website_id: + description: "Website ID in Instana" + type: string + upload_config_id: + description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" + type: string + assets_path: + default: "dist/assets" + description: "Local path to the older containing JS files and its source maps" + type: string + javascript_url: + description: "Remote path to the folder containing JS files and its source maps" + type: string + steps: + - run: + name: Upload JS source maps toInstana + command: | + echo "########### JS files ##########" + ls -al << parameters.assets_path >>/*.js + echo "########### JS source map files ##########" + ls -al << parameters.assets_path >>/*.js.map + INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" + echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" + + for file in << parameters.assets_path >>/*.js; do + filename=$(basename "$file") + LOCAL_MAPFILE_LOCATION="<< parameters.assets_path >>/${filename}.map" + echo "LOCAL_MAPFILE_LOCATION=$LOCAL_MAPFILE_LOCATION" + JAVASCRIPT_URL="<< parameters.javascript_url >>/$filename" + echo "JAVASCRIPT_URL=$JAVASCRIPT_URL" + INSTANA_UPLOAD_COMMAND="curl -L -X PUT \"$INSTANA_API_UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JAVASCRIPT_URL\" -F \"sourceMap=@$LOCAL_MAPFILE_LOCATION\"" + eval "$INSTANA_UPLOAD_COMMAND" + done + # do not upload source maps TODO control by var? + rm -f << parameters.assets_path >>/*.js.map + echo "########### JS source map files must be removed ##########" + ls -al << parameters.assets_path >>/*.js.map || true From a5200318c78e48493d9d41fa37332e6e16c5ac23 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 15:45:43 +0200 Subject: [PATCH 02/34] feat(PL-PL-4367): add feature upload source map to Instana - check dist dir content --- src/commands/s3_sync.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/s3_sync.yml b/src/commands/s3_sync.yml index cdb2abd..8acdc87 100644 --- a/src/commands/s3_sync.yml +++ b/src/commands/s3_sync.yml @@ -37,4 +37,5 @@ steps: - run: name: Sync files to s3 bucket command: | + ls -al <> aws s3 sync --delete <> 's3://<><>' <> From cc36228e97281e6306c34bcea532523f153065cf Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 15:47:55 +0200 Subject: [PATCH 03/34] feat(PL-PL-4367): add feature upload source map to Instana - check dist dir content --- .../upload_source_maps_to_instana.yml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 3177e92..72b0678 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -30,27 +30,27 @@ parameters: javascript_url: description: "Remote path to the folder containing JS files and its source maps" type: string - steps: - - run: - name: Upload JS source maps toInstana - command: | - echo "########### JS files ##########" - ls -al << parameters.assets_path >>/*.js - echo "########### JS source map files ##########" - ls -al << parameters.assets_path >>/*.js.map - INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" - echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" - - for file in << parameters.assets_path >>/*.js; do - filename=$(basename "$file") - LOCAL_MAPFILE_LOCATION="<< parameters.assets_path >>/${filename}.map" - echo "LOCAL_MAPFILE_LOCATION=$LOCAL_MAPFILE_LOCATION" - JAVASCRIPT_URL="<< parameters.javascript_url >>/$filename" - echo "JAVASCRIPT_URL=$JAVASCRIPT_URL" - INSTANA_UPLOAD_COMMAND="curl -L -X PUT \"$INSTANA_API_UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JAVASCRIPT_URL\" -F \"sourceMap=@$LOCAL_MAPFILE_LOCATION\"" - eval "$INSTANA_UPLOAD_COMMAND" - done - # do not upload source maps TODO control by var? - rm -f << parameters.assets_path >>/*.js.map - echo "########### JS source map files must be removed ##########" - ls -al << parameters.assets_path >>/*.js.map || true +steps: + - run: + name: Upload JS source maps toInstana + command: | + echo "########### JS files ##########" + ls -al << parameters.assets_path >>/*.js + echo "########### JS source map files ##########" + ls -al << parameters.assets_path >>/*.js.map + INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" + echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" + + for file in << parameters.assets_path >>/*.js; do + filename=$(basename "$file") + LOCAL_MAPFILE_LOCATION="<< parameters.assets_path >>/${filename}.map" + echo "LOCAL_MAPFILE_LOCATION=$LOCAL_MAPFILE_LOCATION" + JAVASCRIPT_URL="<< parameters.javascript_url >>/$filename" + echo "JAVASCRIPT_URL=$JAVASCRIPT_URL" + INSTANA_UPLOAD_COMMAND="curl -L -X PUT \"$INSTANA_API_UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JAVASCRIPT_URL\" -F \"sourceMap=@$LOCAL_MAPFILE_LOCATION\"" + eval "$INSTANA_UPLOAD_COMMAND" + done + # do not upload source maps TODO control by var? + rm -f << parameters.assets_path >>/*.js.map + echo "########### JS source map files must be removed ##########" + ls -al << parameters.assets_path >>/*.js.map || true From 6687f0b4c08ef256161c9d808653d882cf96bc1d Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 15:48:49 +0200 Subject: [PATCH 04/34] feat(PL-PL-4367): add feature upload source map to Instana - check dist dir content --- src/commands/upload_source_maps_to_instana.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 72b0678..cfd9bf5 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -40,7 +40,6 @@ steps: ls -al << parameters.assets_path >>/*.js.map INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" - for file in << parameters.assets_path >>/*.js; do filename=$(basename "$file") LOCAL_MAPFILE_LOCATION="<< parameters.assets_path >>/${filename}.map" From e4b449d4a65e659b9a7ea9544981ed4d1280aa06 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 16:06:57 +0200 Subject: [PATCH 05/34] feat(PL-PL-4367): add feature upload source map to Instana - check dist/assets dir content --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index cfd9bf5..81f223b 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -52,4 +52,4 @@ steps: # do not upload source maps TODO control by var? rm -f << parameters.assets_path >>/*.js.map echo "########### JS source map files must be removed ##########" - ls -al << parameters.assets_path >>/*.js.map || true + ls -al << parameters.assets_path >>/assests/*.js.map || true From d28a4dcf2a0c6abbfa996d09602c44847ddda0ab Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 16:16:49 +0200 Subject: [PATCH 06/34] feat(PL-PL-4367): add feature upload source map to Instana - check dist/assets dir content --- src/commands/s3_sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/s3_sync.yml b/src/commands/s3_sync.yml index 8acdc87..18a1cda 100644 --- a/src/commands/s3_sync.yml +++ b/src/commands/s3_sync.yml @@ -37,5 +37,5 @@ steps: - run: name: Sync files to s3 bucket command: | - ls -al <> + ls -al <>/assets aws s3 sync --delete <> 's3://<><>' <> From 870cdd553445331032eb3e7c054f6e6298233ff4 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:34:39 +0200 Subject: [PATCH 07/34] feat(PL-PL-4367): add job with source map upload to Instana --- src/commands/s3_sync.yml | 1 - .../upload_source_maps_to_instana.yml | 83 ++++++----- ...ate_with_source_maps_upload_to_instana.yml | 129 ++++++++++++++++++ 3 files changed, 177 insertions(+), 36 deletions(-) create mode 100644 src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml diff --git a/src/commands/s3_sync.yml b/src/commands/s3_sync.yml index 18a1cda..cdb2abd 100644 --- a/src/commands/s3_sync.yml +++ b/src/commands/s3_sync.yml @@ -37,5 +37,4 @@ steps: - run: name: Sync files to s3 bucket command: | - ls -al <>/assets aws s3 sync --delete <> 's3://<><>' <> diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 81f223b..3cc7a37 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -17,39 +17,52 @@ parameters: # unit: # description: "Unit part in the Instana host name, must match stage (dev, test or prod)" # type: string - website_id: - description: "Website ID in Instana" - type: string - upload_config_id: - description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" - type: string - assets_path: - default: "dist/assets" - description: "Local path to the older containing JS files and its source maps" - type: string - javascript_url: - description: "Remote path to the folder containing JS files and its source maps" - type: string + website_id: + description: "Website ID in Instana" + type: string + upload_config_id: + description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" + type: string + assets_path: + default: "dist/assets" + description: "Local path to the folder containing JS files" + type: string + maps_path: + default: "source-maps" + description: "Local path to the folder containing JS source maps" + type: string + javascript_url: + description: "Remote path to the folder containing JS files" + type: string steps: - - run: - name: Upload JS source maps toInstana - command: | - echo "########### JS files ##########" - ls -al << parameters.assets_path >>/*.js - echo "########### JS source map files ##########" - ls -al << parameters.assets_path >>/*.js.map - INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" - echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" - for file in << parameters.assets_path >>/*.js; do - filename=$(basename "$file") - LOCAL_MAPFILE_LOCATION="<< parameters.assets_path >>/${filename}.map" - echo "LOCAL_MAPFILE_LOCATION=$LOCAL_MAPFILE_LOCATION" - JAVASCRIPT_URL="<< parameters.javascript_url >>/$filename" - echo "JAVASCRIPT_URL=$JAVASCRIPT_URL" - INSTANA_UPLOAD_COMMAND="curl -L -X PUT \"$INSTANA_API_UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JAVASCRIPT_URL\" -F \"sourceMap=@$LOCAL_MAPFILE_LOCATION\"" - eval "$INSTANA_UPLOAD_COMMAND" - done - # do not upload source maps TODO control by var? - rm -f << parameters.assets_path >>/*.js.map - echo "########### JS source map files must be removed ##########" - ls -al << parameters.assets_path >>/assests/*.js.map || true + - when: + condition: <> + steps: + - attach_workspace: + at: <> + - when: + condition: <> + steps: + - run: + name: Upload JS source maps toInstana + command: | + echo "########### JS files ##########" + ls -al << parameters.assets_path >>/*.js + if ls << parameters.assets_path >>/*.js.map >/dev/null 2>&1; then + echo "Error: << parameters.assets_path >>/*.js.map files still exist! Move them to the maps/ directory on the same level like your dist/ folder." + exit 1 + fi + echo "########### JS source map files ##########" + ls -al << parameters.maps_path >>/*.js.map + INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" + echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" + + for file in << parameters.assets_path >>/*.js; do + filename=$(basename "$file") + LOCAL_MAPFILE_LOCATION="<< parameters.maps_path >>/${filename}.map" + echo "LOCAL_MAPFILE_LOCATION=$LOCAL_MAPFILE_LOCATION" + JAVASCRIPT_URL="<< parameters.javascript_url >>/$filename" + echo "JAVASCRIPT_URL=$JAVASCRIPT_URL" + INSTANA_UPLOAD_COMMAND="curl -L -X PUT \"$INSTANA_API_UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JAVASCRIPT_URL\" -F \"sourceMap=@$LOCAL_MAPFILE_LOCATION\"" + eval "$INSTANA_UPLOAD_COMMAND" + done diff --git a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml new file mode 100644 index 0000000..e0e082e --- /dev/null +++ b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml @@ -0,0 +1,129 @@ +description: > + Upload JS source maps to Instana APM + +executor: default + +parameters: + distribution_id: + description: ID of cloudfront distribution + type: string + pattern: + description: Pattern to purge + type: string + default: "/*" + bucket_name: + description: Name of the bucket to sync files to + type: string + local: + description: Local path to sync + type: string + default: "dist/" + remote: + description: Remote path in s3 to sync + type: string + default: "" + additional_args: + default: "" + description: Additional arguments to pass to AWS cli + type: string + attach_workspace: + default: true + description: > + Boolean for whether or not to attach to an existing workspace. + type: boolean + checkout: + default: true + description: > + Boolean for whether or not to checkout sources + type: boolean + workspace_root: + default: . + description: > + Workspace root path that is either an absolute path or a path relative to the working directory. + type: string + aws_access_key_id: + type: env_var_name + description: aws access key id override + default: AWS_ACCESS_KEY_ID + aws_secret_access_key: + type: env_var_name + description: aws secret access key override + default: AWS_SECRET_ACCESS_KEY + aws_iam_web_identity_role_arn: + type: string + description: IAM role of web identity enabled role to access aws resources + default: "none" + aws_region: + type: env_var_name + description: aws region override + default: AWS_REGION + # Instana source maps upload + instana_endpoint: + default: "$INSTANA_ENDPOINT" + type: string + description: Instana API endpoint host + instana_api_token: + default: "$INSTANA_API_TOKEN" + type: string + description: Instana API token + # tenant: + # default: "trustedshops" + # description: "Tenant part in the Instana host name" + # type: string + # unit: + # description: "Unit part in the Instana host name, must match stage (dev, test or prod)" + # type: string + website_id: + description: "Website ID in Instana" + type: string + upload_config_id: + description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" + type: string + assets_path: + default: "dist/assets" + description: "Local path to the older containing JS files and its source maps" + type: string + javascript_url: + description: "Remote path to the folder containing JS files and its source maps" + type: string +steps: + - when: + condition: <> + steps: + - checkout + - unless: + condition: + and: + - equal: [ <>, "none" ] + steps: + - aws-cli/install + - aws-cli/assume_role_with_web_identity: + role_arn: <> + - when: + condition: + and: + - equal: [ <>, "none" ] + steps: + - aws-cli/setup: + aws_access_key_id: <> + aws_secret_access_key: <> + region: <> + - s3_sync: + bucket_name: <> + local: <> + remote: <> + attach_workspace: <> + workspace_root: <> + additional_args: <> + - cloudfront_invalidate: + distribution_id: <> + pattern: <> + - upload_source_maps_to_instana: + instana_endpoint: << parameters.instana_endpoint >> + instana_api_token: << parameters.instana_api_token >> + website_id: << parameters.website_id >> + upload_config_id: << parameters.upload_config_id >> + assets_path: << parameters.assets_path >> + javascript_url: << parameters.javascript_url >> + # TODO remove old uploads from Instana + From 12c3b92ec5970f626b4477d65b2f26e2e703785c Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:39:55 +0200 Subject: [PATCH 08/34] feat(PL-PL-4367): add job with source map upload to Instana - fix yaml --- .../upload_source_maps_to_instana.yml | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 3cc7a37..65b07cb 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -10,30 +10,23 @@ parameters: default: "$INSTANA_API_TOKEN" type: string description: Instana API token - # tenant: - # default: "trustedshops" - # description: "Tenant part in the Instana host name" - # type: string - # unit: - # description: "Unit part in the Instana host name, must match stage (dev, test or prod)" - # type: string - website_id: - description: "Website ID in Instana" - type: string - upload_config_id: - description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" - type: string - assets_path: - default: "dist/assets" - description: "Local path to the folder containing JS files" - type: string - maps_path: - default: "source-maps" - description: "Local path to the folder containing JS source maps" - type: string - javascript_url: - description: "Remote path to the folder containing JS files" - type: string + website_id: + description: "Website ID in Instana" + type: string + upload_config_id: + description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" + type: string + assets_path: + default: "dist/assets" + description: "Local path to the folder containing JS files" + type: string + maps_path: + default: "source-maps" + description: "Local path to the folder containing JS source maps" + type: string + javascript_url: + description: "Remote path to the folder containing JS files" + type: string steps: - when: condition: <> From 70e484d05874719f3c0274c7890f43a9d737c19f Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:41:21 +0200 Subject: [PATCH 09/34] feat(PL-PL-4367): add job with source map upload to Instana - add missing parameters --- src/commands/upload_source_maps_to_instana.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 65b07cb..a491d10 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -27,6 +27,15 @@ parameters: javascript_url: description: "Remote path to the folder containing JS files" type: string + attach_workspace: + default: true + description: > + Boolean for whether or not to attach to an existing workspace + type: boolean + workspace_root: + default: . + description: > + Workspace root path that is either an absolute path or a path relative to the working directory steps: - when: condition: <> From 713c7ac12dc8c0bf99782e3183938d0cfe7eb8b9 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:42:51 +0200 Subject: [PATCH 10/34] feat(PL-PL-4367): add job with source map upload to Instana - fix parameters --- src/commands/upload_source_maps_to_instana.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index a491d10..0979e98 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -36,6 +36,7 @@ parameters: default: . description: > Workspace root path that is either an absolute path or a path relative to the working directory + type: string steps: - when: condition: <> From 2bbd930cbb560312fb069c6a4e26b0a262b1e7f1 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:46:08 +0200 Subject: [PATCH 11/34] feat(PL-PL-4367): add job with source map upload to Instana - fix linting issues --- .../upload_source_maps_to_instana.yml | 19 +++++++++---------- ...ate_with_source_maps_upload_to_instana.yml | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 0979e98..2e81f9e 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -24,7 +24,7 @@ parameters: default: "source-maps" description: "Local path to the folder containing JS source maps" type: string - javascript_url: + JS_URL: description: "Remote path to the folder containing JS files" type: string attach_workspace: @@ -57,15 +57,14 @@ steps: fi echo "########### JS source map files ##########" ls -al << parameters.maps_path >>/*.js.map - INSTANA_API_UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" - echo "INSTANA_API_UPLOAD_ENDPOINT=$INSTANA_API_UPLOAD_ENDPOINT" - + UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" + echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" for file in << parameters.assets_path >>/*.js; do filename=$(basename "$file") - LOCAL_MAPFILE_LOCATION="<< parameters.maps_path >>/${filename}.map" - echo "LOCAL_MAPFILE_LOCATION=$LOCAL_MAPFILE_LOCATION" - JAVASCRIPT_URL="<< parameters.javascript_url >>/$filename" - echo "JAVASCRIPT_URL=$JAVASCRIPT_URL" - INSTANA_UPLOAD_COMMAND="curl -L -X PUT \"$INSTANA_API_UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JAVASCRIPT_URL\" -F \"sourceMap=@$LOCAL_MAPFILE_LOCATION\"" - eval "$INSTANA_UPLOAD_COMMAND" + MAP_LOCATION="<< parameters.maps_path >>/${filename}.map" + echo "MAP_LOCATION=$MAP_LOCATION" + JS_URL="<< parameters.JS_URL >>/$filename" + echo "JS_URL=$JS_URL" + UPLOAD_CMD="curl -L -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" + eval "$UPLOAD_CMD" done diff --git a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml index e0e082e..a67bb0d 100644 --- a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml +++ b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml @@ -126,4 +126,3 @@ steps: assets_path: << parameters.assets_path >> javascript_url: << parameters.javascript_url >> # TODO remove old uploads from Instana - From b469aa056f2980bc8d5fb81bd881ab4f67862faa Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:47:39 +0200 Subject: [PATCH 12/34] feat(PL-PL-4367): add job with source map upload to Instana - fix linting issues - 2 --- src/commands/upload_source_maps_to_instana.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 2e81f9e..f1ba5e0 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -24,7 +24,7 @@ parameters: default: "source-maps" description: "Local path to the folder containing JS source maps" type: string - JS_URL: + js_url: description: "Remote path to the folder containing JS files" type: string attach_workspace: @@ -63,7 +63,7 @@ steps: filename=$(basename "$file") MAP_LOCATION="<< parameters.maps_path >>/${filename}.map" echo "MAP_LOCATION=$MAP_LOCATION" - JS_URL="<< parameters.JS_URL >>/$filename" + JS_URL="<< parameters.js_url >>/$filename" echo "JS_URL=$JS_URL" UPLOAD_CMD="curl -L -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" eval "$UPLOAD_CMD" From 3716c6378dc7973ddeaa90196fd89a9a4cf3be84 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 17:48:40 +0200 Subject: [PATCH 13/34] feat(PL-PL-4367): add job with source map upload to Instana - fix cmd call --- .../sync_and_invalidate_with_source_maps_upload_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml index a67bb0d..a157891 100644 --- a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml +++ b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml @@ -124,5 +124,5 @@ steps: website_id: << parameters.website_id >> upload_config_id: << parameters.upload_config_id >> assets_path: << parameters.assets_path >> - javascript_url: << parameters.javascript_url >> + js_url: << parameters.javascript_url >> # TODO remove old uploads from Instana From a1f153547f66e111115a344a6adfca52b8b1e177 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Fri, 24 Oct 2025 18:16:30 +0200 Subject: [PATCH 14/34] feat(PL-PL-4367): add job with source map upload to Instana - check without attaching workspce --- .../upload_source_maps_to_instana.yml | 68 +++++++------------ ...ate_with_source_maps_upload_to_instana.yml | 11 ++- 2 files changed, 31 insertions(+), 48 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index f1ba5e0..7447905 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -13,8 +13,8 @@ parameters: website_id: description: "Website ID in Instana" type: string - upload_config_id: - description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" + upload_config_prefix: + description: "Upload configuration prefix in Instana, used for bulk cleanup of the old ones" type: string assets_path: default: "dist/assets" @@ -27,44 +27,28 @@ parameters: js_url: description: "Remote path to the folder containing JS files" type: string - attach_workspace: - default: true - description: > - Boolean for whether or not to attach to an existing workspace - type: boolean - workspace_root: - default: . - description: > - Workspace root path that is either an absolute path or a path relative to the working directory - type: string steps: - - when: - condition: <> - steps: - - attach_workspace: - at: <> - - when: - condition: <> - steps: - - run: - name: Upload JS source maps toInstana - command: | - echo "########### JS files ##########" - ls -al << parameters.assets_path >>/*.js - if ls << parameters.assets_path >>/*.js.map >/dev/null 2>&1; then - echo "Error: << parameters.assets_path >>/*.js.map files still exist! Move them to the maps/ directory on the same level like your dist/ folder." - exit 1 - fi - echo "########### JS source map files ##########" - ls -al << parameters.maps_path >>/*.js.map - UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" - echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" - for file in << parameters.assets_path >>/*.js; do - filename=$(basename "$file") - MAP_LOCATION="<< parameters.maps_path >>/${filename}.map" - echo "MAP_LOCATION=$MAP_LOCATION" - JS_URL="<< parameters.js_url >>/$filename" - echo "JS_URL=$JS_URL" - UPLOAD_CMD="curl -L -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" - eval "$UPLOAD_CMD" - done + - run: + name: Upload JS source maps to Instana + command: | + echo "########### JS files ##########" + ls -al << parameters.assets_path >>/*.js + if ls << parameters.assets_path >>/*.js.map >/dev/null 2>&1; then + echo "Error: << parameters.assets_path >>/*.js.map files still exist! Move them to the maps/ directory on the same level like your dist/ folder." + exit 1 + fi + echo "########### JS source map files ##########" + ls -al << parameters.maps_path >>/*.js.map + echo "TODO create new upload configuration for Instana" + UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" + echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" + for file in << parameters.assets_path >>/*.js; do + filename=$(basename "$file") + MAP_LOCATION="<< parameters.maps_path >>/${filename}.map" + echo "MAP_LOCATION=$MAP_LOCATION" + JS_URL="<< parameters.js_url >>/$filename" + echo "JS_URL=$JS_URL" + UPLOAD_CMD="curl -L -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" + eval "$UPLOAD_CMD" + done + echo "TODO remove old upload configurations from Instana" diff --git a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml index a157891..a2c30a9 100644 --- a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml +++ b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml @@ -76,8 +76,8 @@ parameters: website_id: description: "Website ID in Instana" type: string - upload_config_id: - description: "Upload configuration ID in Instana TODO use for bulk cleanup in the cache invalidation step?" + upload_config_prefix: + description: "Upload configuration prefix in Instana, used for bulk cleanup of the old ones" type: string assets_path: default: "dist/assets" @@ -115,9 +115,6 @@ steps: attach_workspace: <> workspace_root: <> additional_args: <> - - cloudfront_invalidate: - distribution_id: <> - pattern: <> - upload_source_maps_to_instana: instana_endpoint: << parameters.instana_endpoint >> instana_api_token: << parameters.instana_api_token >> @@ -125,4 +122,6 @@ steps: upload_config_id: << parameters.upload_config_id >> assets_path: << parameters.assets_path >> js_url: << parameters.javascript_url >> - # TODO remove old uploads from Instana + - cloudfront_invalidate: + distribution_id: <> + pattern: <> From 36d7ef4428dae16acc3e763d6d08b4f213cfc892 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 11:59:32 +0100 Subject: [PATCH 15/34] feat(PL-PL-4367): create upload file config if does not exist yet --- .../upload_source_maps_to_instana.yml | 30 +++++++++++++++---- ...ate_with_source_maps_upload_to_instana.yml | 10 ++++--- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 7447905..50115a6 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -13,8 +13,8 @@ parameters: website_id: description: "Website ID in Instana" type: string - upload_config_prefix: - description: "Upload configuration prefix in Instana, used for bulk cleanup of the old ones" + upload_config_name: + description: "Upload configuration name to be created and cleaned up before every upload" type: string assets_path: default: "dist/assets" @@ -31,16 +31,33 @@ steps: - run: name: Upload JS source maps to Instana command: | + # get all + GET_RESPONSE=$(curl -X GET "https://$UNIT-$TENANT.instana.io/api/website-monitoring/config/$WEBSITE_ID/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken $API_TOKEN") + echo $GET_RESPONSE + UPLOAD_CONFIG_ID=$(echo "$GET_RESPONSE" | jq -r '.configs[] | select(.description == "<< parameters.upload_config_name >>") | .id') + echo $UPLOAD_CONFIG_ID + # create config if not found + if [ -z "$UPLOAD_CONFIG_ID" ]; then + CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" + echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" + CREATION_BODY='{"description":"<< parameters.upload_config_name >>"}' + CREATION_CMD="curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST \"$CREATION_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -d \"$CREATION_BODY\"" + CREATION_RESPONSE=$("$CREATION_CMD" | jq -r '.id') + echo "CREATION_RESPONSE=$CREATION_RESPONSE" + UPLOAD_CONFIG_ID=$(echo "$CREATION_RESPONSE" | jq -r '.id') + echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" + fi + # upload files echo "########### JS files ##########" ls -al << parameters.assets_path >>/*.js if ls << parameters.assets_path >>/*.js.map >/dev/null 2>&1; then - echo "Error: << parameters.assets_path >>/*.js.map files still exist! Move them to the maps/ directory on the same level like your dist/ folder." + echo "Error: << parameters.assets_path >>/*.js.map files still exist! Move them to the << parameters.maps_path >>/ directory on the same level like your local path to sync." exit 1 fi echo "########### JS source map files ##########" ls -al << parameters.maps_path >>/*.js.map echo "TODO create new upload configuration for Instana" - UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/<< parameters.upload_config_id >>/form" + UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/form" echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" for file in << parameters.assets_path >>/*.js; do filename=$(basename "$file") @@ -48,7 +65,8 @@ steps: echo "MAP_LOCATION=$MAP_LOCATION" JS_URL="<< parameters.js_url >>/$filename" echo "JS_URL=$JS_URL" - UPLOAD_CMD="curl -L -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" - eval "$UPLOAD_CMD" + UPLOAD_CMD="curl -H "ContentType: multipart/form-data" -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" + UPLOAD_RESULT=$("$UPLOAD_CMD") + echo "UPLOAD_RESULT=$UPLOAD_RESULT" done echo "TODO remove old upload configurations from Instana" diff --git a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml index a2c30a9..d35a86c 100644 --- a/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml +++ b/src/jobs/sync_and_invalidate_with_source_maps_upload_to_instana.yml @@ -58,6 +58,10 @@ parameters: description: aws region override default: AWS_REGION # Instana source maps upload + bucket_key: + description: Name of the bucket key to distinguish between assets to be uploaded to the same bucket + type: string + default: "" instana_endpoint: default: "$INSTANA_ENDPOINT" type: string @@ -76,9 +80,6 @@ parameters: website_id: description: "Website ID in Instana" type: string - upload_config_prefix: - description: "Upload configuration prefix in Instana, used for bulk cleanup of the old ones" - type: string assets_path: default: "dist/assets" description: "Local path to the older containing JS files and its source maps" @@ -119,7 +120,8 @@ steps: instana_endpoint: << parameters.instana_endpoint >> instana_api_token: << parameters.instana_api_token >> website_id: << parameters.website_id >> - upload_config_id: << parameters.upload_config_id >> + # use bucket_name as upload_config_name + upload_config_name: "<< parameters.bucket_name >><< parameters.bucket_key>>" assets_path: << parameters.assets_path >> js_url: << parameters.javascript_url >> - cloudfront_invalidate: From 146d8afc1424d8c737c48bb9cd2803e9059176f3 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:11:16 +0100 Subject: [PATCH 16/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then --- src/commands/upload_source_maps_to_instana.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 50115a6..0e21e93 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -47,6 +47,22 @@ steps: UPLOAD_CONFIG_ID=$(echo "$CREATION_RESPONSE" | jq -r '.id') echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" fi + if [ -z "$UPLOAD_CONFIG_ID" ]; then + echo "UPLOAD_CONFIG_ID is empty!" + exit 1 + fi + # clear uploads + CLEAR_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/clear" + echo "CLEAR_ENDPOINT=$CLEAR_ENDPOINT" + CLEAR_CMD="curl -s -o /dev/null -w -X PUT $CLEAR_ENDPOINT -H \"authorization: apiToken << parameters.instana_api_token >>\"" + CLEAR_RESPONSE_CODE=$("$CLEAR_CMD") + echo "CLEAR_RESPONSE_CODE=$CLEAR_RESPONSE_CODE" + if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then + echo "Request to clear source map files was successful." + else + echo "Request to clear source map files failed with status code: $CLEAR_RESPONSE_CODE" + exit 1 + fi # upload files echo "########### JS files ##########" ls -al << parameters.assets_path >>/*.js From cb32821a3d5404f805ee5af6e55334e0143b7bb7 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:14:15 +0100 Subject: [PATCH 17/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then --- src/commands/upload_source_maps_to_instana.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 0e21e93..2cae3d6 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -41,8 +41,8 @@ steps: CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" CREATION_BODY='{"description":"<< parameters.upload_config_name >>"}' - CREATION_CMD="curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST \"$CREATION_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -d \"$CREATION_BODY\"" - CREATION_RESPONSE=$("$CREATION_CMD" | jq -r '.id') + CREATION_CMD="-X POST \"$CREATION_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -d \"$CREATION_BODY\"" + CREATION_RESPONSE=$("curl -H "Content-Type: application/json" -H "Accept: application/json" $CREATION_CMD") echo "CREATION_RESPONSE=$CREATION_RESPONSE" UPLOAD_CONFIG_ID=$(echo "$CREATION_RESPONSE" | jq -r '.id') echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" From e65b09462e416529577ac869025b7eda81f49c4d Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:17:37 +0100 Subject: [PATCH 18/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then --- src/commands/upload_source_maps_to_instana.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 2cae3d6..de07257 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -54,7 +54,7 @@ steps: # clear uploads CLEAR_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/clear" echo "CLEAR_ENDPOINT=$CLEAR_ENDPOINT" - CLEAR_CMD="curl -s -o /dev/null -w -X PUT $CLEAR_ENDPOINT -H \"authorization: apiToken << parameters.instana_api_token >>\"" + CLEAR_CMD="curl -s -o /dev/null -w -X PUT "$CLEAR_ENDPOINT" -H "authorization: apiToken << parameters.instana_api_token >>" CLEAR_RESPONSE_CODE=$("$CLEAR_CMD") echo "CLEAR_RESPONSE_CODE=$CLEAR_RESPONSE_CODE" if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then @@ -81,8 +81,8 @@ steps: echo "MAP_LOCATION=$MAP_LOCATION" JS_URL="<< parameters.js_url >>/$filename" echo "JS_URL=$JS_URL" - UPLOAD_CMD="curl -H "ContentType: multipart/form-data" -X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" - UPLOAD_RESULT=$("$UPLOAD_CMD") + UPLOAD_CMD="-X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" + UPLOAD_RESULT=$(curl -H "ContentType: multipart/form-data" "$UPLOAD_CMD") echo "UPLOAD_RESULT=$UPLOAD_RESULT" done echo "TODO remove old upload configurations from Instana" From ae702c4873a687136a48adda29f19ede3c028b39 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:19:30 +0100 Subject: [PATCH 19/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then --- src/commands/upload_source_maps_to_instana.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index de07257..e38a442 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -57,9 +57,9 @@ steps: CLEAR_CMD="curl -s -o /dev/null -w -X PUT "$CLEAR_ENDPOINT" -H "authorization: apiToken << parameters.instana_api_token >>" CLEAR_RESPONSE_CODE=$("$CLEAR_CMD") echo "CLEAR_RESPONSE_CODE=$CLEAR_RESPONSE_CODE" - if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then + if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then echo "Request to clear source map files was successful." - else + else echo "Request to clear source map files failed with status code: $CLEAR_RESPONSE_CODE" exit 1 fi From 821c5a21adc8de4a4dfdb40d6488ba8a9a657749 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:28:13 +0100 Subject: [PATCH 20/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - fix host --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index e38a442..632bcf7 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -32,7 +32,7 @@ steps: name: Upload JS source maps to Instana command: | # get all - GET_RESPONSE=$(curl -X GET "https://$UNIT-$TENANT.instana.io/api/website-monitoring/config/$WEBSITE_ID/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken $API_TOKEN") + GET_RESPONSE=$(curl -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/$WEBSITE_ID/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken $API_TOKEN") echo $GET_RESPONSE UPLOAD_CONFIG_ID=$(echo "$GET_RESPONSE" | jq -r '.configs[] | select(.description == "<< parameters.upload_config_name >>") | .id') echo $UPLOAD_CONFIG_ID From d436f773941bae2c0c8b4c87f662ef90cab23cc2 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:37:08 +0100 Subject: [PATCH 21/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - replace env vars with params --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 632bcf7..2f38de7 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -32,7 +32,7 @@ steps: name: Upload JS source maps to Instana command: | # get all - GET_RESPONSE=$(curl -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/$WEBSITE_ID/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken $API_TOKEN") + GET_RESPONSE=$(curl -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken << parameters.instana_api_token >>") echo $GET_RESPONSE UPLOAD_CONFIG_ID=$(echo "$GET_RESPONSE" | jq -r '.configs[] | select(.description == "<< parameters.upload_config_name >>") | .id') echo $UPLOAD_CONFIG_ID From 3fd44d0b208908015461d7961950835e662df85f Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:47:16 +0100 Subject: [PATCH 22/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - fix creation command --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 2f38de7..f941189 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -42,7 +42,7 @@ steps: echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" CREATION_BODY='{"description":"<< parameters.upload_config_name >>"}' CREATION_CMD="-X POST \"$CREATION_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -d \"$CREATION_BODY\"" - CREATION_RESPONSE=$("curl -H "Content-Type: application/json" -H "Accept: application/json" $CREATION_CMD") + CREATION_RESPONSE=$(curl -H "Content-Type: application/json" -H "Accept: application/json" "$CREATION_CMD") echo "CREATION_RESPONSE=$CREATION_RESPONSE" UPLOAD_CONFIG_ID=$(echo "$CREATION_RESPONSE" | jq -r '.id') echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" From ee359b8f2a0a9f1cdc9289445762b960942a30f3 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 12:59:16 +0100 Subject: [PATCH 23/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - troubleshooting creation command --- src/commands/upload_source_maps_to_instana.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index f941189..06f543e 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -41,8 +41,9 @@ steps: CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" CREATION_BODY='{"description":"<< parameters.upload_config_name >>"}' - CREATION_CMD="-X POST \"$CREATION_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -d \"$CREATION_BODY\"" - CREATION_RESPONSE=$(curl -H "Content-Type: application/json" -H "Accept: application/json" "$CREATION_CMD") + CREATION_CMD="curl -H \"Content-Type: application/json\" -X POST \"$CREATION_ENDPOINT\" -d \"$CREATION_BODY\"" + echo "CREATION_CMD=$CREATION_CMD" + CREATION_RESPONSE=$("$CREATION_CMD" -H "authorization: apiToken << parameters.instana_api_token >>") echo "CREATION_RESPONSE=$CREATION_RESPONSE" UPLOAD_CONFIG_ID=$(echo "$CREATION_RESPONSE" | jq -r '.id') echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" From 0651906c2b8af478292cccd8dbaf8cfc9e780bdd Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 13:14:34 +0100 Subject: [PATCH 24/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - troubleshooting creation command - 2 --- src/commands/upload_source_maps_to_instana.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 06f543e..a49ad36 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -40,8 +40,8 @@ steps: if [ -z "$UPLOAD_CONFIG_ID" ]; then CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" - CREATION_BODY='{"description":"<< parameters.upload_config_name >>"}' - CREATION_CMD="curl -H \"Content-Type: application/json\" -X POST \"$CREATION_ENDPOINT\" -d \"$CREATION_BODY\"" + CREATION_BODY="{\"description\":\"<< parameters.upload_config_name >>\"}" + CREATION_CMD="curl -X POST \"$CREATION_ENDPOINT\" -d \"$CREATION_BODY\"" echo "CREATION_CMD=$CREATION_CMD" CREATION_RESPONSE=$("$CREATION_CMD" -H "authorization: apiToken << parameters.instana_api_token >>") echo "CREATION_RESPONSE=$CREATION_RESPONSE" From dfff78ef06c9172d43c74038628e729b716c1f16 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 13:24:13 +0100 Subject: [PATCH 25/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - troubleshooting creation command - 3 --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index a49ad36..b8d174f 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -41,7 +41,7 @@ steps: CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" CREATION_BODY="{\"description\":\"<< parameters.upload_config_name >>\"}" - CREATION_CMD="curl -X POST \"$CREATION_ENDPOINT\" -d \"$CREATION_BODY\"" + CREATION_CMD="curl -X POST $CREATION_ENDPOINT -d \'$CREATION_BODY\'" echo "CREATION_CMD=$CREATION_CMD" CREATION_RESPONSE=$("$CREATION_CMD" -H "authorization: apiToken << parameters.instana_api_token >>") echo "CREATION_RESPONSE=$CREATION_RESPONSE" From d77675b315bc709afdcdbafe013816f008e44b92 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 13:33:11 +0100 Subject: [PATCH 26/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - troubleshooting creation command - 4 --- src/commands/upload_source_maps_to_instana.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index b8d174f..6ec0fca 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -40,8 +40,7 @@ steps: if [ -z "$UPLOAD_CONFIG_ID" ]; then CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" - CREATION_BODY="{\"description\":\"<< parameters.upload_config_name >>\"}" - CREATION_CMD="curl -X POST $CREATION_ENDPOINT -d \'$CREATION_BODY\'" + CREATION_CMD="curl -X POST $CREATION_ENDPOINT -d '{\"description\":\"<< parameters.upload_config_name >>\"}'" echo "CREATION_CMD=$CREATION_CMD" CREATION_RESPONSE=$("$CREATION_CMD" -H "authorization: apiToken << parameters.instana_api_token >>") echo "CREATION_RESPONSE=$CREATION_RESPONSE" From fe471b08f3eca8ddc6f90d6a08c49b848f064ceb Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 13:53:53 +0100 Subject: [PATCH 27/34] feat(PL-PL-4367): create upload file config if does not exist yet and clear then - troubleshooting creation command - 5 --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 6ec0fca..3a3b227 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -40,7 +40,7 @@ steps: if [ -z "$UPLOAD_CONFIG_ID" ]; then CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" - CREATION_CMD="curl -X POST $CREATION_ENDPOINT -d '{\"description\":\"<< parameters.upload_config_name >>\"}'" + CREATION_CMD="curl -X POST $CREATION_ENDPOINT -H \"Content-Type: application/json\" -H \"Accept: application/json\" -d '{\"description\":\"<< parameters.upload_config_name >>\"}'" echo "CREATION_CMD=$CREATION_CMD" CREATION_RESPONSE=$("$CREATION_CMD" -H "authorization: apiToken << parameters.instana_api_token >>") echo "CREATION_RESPONSE=$CREATION_RESPONSE" From d31831171bc100ab35abb0b91c6701e064755904 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 14:12:29 +0100 Subject: [PATCH 28/34] feat(PL-PL-4367): fix clear command --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 3a3b227..aad08d6 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -54,7 +54,7 @@ steps: # clear uploads CLEAR_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/clear" echo "CLEAR_ENDPOINT=$CLEAR_ENDPOINT" - CLEAR_CMD="curl -s -o /dev/null -w -X PUT "$CLEAR_ENDPOINT" -H "authorization: apiToken << parameters.instana_api_token >>" + CLEAR_CMD="curl -s -o /dev/null -w -X PUT "$CLEAR_ENDPOINT" -H \"authorization: apiToken << parameters.instana_api_token >>\"" CLEAR_RESPONSE_CODE=$("$CLEAR_CMD") echo "CLEAR_RESPONSE_CODE=$CLEAR_RESPONSE_CODE" if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then From 6b48fb5f2e10824860f923b24180eef6b42c2411 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Sun, 26 Oct 2025 18:57:45 +0100 Subject: [PATCH 29/34] feat(PL-PL-4367): fix clear command - 2 --- src/commands/upload_source_maps_to_instana.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index aad08d6..e26ec92 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -54,13 +54,13 @@ steps: # clear uploads CLEAR_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/clear" echo "CLEAR_ENDPOINT=$CLEAR_ENDPOINT" - CLEAR_CMD="curl -s -o /dev/null -w -X PUT "$CLEAR_ENDPOINT" -H \"authorization: apiToken << parameters.instana_api_token >>\"" + CLEAR_CMD="curl -o /dev/null -s -w \"%{http_code}\\n\" -X PUT $CLEAR_ENDPOINT -H \"authorization: apiToken << parameters.instana_api_token >>\"" CLEAR_RESPONSE_CODE=$("$CLEAR_CMD") echo "CLEAR_RESPONSE_CODE=$CLEAR_RESPONSE_CODE" if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then - echo "Request to clear source map files was successful." + echo "Request to clear source map files for << parameters.upload_config_name >> was successful." else - echo "Request to clear source map files failed with status code: $CLEAR_RESPONSE_CODE" + echo "Request to clear source map files for << parameters.upload_config_name >> failed with status code: $CLEAR_RESPONSE_CODE" exit 1 fi # upload files @@ -72,7 +72,6 @@ steps: fi echo "########### JS source map files ##########" ls -al << parameters.maps_path >>/*.js.map - echo "TODO create new upload configuration for Instana" UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/form" echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" for file in << parameters.assets_path >>/*.js; do @@ -85,4 +84,3 @@ steps: UPLOAD_RESULT=$(curl -H "ContentType: multipart/form-data" "$UPLOAD_CMD") echo "UPLOAD_RESULT=$UPLOAD_RESULT" done - echo "TODO remove old upload configurations from Instana" From 64f954a57c9d77ce7cb5930d174fe17d12e0122f Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Mon, 27 Oct 2025 10:30:15 +0100 Subject: [PATCH 30/34] feat(PL-PL-4367): take over tested command --- .../upload_source_maps_to_instana.yml | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index e26ec92..fe97ee0 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -31,31 +31,29 @@ steps: - run: name: Upload JS source maps to Instana command: | - # get all - GET_RESPONSE=$(curl -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken << parameters.instana_api_token >>") - echo $GET_RESPONSE + # get all file upload configurations for the website + GET_RESPONSE=$(curl -s -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken << parameters.instana_api_token >>") + echo "File Upload configurations for website ID << parameters.website_id >> : $GET_RESPONSE" UPLOAD_CONFIG_ID=$(echo "$GET_RESPONSE" | jq -r '.configs[] | select(.description == "<< parameters.upload_config_name >>") | .id') - echo $UPLOAD_CONFIG_ID # create config if not found if [ -z "$UPLOAD_CONFIG_ID" ]; then + echo "No file upload configuration << parameters.upload_config_name >> was found, so creating a new one..." CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" - echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" - CREATION_CMD="curl -X POST $CREATION_ENDPOINT -H \"Content-Type: application/json\" -H \"Accept: application/json\" -d '{\"description\":\"<< parameters.upload_config_name >>\"}'" - echo "CREATION_CMD=$CREATION_CMD" - CREATION_RESPONSE=$("$CREATION_CMD" -H "authorization: apiToken << parameters.instana_api_token >>") + # echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" + CREATION_RESPONSE=$(curl -s -X POST $CREATION_ENDPOINT -H "Content-Type: application/json" -H "Accept: application/json" -d '{"description": "<< parameters.upload_config_name >>"}' -H "authorization: apiToken << parameters.instana_api_token >>") echo "CREATION_RESPONSE=$CREATION_RESPONSE" UPLOAD_CONFIG_ID=$(echo "$CREATION_RESPONSE" | jq -r '.id') - echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" fi if [ -z "$UPLOAD_CONFIG_ID" ]; then - echo "UPLOAD_CONFIG_ID is empty!" + echo "Error: UPLOAD_CONFIG_ID is still empty!" exit 1 + else + echo "UPLOAD_CONFIG_ID=$UPLOAD_CONFIG_ID" fi # clear uploads CLEAR_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/clear" - echo "CLEAR_ENDPOINT=$CLEAR_ENDPOINT" - CLEAR_CMD="curl -o /dev/null -s -w \"%{http_code}\\n\" -X PUT $CLEAR_ENDPOINT -H \"authorization: apiToken << parameters.instana_api_token >>\"" - CLEAR_RESPONSE_CODE=$("$CLEAR_CMD") + # echo "CLEAR_ENDPOINT=$CLEAR_ENDPOINT" + CLEAR_RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}\n" -X PUT $CLEAR_ENDPOINT -H "authorization: apiToken << parameters.instana_api_token >>") echo "CLEAR_RESPONSE_CODE=$CLEAR_RESPONSE_CODE" if [ "$CLEAR_RESPONSE_CODE" -eq 204 ]; then echo "Request to clear source map files for << parameters.upload_config_name >> was successful." @@ -73,14 +71,12 @@ steps: echo "########### JS source map files ##########" ls -al << parameters.maps_path >>/*.js.map UPLOAD_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload/$UPLOAD_CONFIG_ID/form" - echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" + # echo "UPLOAD_ENDPOINT=$UPLOAD_ENDPOINT" for file in << parameters.assets_path >>/*.js; do filename=$(basename "$file") MAP_LOCATION="<< parameters.maps_path >>/${filename}.map" - echo "MAP_LOCATION=$MAP_LOCATION" JS_URL="<< parameters.js_url >>/$filename" - echo "JS_URL=$JS_URL" - UPLOAD_CMD="-X PUT \"$UPLOAD_ENDPOINT\" -H \"authorization: apiToken << parameters.instana_api_token >>\" -F \"url=$JS_URL\" -F \"sourceMap=@$MAP_LOCATION\"" - UPLOAD_RESULT=$(curl -H "ContentType: multipart/form-data" "$UPLOAD_CMD") + echo "JS_URL=$JS_URL \nMAP_LOCATION=$MAP_LOCATION" + UPLOAD_RESULT=$(curl -s -X PUT "$UPLOAD_ENDPOINT" -H "authorization: apiToken << parameters.instana_api_token >>" -F "url=$JS_URL" -F "sourceMap=@$MAP_LOCATION" -H "ContentType: multipart/form-data") echo "UPLOAD_RESULT=$UPLOAD_RESULT" done From b3a3bd92cd5cd4f08006ba76f8d25c5d9ec89f90 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Mon, 27 Oct 2025 10:37:46 +0100 Subject: [PATCH 31/34] feat(PL-PL-4367): take over tested command - fix lintinng issue --- src/commands/upload_source_maps_to_instana.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index fe97ee0..593690b 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -30,6 +30,7 @@ parameters: steps: - run: name: Upload JS source maps to Instana + # yamllint disable-line rule:line-length command: | # get all file upload configurations for the website GET_RESPONSE=$(curl -s -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken << parameters.instana_api_token >>") @@ -80,3 +81,4 @@ steps: UPLOAD_RESULT=$(curl -s -X PUT "$UPLOAD_ENDPOINT" -H "authorization: apiToken << parameters.instana_api_token >>" -F "url=$JS_URL" -F "sourceMap=@$MAP_LOCATION" -H "ContentType: multipart/form-data") echo "UPLOAD_RESULT=$UPLOAD_RESULT" done + # yamllint enable rule:line-length From 4df957c44e9492978d1092e4bfbbb5d88ee069b5 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Mon, 27 Oct 2025 10:42:54 +0100 Subject: [PATCH 32/34] feat(PL-PL-4367): take over tested command - fix linting issue --- .yamllint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamllint b/.yamllint index d48c2d3..1a5f8c8 100644 --- a/.yamllint +++ b/.yamllint @@ -2,5 +2,5 @@ extends: relaxed rules: line-length: - max: 200 + max: 300 allow-non-breakable-inline-mappings: true From 8138004f9869c38b967ebcc09215d40edb372f95 Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Mon, 27 Oct 2025 10:43:44 +0100 Subject: [PATCH 33/34] feat(PL-PL-4367): take over tested command - fix linting issue --- .yamllint | 2 +- src/commands/upload_source_maps_to_instana.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.yamllint b/.yamllint index 1a5f8c8..573e22b 100644 --- a/.yamllint +++ b/.yamllint @@ -2,5 +2,5 @@ extends: relaxed rules: line-length: - max: 300 + max: 260 allow-non-breakable-inline-mappings: true diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index 593690b..fe97ee0 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -30,7 +30,6 @@ parameters: steps: - run: name: Upload JS source maps to Instana - # yamllint disable-line rule:line-length command: | # get all file upload configurations for the website GET_RESPONSE=$(curl -s -X GET "https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" -H "Accept: application/json" -H "Authorization: apiToken << parameters.instana_api_token >>") @@ -81,4 +80,3 @@ steps: UPLOAD_RESULT=$(curl -s -X PUT "$UPLOAD_ENDPOINT" -H "authorization: apiToken << parameters.instana_api_token >>" -F "url=$JS_URL" -F "sourceMap=@$MAP_LOCATION" -H "ContentType: multipart/form-data") echo "UPLOAD_RESULT=$UPLOAD_RESULT" done - # yamllint enable rule:line-length From 4f1ec479d22135bda94cf763ed3ad4b7a1d7388e Mon Sep 17 00:00:00 2001 From: Valerij Timofeev Date: Mon, 27 Oct 2025 10:58:27 +0100 Subject: [PATCH 34/34] feat(PL-PL-4367): take over tested command - fix linting issue --- src/commands/upload_source_maps_to_instana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/upload_source_maps_to_instana.yml b/src/commands/upload_source_maps_to_instana.yml index fe97ee0..40deac6 100644 --- a/src/commands/upload_source_maps_to_instana.yml +++ b/src/commands/upload_source_maps_to_instana.yml @@ -37,7 +37,7 @@ steps: UPLOAD_CONFIG_ID=$(echo "$GET_RESPONSE" | jq -r '.configs[] | select(.description == "<< parameters.upload_config_name >>") | .id') # create config if not found if [ -z "$UPLOAD_CONFIG_ID" ]; then - echo "No file upload configuration << parameters.upload_config_name >> was found, so creating a new one..." + echo "No file upload configuration << parameters.upload_config_name >> was found, so creating a new one..." CREATION_ENDPOINT="https://<< parameters.instana_endpoint >>/api/website-monitoring/config/<< parameters.website_id >>/sourcemap-upload" # echo "CREATION_ENDPOINT=$CREATION_ENDPOINT" CREATION_RESPONSE=$(curl -s -X POST $CREATION_ENDPOINT -H "Content-Type: application/json" -H "Accept: application/json" -d '{"description": "<< parameters.upload_config_name >>"}' -H "authorization: apiToken << parameters.instana_api_token >>")