Skip to content

Commit 1f2b6d6

Browse files
authored
Add version prefix to build status files (#22126)
1 parent a9d85e3 commit 1f2b6d6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

tools/ci_connector_ops/ci_connector_ops/qa_engine/inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def from_string(cls, string_value: Optional[str]) -> "BUILD_STATUSES":
3333

3434

3535
def get_connector_build_output_url(connector_technical_name: str, connector_version: str) -> str:
36-
return f"{CONNECTOR_BUILD_OUTPUT_URL}/{connector_technical_name}/{connector_version}.json"
36+
return f"{CONNECTOR_BUILD_OUTPUT_URL}/{connector_technical_name}/version-{connector_version}.json"
3737

3838
def fetch_latest_build_status_for_connector_version(connector_technical_name: str, connector_version: str) ->BUILD_STATUSES:
3939
"""Fetch the latest build status for a given connector version."""

tools/ci_connector_ops/tests/test_qa_engine/test_inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_fetch_latest_build_status_for_connector_version(mocker, connector_name,
121121
mock_get = mocker.patch.object(requests, 'get', return_value=mock_response)
122122

123123
assert inputs.fetch_latest_build_status_for_connector_version(connector_name, connector_version) == expected_status
124-
assert mock_get.call_args == call(f"{constants.CONNECTOR_BUILD_OUTPUT_URL}/{connector_name}/{connector_version}.json")
124+
assert mock_get.call_args == call(f"{constants.CONNECTOR_BUILD_OUTPUT_URL}/{connector_name}/version-{connector_version}.json")
125125

126126
def test_fetch_latest_build_status_for_connector_version_invalid_status(mocker, caplog):
127127
connector_name = "connectors/source-pokeapi"

tools/status/report.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fi
2222
BUCKET_WRITE_ROOT=/tmp/bucket_write_root
2323
LAST_TEN_ROOT=/tmp/last_ten_root
2424
SUMMARY_WRITE_ROOT=/tmp/summary_write_root
25+
VERSION_PREFIX="version-"
2526

2627
DOCKER_VERSION=$(get_connector_version "$CONNECTOR")
2728

@@ -65,8 +66,11 @@ function write_job_log() {
6566

6667
function pull_latest_job_logs() {
6768
# pull the logs for the latest ten jobs for this connector
69+
# note this is done by key as each log has a timestamp in the filename
70+
# ensuring that the version specific runs are filtered out.
6871
LAST_TEN_FILES=$(aws s3api list-objects-v2 --bucket "$BUCKET" \
69-
--query "reverse(sort_by(Contents[?contains(Key, \`tests/history/$CONNECTOR\`)], &LastModified))[:10].Key" \
72+
--prefix "tests/history/$CONNECTOR" \
73+
--query "reverse(sort_by(Contents[?!contains(Key, \`$VERSION_PREFIX\`)], &Key))[:10].Key" \
7074
--output=text)
7175

7276
rm -r $LAST_TEN_ROOT || true

0 commit comments

Comments
 (0)