diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index c589b4648841..526c4dbe0e63 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -6,6 +6,7 @@ _Released 06/06/2023 (PENDING)_ **Features:** - A new testing type switcher has been added to the Spec Explorer to make it easier to move between E2E and Component Testing. An informational overview of each type is displayed if it isn't configured in your project to help newcomers to each testing type. Addresses [#26448](https://github.com/cypress-io/cypress/issues/26448), [#26836](https://github.com/cypress-io/cypress/issues/26836) and [#26837](https://github.com/cypress-io/cypress/issues/26837). +- Added Buddy to the list of supported CI providers that maps to the Cloud. Addressed in [#26848](https://github.com/cypress-io/cypress/pull/26848). **Bugfixes:** diff --git a/packages/server/__snapshots__/cypress_spec.js b/packages/server/__snapshots__/cypress_spec.js index 8c19681367d7..651f682ff4b0 100644 --- a/packages/server/__snapshots__/cypress_spec.js +++ b/packages/server/__snapshots__/cypress_spec.js @@ -64,6 +64,7 @@ The ciBuildId is automatically detected if you are running Cypress in any of the - bamboo - bitbucket - buildkite + - buddy - circle - codeshipBasic - codeshipPro @@ -102,6 +103,7 @@ The ciBuildId is automatically detected if you are running Cypress in any of the - bamboo - bitbucket - buildkite + - buddy - circle - codeshipBasic - codeshipPro @@ -141,6 +143,7 @@ The ciBuildId is automatically detected if you are running Cypress in any of the - bamboo - bitbucket - buildkite + - buddy - circle - codeshipBasic - codeshipPro diff --git a/packages/server/lib/util/ci_provider.js b/packages/server/lib/util/ci_provider.js index 68cc80bea5c0..db7b3647d6a5 100644 --- a/packages/server/lib/util/ci_provider.js +++ b/packages/server/lib/util/ci_provider.js @@ -95,6 +95,7 @@ const CI_PROVIDERS = { 'bamboo': isBamboo, 'bitbucket': 'BITBUCKET_BUILD_NUMBER', 'buildkite': 'BUILDKITE', + 'buddy': 'BUDDY', 'circle': 'CIRCLECI', 'codeshipBasic': isCodeshipBasic, 'codeshipPro': isCodeshipPro, @@ -197,6 +198,17 @@ const _providerCiParams = () => { 'BUILDKITE_PULL_REQUEST_BASE_BRANCH', 'BUILDKITE_RETRY_COUNT', ]), + // All available vars + // https://buddy.works/docs/pipelines/environment-variables#default-environment-variables + buddy: extract([ + 'BUDDY_EXECUTION_ID', + 'BUDDY_PIPELINE_ID', + 'BUDDY_PROJECT_URL', + 'BUDDY_EXECUTION_URL', + 'BUDDY_EXECUTION_REVISION', + 'BUDDY_EXECUTION_REF', + 'BUDDY_INVOKER_NAME', + ]), circle: extract([ 'CIRCLE_JOB', 'CIRCLE_BUILD_NUM', @@ -491,6 +503,14 @@ const _providerCommitParams = () => { remoteOrigin: env.BUILDKITE_REPO, defaultBranch: env.BUILDKITE_PIPELINE_DEFAULT_BRANCH, }, + buddy: { + sha: env.BUDDY_EXECUTION_REVISION, + branch: env.BUDDY_EXECUTION_BRANCH, + authorName: env.BUDDY_EXECUTION_REVISION_COMMITTER_NAME, + authorEmail: env.BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL, + remoteOrigin: env.BUDDY_SCM_URL, + message: env.BUDDY_EXECUTION_REVISION_MESSAGE, + }, circle: { sha: env.CIRCLE_SHA1, branch: env.CIRCLE_BRANCH, diff --git a/packages/server/test/unit/util/ci_provider_spec.js b/packages/server/test/unit/util/ci_provider_spec.js index 892dd8bc0b59..8bc20801dc79 100644 --- a/packages/server/test/unit/util/ci_provider_spec.js +++ b/packages/server/test/unit/util/ci_provider_spec.js @@ -350,6 +350,46 @@ describe('lib/util/ci_provider', () => { }) }) + it('buddy', () => { + resetEnv = mockedEnv({ + BUDDY: 'true', + + BUDDY_PROJECT_URL: 'buddyProjectUrl', + BUDDY_EXECUTION_URL: 'buddyExecutionUrl', + BUDDY_EXECUTION_REVISION: 'buddyExecutionRevision', + BUDDY_EXECUTION_REF: 'buddyExecutionRef', + BUDDY_EXECUTION_ID: 'buddyExecutionId', + BUDDY_PIPELINE_ID: 'buddyPipelineId', + BUDDY_INVOKER_NAME: 'buddyInvokerName', + + BUDDY_EXECUTION_BRANCH: 'buddyExecutionBranch', + BUDDY_EXECUTION_REVISION_COMMITTER_NAME: 'buddyExecutionRevisionCommitterName', + BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL: 'buddyExecutionRevisionCommitterEmail', + BUDDY_SCM_URL: 'buddyScmUrl', + BUDDY_EXECUTION_REVISION_MESSAGE: 'buddyExecutionRevisionMessage', + }, { clear: true }) + + expectsName('buddy') + expectsCiParams({ + buddyProjectUrl: 'buddyProjectUrl', + buddyExecutionUrl: 'buddyExecutionUrl', + buddyExecutionRevision: 'buddyExecutionRevision', + buddyExecutionRef: 'buddyExecutionRef', + buddyExecutionId: 'buddyExecutionId', + buddyPipelineId: 'buddyPipelineId', + buddyInvokerName: 'buddyInvokerName', + }) + + expectsCommitParams({ + sha: 'buddyExecutionRevision', + branch: 'buddyExecutionBranch', + message: 'buddyExecutionRevisionMessage', + authorName: 'buddyExecutionRevisionCommitterName', + authorEmail: 'buddyExecutionRevisionCommitterEmail', + remoteOrigin: 'buddyScmUrl', + }) + }) + it('circle', () => { resetEnv = mockedEnv({ CIRCLECI: 'true',