TeamCity: archive debug logs if there are over 1000 of them #8507
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issues like in this build:
The plugin used for uploading artifacts to S3 has a limit of 1000 artifacts per build. After contacting JetBrains support they suggested archiving files as a solution. The downside to this is that this would make it harder to open specific artifacts in your web browser, instead you'd need to download the entire zip/tar file, open it and then find the logs file you want.
The compromise discussed in the team chat was to archive logs only if a build exceeds the limit. This PR introduces that behaviour.
Testing
I used this PR to create a test project in TeamCity for manual testing of the bash in the new build step. This PR has some commits from when I forced builds to create >1000 or <1000 debug*.txt files and then see how the new build step reacted.
When there are >=1000 artifacts present
This commit GoogleCloudPlatform/magic-modules@7b966a7 shows how I forced builds to look like they had >1000 debug logs.
Here's a build in TeamCity showing the outcome:
In step 1 >1000 debug files are made
In step 2
The result is the artifacts tab contains only that .tar.gz file:
When there are <1000 artifacts present
This build shows the opposite scenario, where I made the builds instead create only 10 debug files (GoogleCloudPlatform/magic-modules@bfbca51)
Step 2 now looks like this:
And the artifacts tab shows the 10 files unchanged:
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.
Derived from GoogleCloudPlatform/magic-modules#12083