Skip to content

Commit

Permalink
fix/redact axios headers (elastic#171803)
Browse files Browse the repository at this point in the history
Fix token things

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Ikuni17 and kibanamachine authored Nov 22, 2023
1 parent 92bc2a0 commit 17ed074
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline-utils/ci-stats/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class CiStatsClient {
headers: this.defaultHeaders,
});
} catch (error) {
console.error('CI Stats request error:', error);
console.error('CI Stats request error:', error?.response?.data?.message);

if (attempt < maxAttempts) {
const sec = attempt * 3;
Expand All @@ -210,7 +210,7 @@ export class CiStatsClient {
continue;
}

throw error;
throw new Error('Failed to connect to CI Stats.');
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions .buildkite/scripts/lifecycle/pre_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ if [[ "${GITHUB_BUILD_COMMIT_STATUS_ENABLED:-}" != "true" ]]; then
"$(dirname "${0}")/commit_status_start.sh"
fi

export CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"

ts-node "$(dirname "${0}")/ci_stats_start.ts"

Expand Down
12 changes: 6 additions & 6 deletions .buildkite/scripts/lifecycle/pre_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ EOF
{
CI_STATS_BUILD_ID="$(buildkite-agent meta-data get ci_stats_build_id --default '')"
export CI_STATS_BUILD_ID

CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_TOKEN

CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_HOST

if [[ "$CI_STATS_BUILD_ID" ]]; then
echo "CI Stats Build ID: $CI_STATS_BUILD_ID"

CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_TOKEN

CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"
export CI_STATS_HOST

KIBANA_CI_STATS_CONFIG=$(jq -n \
--arg buildId "$CI_STATS_BUILD_ID" \
--arg apiUrl "https://$CI_STATS_HOST" \
Expand Down

0 comments on commit 17ed074

Please sign in to comment.