diff --git a/.gitlab/ci/review-apps/main.gitlab-ci.yml b/.gitlab/ci/review-apps/main.gitlab-ci.yml index dde08b15bc3..22fdce71243 100644 --- a/.gitlab/ci/review-apps/main.gitlab-ci.yml +++ b/.gitlab/ci/review-apps/main.gitlab-ci.yml @@ -77,7 +77,7 @@ review-build-cng: variables: HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}" DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}" - GITLAB_HELM_CHART_REF: "41d7632d9eba84f5816d808b98ccf3f5623e9fb5" + GITLAB_HELM_CHART_REF: "a6a609a19166f00b1a7774374041cd38a9f7e20d" environment: name: review/${CI_COMMIT_REF_SLUG}${FREQUENCY} url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN} diff --git a/Gemfile.lock b/Gemfile.lock index d457aafc2ed..527ac45b101 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -963,7 +963,7 @@ GEM pyu-ruby-sasl (0.0.3.3) raabro (1.1.6) racc (1.6.0) - rack (2.2.3) + rack (2.2.3.1) rack-accept (0.4.5) rack (>= 0.4) rack-attack (6.3.0) diff --git a/app/assets/javascripts/vue_shared/components/runner_instructions/constants.js b/app/assets/javascripts/vue_shared/components/runner_instructions/constants.js index 34845e3d9e4..c97e191b630 100644 --- a/app/assets/javascripts/vue_shared/components/runner_instructions/constants.js +++ b/app/assets/javascripts/vue_shared/components/runner_instructions/constants.js @@ -1,7 +1,5 @@ import { s__ } from '~/locale'; -export const PLATFORMS_WITHOUT_ARCHITECTURES = ['docker', 'kubernetes']; - export const REGISTRATION_TOKEN_PLACEHOLDER = '$REGISTRATION_TOKEN'; export const INSTRUCTIONS_PLATFORMS_WITHOUT_ARCHITECTURES = { diff --git a/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue b/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue index 1236cd900d1..f65569b97b5 100644 --- a/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue +++ b/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue @@ -17,7 +17,6 @@ import { __, s__ } from '~/locale'; import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue'; import { INSTRUCTIONS_PLATFORMS_WITHOUT_ARCHITECTURES, - PLATFORMS_WITHOUT_ARCHITECTURES, REGISTRATION_TOKEN_PLACEHOLDER, } from './constants'; import getRunnerPlatformsQuery from './graphql/queries/get_runner_platforms.query.graphql'; @@ -60,20 +59,20 @@ export default { platforms: { query: getRunnerPlatformsQuery, update(data) { - return data?.runnerPlatforms?.nodes.map(({ name, humanReadableName, architectures }) => { - return { - name, - humanReadableName, - architectures: architectures?.nodes || [], - }; - }); + return ( + data?.runnerPlatforms?.nodes.map(({ name, humanReadableName, architectures }) => { + return { + name, + humanReadableName, + architectures: architectures?.nodes || [], + }; + }) ?? [] + ); }, result() { - if (this.platforms.length) { - // If it is set and available, select the defaultSelectedPlatform. - // Otherwise, select the first available platform - this.selectPlatform(this.defaultPlatform() || this.platforms[0]); - } + // If it is set and available, select the defaultSelectedPlatform. + // Otherwise, select the first available platform + this.selectPlatform(this.defaultPlatformName || this.platforms?.[0].name); }, error() { this.toggleAlert(true); @@ -86,8 +85,8 @@ export default { }, variables() { return { - platform: this.selectedPlatformName, - architecture: this.selectedArchitectureName || '', + platform: this.selectedPlatform, + architecture: this.selectedArchitecture || '', }; }, update(data) { @@ -109,26 +108,21 @@ export default { }; }, computed: { - platformsEmpty() { - return isEmpty(this.platforms); - }, instructionsEmpty() { return isEmpty(this.instructions); }, - selectedPlatformName() { - return this.selectedPlatform?.name; + architectures() { + return this.platforms.find(({ name }) => name === this.selectedPlatform)?.architectures || []; }, - selectedArchitectureName() { - return this.selectedArchitecture?.name; - }, - hasArchitecureList() { - return !PLATFORMS_WITHOUT_ARCHITECTURES.includes(this.selectedPlatformName); + binaryUrl() { + return this.architectures.find(({ name }) => name === this.selectedArchitecture) + ?.downloadLocation; }, instructionsWithoutArchitecture() { - return INSTRUCTIONS_PLATFORMS_WITHOUT_ARCHITECTURES[this.selectedPlatformName]?.instructions; + return INSTRUCTIONS_PLATFORMS_WITHOUT_ARCHITECTURES[this.selectedPlatform]?.instructions; }, runnerInstallationLink() { - return INSTRUCTIONS_PLATFORMS_WITHOUT_ARCHITECTURES[this.selectedPlatformName]?.link; + return INSTRUCTIONS_PLATFORMS_WITHOUT_ARCHITECTURES[this.selectedPlatform]?.link; }, registerInstructionsWithToken() { const { registerInstructions } = this.instructions || {}; @@ -139,7 +133,6 @@ export default { this.registrationToken, ); } - return registerInstructions; }, }, @@ -150,21 +143,17 @@ export default { focusSelected() { // By default the first platform always gets the focus, but when the `defaultPlatformName` // property is present, any other platform might actually be selected. - this.$refs[this.selectedPlatformName]?.[0].$el.focus(); + this.$refs[this.selectedPlatform]?.[0].$el.focus(); }, - defaultPlatform() { - return this.platforms.find((platform) => platform.name === this.defaultPlatformName); - }, - selectPlatform(platform) { - this.selectedPlatform = platform; + selectPlatform(platformName) { + this.selectedPlatform = platformName; // Update architecture when platform changes - const architectures = platform.architectures || []; - const arch = architectures.find(({ name }) => name === this.selectedArchitectureName); + const arch = this.architectures.find(({ name }) => name === this.selectedArchitecture); if (arch) { - this.selectArchitecture(arch); + this.selectArchitecture(arch.name); } else { - this.selectArchitecture(architectures[0]); + this.selectArchitecture(this.architectures[0]?.name); } }, selectArchitecture(architecture) { @@ -210,9 +199,9 @@ export default { {{ $options.i18n.fetchError }} - + -