diff --git a/.github/actions/e2e-run/action.yml b/.github/actions/e2e-run/action.yml index fae37adeec..e6bdb40ae4 100644 --- a/.github/actions/e2e-run/action.yml +++ b/.github/actions/e2e-run/action.yml @@ -17,6 +17,10 @@ inputs: description: 'The NPM Registry to use' required: false default: 'https://registry.npmjs.org/' + jestFlags: + description: 'Flags for Jest' + required: false + default: '' runs: using: composite @@ -61,7 +65,7 @@ runs: shell: bash if: ${{inputs.os == 'windows-latest'}} working-directory: packages/cli-e2e - run: npm run jest:ci -- ${{inputs.spec}} + run: npm run jest:ci -- ${{inputs.spec}} ${{inputs.flag}} env: npm_config_registry: ${{inputs.npmRegistry}} - name: Tests @@ -71,7 +75,7 @@ runs: DISPLAY: ':1' npm_config_registry: ${{inputs.npmRegistry}} working-directory: packages/cli-e2e - run: npm run jest:ci -- ${{inputs.spec}} + run: npm run jest:ci -- ${{inputs.spec}} ${{inputs.flag}} - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 if: cancelled() || failure() || success() with: diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml deleted file mode 100644 index 3f2daec6ff..0000000000 --- a/.github/workflows/build-binaries.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: Build binaries - -on: - release: - types: [published] - workflow_dispatch: - inputs: - version: - description: 'The version where to upload the binaries' - required: true - -jobs: - package: - environment: 'Release' - env: - GITHUB_CREDENTIALS: ${{ secrets.GITHUB_TOKEN }} - # Base64 of the certificat - MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} - # Certificat password - MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} - # Keychain password - MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }} - # Apple developer email, the same used for the Apple Developer subscription - MACOS_APP_USERNAME: ${{ secrets.MACOS_APP_USERNAME }} - # App-specific password generated in apple.com for the notarization step - MACOS_APP_SPECIFIC_PWD: ${{ secrets.MACOS_APP_SPECIFIC_PWD }} - # Team ID from the Apple Developer subscription - MACOS_WWDR_TEAM_ID: ${{ secrets.MACOS_WWDR_TEAM_ID }} - name: Package for ${{ matrix.for }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - pack-command: ' macos' - for: 'macos install kit' - - os: windows-latest - pack-command: ' win' - for: 'windows install kit' - - os: ubuntu-20.04 - pack-command: ' deb' - for: 'linux install kit' - - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 - with: - # pulls all commits (needed for finding the @coveo/cli version to release) - fetch-depth: 0 - - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 - - name: Setup - run: npm i - - name: Get tags - run: node ./scripts/get-tags.mjs - - name: Build - run: npm run build - - name: Setup Temporary Keychain - if: ${{matrix.os == 'macos-latest'}} - run: | - echo "Decoding base64 certificate" - echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12 - - echo "Creating temporary keychain" - security create-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - - echo "Adding certificate to keychain" - security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign -T /usr/bin/productsign - - echo "Enabling productsign from a non user interactive shell" - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PWD" build.keychain - - name: Create install kits - working-directory: ./packages/cli/core - run: ../../../node_modules/oclif/bin/run pack${{ matrix.pack-command }} - - name: Create packages - working-directory: ./packages/cli/core - if: ${{matrix.os == 'ubuntu-20.04'}} - run: ../../../node_modules/oclif/bin/run pack tarballs - - name: Get commit hash of binaries - run: node ../../../scripts/get-commit-short-hash.mjs - working-directory: ./packages/cli/core - - name: Sign Executable (Windows) - working-directory: ./packages/cli/core - if: ${{matrix.os == 'windows-latest'}} - run: | - New-Item -Force -ItemType directory -Path tmp - echo "${{ secrets.COVEO_PFX }}" > ./tmp/cert.txt - certutil -decode ./tmp/cert.txt ./tmp/cert.pfx - Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.exe" -PassThru | Wait-Process - Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x86.exe" -PassThru | Wait-Process - - name: Sign Executable (macOS) - working-directory: ./packages/cli/core/dist/macos - if: ${{matrix.os == 'macos-latest'}} - run: | - echo "Signing for ARM64 architecture" - security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg --keychain build.keychain - - echo "Signing for X64 architecture" - security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg --keychain build.keychain - - name: Notarize Executable (macOS) - working-directory: ./packages/cli/core/dist/macos - if: ${{matrix.os == 'macos-latest'}} - run: | - echo "Unlocking the keychain" - security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain - - echo "Creating keychain profile" - xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.MACOS_APP_USERNAME }}" --team-id "${{ secrets.MACOS_WWDR_TEAM_ID }}" --password "${{ secrets.MACOS_APP_SPECIFIC_PWD }}" - - echo "Creating temp notarization archive" - ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip" - ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "notarization-x64.zip" - - echo "Notarizing app" - xcrun notarytool submit "notarization-arm64.zip" --keychain-profile "notarytool-profile" --wait - xcrun notarytool submit "notarization-x64.zip" --keychain-profile "notarytool-profile" --wait - - echo "Attaching staple" - xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" - xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" - - echo "Deleting unsigned packages" - mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg" - mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg" - rm notarization-arm64.zip notarization-x64.zip - - name: Upload binaries - uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # 2.5.0 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./packages/cli/core/dist/**/* - file_glob: true - tag: ${{ env.tag }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da3e2ba15d..00f741e4fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -174,7 +174,7 @@ jobs: node: ${{ matrix.node }} spec: ${{ matrix.spec }} cliConfigJson: ${{ env.CLI_CONFIG_JSON }} - npmRegistry: 'http://localhost:4873' + npmRegistry: 'http://127.0.0.1:4873' e2e-teardown: timeout-minutes: 15 name: End-to-end teardown diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 838c2ee6bd..3242c1c4b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +#TODO: Split into smaller chunks/actions/reusable workflows name: Create release on: workflow_dispatch: @@ -13,11 +14,35 @@ on: required: false jobs: - release: + e2e-setup-login: + name: End-to-end login + runs-on: 'ubuntu-20.04' + timeout-minutes: 30 + outputs: + cliConfigJson: ${{ steps.setup.outputs.cliConfigJson}} + env: + # ID of the test run to identify resources to teardown. + TEST_RUN_ID: 'idubuntu-20.04-${{ github.sha }}-${{ github.run_attempt }}-releaseg' + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + # pulls all commits (needed for computing the next version) + fetch-depth: 0 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + cache: 'npm' + node-version-file: '.nvmrc' + - name: Install Coveo CLI + run: npm i -g @coveo/cli@latest + - uses: ./.github/actions/e2e-login + id: setup + release-npm: environment: 'Release' runs-on: ubuntu-20.04 env: - GITHUB_CREDENTIALS: ${{ secrets.CLI_RELEASE }} + GITHUB_CREDENTIALS: ${{ secrets.CLI_RELEASE }} # Required to lock master + outputs: + shouldReleaseCli: $${{steps.release.outputs.shouldReleaseCli}} steps: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 with: @@ -30,15 +55,339 @@ jobs: node-version-file: '.nvmrc' - name: Install dependencies run: npm ci - - name: Release - run: npm run release + - name: Release NPM + run: npm run release:npm + id: release env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} VERSION: ${{ inputs.version }} DEBUG: ${{ inputs.debug && '*' || '' }} + - name: Prepare artifacts + run: | + git add . + git commit -m "patch" + git format-patch HEAD^1 --output=release.patch + - name: Upload artifacts + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: npm-release + path: | + release.patch + .git-message + # RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }} + # RELEASER_PRIVATE_KEY: ${{ secrets.RELEASER_PRIVATE_KEY }} + # RELEASER_CLIENT_ID: ${{ secrets.RELEASER_CLIENT_ID }} + # RELEASER_CLIENT_SECRET: ${{ secrets.RELEASER_CLIENT_SECRET }} + # RELEASER_INSTALLATION_ID: ${{ secrets.RELEASER_INSTALLATION_ID }} + # DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + e2e: + name: End-to-end tests + runs-on: ubuntu-20.04 + needs: [release-npm, e2e-setup-login] + timeout-minutes: 60 + env: + TEST_RUN_ID: 'idubuntu-20.04-${{ github.sha }}-${{ github.run_attempt }}-releaseg' # ID of the test run to identify resources to teardown. + COVEO_DISABLE_AUTOUPDATE: true + CLI_CONFIG_JSON: ${{needs.e2e-setup-login.outputs.cliConfigJson}} + strategy: + fail-fast: false + matrix: + spec: + [ + 'angular.specs.ts', + 'atomic.specs.ts', + 'auth.specs.ci.ts', + 'orgList.specs.ts', + 'orgResources.specs.ts', + 'react.specs.ts', + 'vue.specs.ts', + ] + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + # pulls all commits (needed for computing the next version) + fetch-depth: 0 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + node-version-file: '.nvmrc' + - name: Download artifacts + uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: npm-release + - name: Apply & delete the patch + run: | + git apply release.patch + rm release.patch + - name: Install dependencies + run: npm ci + - name: Install Coveo CLI + run: npm i -g @coveo/cli@latest + - uses: ./.github/actions/e2e-run + with: + os: 'ubuntu-20.04' + node: 18 + spec: ${{ matrix.spec }} + cliConfigJson: ${{ env.CLI_CONFIG_JSON }} + jestFlags: '-u' + - name: Find modified Snapshots + id: snapshots-path + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + echo "snapshotsPath<<$EOF" >> "$GITHUB_ENV" + git diff --name-only *.yml >> "$GITHUB_ENV" + echo "$EOF" >> "$GITHUB_ENV" + - name: Upload Jest Snapshots + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: release-e2e-snaps + path: ${{ env.snapshotsPath }} + e2e-teardown: + name: End-to-end teardown + if: ${{ always() }} + needs: [e2e, e2e-setup-login] + runs-on: ubuntu-20.04 + env: + # ID of the test run to identify resources to teardown. + TEST_RUN_ID: '${{ github.sha }}-${{ github.run_attempt }}-releaseg' + CLI_CONFIG_JSON: ${{needs.e2e-setup-login.outputs.cliConfigJson}} + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + # pulls all commits (needed for computing the next version) + fetch-depth: 0 + # pulls all tags (needed for computing the next version) + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Checkout last tag + run: git checkout $(git describe --abbrev=0 --tags) + - uses: ./.github/actions/e2e-clean + with: + cliConfigJson: ${{ env.CLI_CONFIG_JSON }} + release-git: + needs: [release-npm] + environment: 'Release' + runs-on: ubuntu-20.04 + env: + GITHUB_CREDENTIALS: ${{ secrets.CLI_RELEASE }} # Required to lock master + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + # pulls all commits (needed for computing the next version) + fetch-depth: 0 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + node-version-file: '.nvmrc' + - name: Download NPM artifacts + uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: npm-release + - name: Apply & delete the patch + run: | + git apply release.patch + rm release.patch + - name: Download E2E artifacts + uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: release-e2e-snaps + - name: Install dependencies + run: npm ci + - name: Release Git + run: npm run release:git + env: + VERSION: ${{ inputs.version }} + DEBUG: ${{ inputs.debug && '*' || '' }} + RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }} + RELEASER_PRIVATE_KEY: ${{ secrets.RELEASER_PRIVATE_KEY }} + RELEASER_CLIENT_ID: ${{ secrets.RELEASER_CLIENT_ID }} + RELEASER_CLIENT_SECRET: ${{ secrets.RELEASER_CLIENT_SECRET }} + RELEASER_INSTALLATION_ID: ${{ secrets.RELEASER_INSTALLATION_ID }} + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + build-binaries: + needs: [release-npm] + if: ${{needs.release-npm.outputs.shouldReleaseCli}} + environment: 'Release' + env: + GITHUB_CREDENTIALS: ${{ secrets.GITHUB_TOKEN }} + # Base64 of the certificat + MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} + # Certificat password + MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} + # Keychain password + MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }} + # Apple developer email, the same used for the Apple Developer subscription + MACOS_APP_USERNAME: ${{ secrets.MACOS_APP_USERNAME }} + # App-specific password generated in apple.com for the notarization step + MACOS_APP_SPECIFIC_PWD: ${{ secrets.MACOS_APP_SPECIFIC_PWD }} + # Team ID from the Apple Developer subscription + MACOS_WWDR_TEAM_ID: ${{ secrets.MACOS_WWDR_TEAM_ID }} + name: Package for ${{ matrix.for }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + pack-command: ' macos' + for: 'macos install kit' + - os: windows-latest + pack-command: ' win' + for: 'windows install kit' + - os: ubuntu-20.04 + pack-command: ' deb' + for: 'linux install kit' + + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + # pulls all commits (needed for finding the @coveo/cli version to release) + fetch-depth: 0 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + node-version-file: '.nvmrc' + - name: Download artifacts + uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: npm-release + - name: Apply & delete the patch + run: | + git apply release.patch + rm release.patch + - name: Install dependencies + run: npm ci + - name: Get CLI version + run: | + echo "cliVersion=" >> "$GITHUB_ENV" + cat packages/cli/core/package.json | jq '.version' >> "$GITHUB_ENV" + - name: Build + run: npm run build + - name: Setup Temporary Keychain + if: ${{matrix.os == 'macos-latest'}} + run: | + echo "Decoding base64 certificate" + echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12 + + echo "Creating temporary keychain" + security create-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain + + echo "Adding certificate to keychain" + security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign -T /usr/bin/productsign + + echo "Enabling productsign from a non user interactive shell" + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PWD" build.keychain + - name: Create install kits + working-directory: ./packages/cli/core + run: ../../../node_modules/oclif/bin/run pack${{ matrix.pack-command }} + - name: Create packages + working-directory: ./packages/cli/core + if: ${{matrix.os == 'ubuntu-20.04'}} + run: ../../../node_modules/oclif/bin/run pack tarballs + - name: Get commit hash of binaries + run: node ../../../scripts/get-commit-short-hash.mjs + working-directory: ./packages/cli/core + - name: Sign Executable (Windows) + working-directory: ./packages/cli/core + if: ${{matrix.os == 'windows-latest'}} + run: | + New-Item -Force -ItemType directory -Path tmp + echo "${{ secrets.COVEO_PFX }}" > ./tmp/cert.txt + certutil -decode ./tmp/cert.txt ./tmp/cert.pfx + Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.exe" -PassThru | Wait-Process + Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x86.exe" -PassThru | Wait-Process + - name: Sign Executable (macOS) + working-directory: ./packages/cli/core/dist/macos + if: ${{matrix.os == 'macos-latest'}} + run: | + echo "Signing for ARM64 architecture" + security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain + productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg --keychain build.keychain + + echo "Signing for X64 architecture" + security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain + productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg --keychain build.keychain + - name: Notarize Executable (macOS) + working-directory: ./packages/cli/core/dist/macos + if: ${{matrix.os == 'macos-latest'}} + run: | + echo "Unlocking the keychain" + security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain + + echo "Creating keychain profile" + xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.MACOS_APP_USERNAME }}" --team-id "${{ secrets.MACOS_WWDR_TEAM_ID }}" --password "${{ secrets.MACOS_APP_SPECIFIC_PWD }}" + + echo "Creating temp notarization archive" + ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip" + ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "notarization-x64.zip" + + echo "Notarizing app" + xcrun notarytool submit "notarization-arm64.zip" --keychain-profile "notarytool-profile" --wait + xcrun notarytool submit "notarization-x64.zip" --keychain-profile "notarytool-profile" --wait + + echo "Attaching staple" + xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" + xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" + + echo "Deleting unsigned packages" + mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg" + mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg" + rm notarization-arm64.zip notarization-x64.zip + - name: Upload binaries + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: release-binaries + path: ./packages/cli/core/dist/**/* + release-github: + needs: [release-git, release-npm, build-binaries] + if: ${{needs.release-npm.outputs.shouldReleaseCli}} + environment: 'Release' + runs-on: ubuntu-20.04 + env: + GITHUB_CREDENTIALS: ${{ secrets.CLI_RELEASE }} # Required to lock master + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + # pulls all commits (needed for computing the next version) + fetch-depth: 0 + - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 + with: + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + node-version-file: '.nvmrc' + - name: Download NPM artifacts + uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: npm-release + - name: Download binaries artifacts + uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: release-binaries + - name: Apply & delete the patch + run: | + git apply release.patch + rm release.patch + - name: Install dependencies + run: npm ci + - name: Release GitHub + run: npm run release:github + env: + VERSION: ${{ inputs.version }} + DEBUG: ${{ inputs.debug && '*' || '' }} RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }} RELEASER_PRIVATE_KEY: ${{ secrets.RELEASER_PRIVATE_KEY }} RELEASER_CLIENT_ID: ${{ secrets.RELEASER_CLIENT_ID }} RELEASER_CLIENT_SECRET: ${{ secrets.RELEASER_CLIENT_SECRET }} RELEASER_INSTALLATION_ID: ${{ secrets.RELEASER_INSTALLATION_ID }} DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + - name: Upload binaries + uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # 2.5.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./packages/cli/core/dist/**/* + file_glob: true + tag: ${{ env.tag }} diff --git a/CHANGELOG.md b/CHANGELOG.md index b762fc7093..4a98125021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# release-18 (2023-08-24) + +### Bug Fixes + +- **cli:** remove deploy.example ([#1321](https://github.com/coveo/cli/issues/1321)) ([a79e335](https://github.com/coveo/cli/commits/a79e335a4b476c011945b56f417e13cbd295cf0d)) + +# release-17 (2023-07-26) + +### Bug Fixes + +- **cli:** use ci-friendly confirm ([1a3aab5](https://github.com/coveo/cli/commits/1a3aab557b93039e59966b2c7595873b7adf754b)) +- **deps:** update dependency semver to v7.5.2 [security] j:cdx-227 ([#1319](https://github.com/coveo/cli/issues/1319)) ([e4b92d7](https://github.com/coveo/cli/commits/e4b92d72be92057a7d2ef6708c1dea75814ae259)) + +### Features + +- **cli-commons:** add ci-friendly confirm ([30db525](https://github.com/coveo/cli/commits/30db525a680d0f15ce9e0e9a8c71aabb701bde02)) + # release-16 (2023-06-13) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index 229ce18cb0..b6345d1999 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cli-tools", - "version": "1.0.0-16", + "version": "1.0.0-18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cli-tools", - "version": "1.0.0-16", + "version": "1.0.0-18", "hasInstallScript": true, "license": "Apache-2.0", "workspaces": [ @@ -60,7 +60,7 @@ "patch-package": "6.5.1", "prettier": "2.8.8", "rimraf": "4.4.1", - "semver": "7.5.0", + "semver": "7.5.2", "ts-dedent": "2.2.0", "ts-node": "10.9.1", "typescript": "4.9.5", @@ -108,25 +108,35 @@ "integrity": "sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==", "dev": true }, - "node_modules/@amplitude/identify": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/@amplitude/identify/-/identify-1.10.2.tgz", - "integrity": "sha512-ywxeabS8ukMdJWNwx3rG/EBngXFg/4NsPhlyAxbBUcI7HzBXEJUKepiZfkz8K6Y7f0mpc23Qz1aBf48ZJDZmkQ==", + "node_modules/@amplitude/analytics-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-core/-/analytics-core-1.2.3.tgz", + "integrity": "sha512-3WADE8IcxU7ZERMkBb0+JP7t6EekyFPM0djtNKXQaxgGgH3oqQzMmBCg19UnYYiBSHrZkpiMBLHNAvXL6HM7zg==", "dependencies": { - "@amplitude/types": "^1.10.2", - "@amplitude/utils": "^1.10.2", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" + "@amplitude/analytics-types": "^1.3.3", + "tslib": "^2.4.1" + } + }, + "node_modules/@amplitude/analytics-node": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-node/-/analytics-node-1.3.3.tgz", + "integrity": "sha512-G+5EoGcVOOclcNRR57AQcGqg46xNXjG6tsSdF71+Npzc6zTfvDzKDY97ZULBju9TT/FXvhP8LnppAI8umT6qkQ==", + "dependencies": { + "@amplitude/analytics-core": "^1.2.3", + "@amplitude/analytics-types": "^1.3.3", + "tslib": "^2.4.1" } }, - "node_modules/@amplitude/node": { + "node_modules/@amplitude/analytics-types": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-types/-/analytics-types-1.3.3.tgz", + "integrity": "sha512-V4/h+izhG7NyVfIva1uhe6bToI/l5n+UnEomL3KEO9DkFoKiOG7KmXo/fmzfU6UmD1bUEWmy//hUFF16BfrEww==" + }, + "node_modules/@amplitude/identify": { "version": "1.10.2", - "resolved": "https://registry.npmjs.org/@amplitude/node/-/node-1.10.2.tgz", - "integrity": "sha512-E3xp8DOpkF5ThjrRlAmSocnrEYsTPpd3Zg4WdBLms0ackQSgQpw6z84+YMcoPerZHJJ/LEqdo4Cg4Z5Za3D+3Q==", + "resolved": "https://registry.npmjs.org/@amplitude/identify/-/identify-1.10.2.tgz", + "integrity": "sha512-ywxeabS8ukMdJWNwx3rG/EBngXFg/4NsPhlyAxbBUcI7HzBXEJUKepiZfkz8K6Y7f0mpc23Qz1aBf48ZJDZmkQ==", "dependencies": { - "@amplitude/identify": "^1.10.2", "@amplitude/types": "^1.10.2", "@amplitude/utils": "^1.10.2", "tslib": "^2.0.0" @@ -26003,9 +26013,9 @@ } }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -28543,6 +28553,31 @@ "node": ">= 0.8" } }, + "node_modules/verdaccio/node_modules/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/verdaccio/node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/verdaccio/node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -28551,6 +28586,11 @@ "node": ">=0.6" } }, + "node_modules/verdaccio/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -30532,7 +30572,7 @@ "@babel/core": "7.21.5", "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.21.5", - "@coveo/cli": "2.6.0", + "@coveo/cli": "2.6.2", "@coveo/platform-client": "44.1.0", "abortcontroller-polyfill": "1.7.5", "async-retry": "1.3.3", @@ -30573,23 +30613,13 @@ "node": ">=18" } }, - "packages/cli-e2e/node_modules/@coveo/cli/node_modules/@coveo/platform-client": { - "version": "42.5.0", - "resolved": "https://registry.npmjs.org/@coveo/platform-client/-/platform-client-42.5.0.tgz", - "integrity": "sha512-zCp2QTDD+UMpjDJSAWOPn33TydjPkH7/vWTWFKty5AZFEomYM9APAYkOu2mJA2l+YozA7M+Eljh841/qJCQ7kg==", - "extraneous": true, - "dependencies": { - "exponential-backoff": "^3.1.0", - "query-string-cjs": "npm:query-string@^7.0.0", - "query-string-esm": "npm:query-string@^8.0.0" - } - }, "packages/cli/commons": { "name": "@coveo/cli-commons", - "version": "2.5.0", + "version": "2.6.0", "license": "Apache-2.0", "dependencies": { - "@amplitude/node": "1.10.2", + "@amplitude/analytics-node": "^1.3.3", + "@amplitude/analytics-types": "^2.1.2", "@coveo/platform-client": "44.1.0", "@oclif/core": "1.24.0", "abortcontroller-polyfill": "1.7.5", @@ -30599,7 +30629,7 @@ "is-ci": "3.0.1", "isomorphic-fetch": "3.0.0", "npm-package-arg": "10.1.0", - "semver": "7.5.0", + "semver": "7.5.2", "ts-dedent": "2.2.0" }, "devDependencies": { @@ -30626,6 +30656,11 @@ "typescript": "4.9.5" } }, + "packages/cli/commons/node_modules/@amplitude/analytics-types": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-types/-/analytics-types-2.1.2.tgz", + "integrity": "sha512-ASKwH9g+5gglTHr7h7miK8J/ofIzuEtGRDCjnZAtRbE6+laoOfCLYPPJXMYz0k1x+rIhLO/6I6WWjT7zchmpyA==" + }, "packages/cli/commons/node_modules/is-ci": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", @@ -30639,13 +30674,13 @@ }, "packages/cli/core": { "name": "@coveo/cli", - "version": "2.6.0", + "version": "2.6.2", "license": "Apache-2.0", "dependencies": { + "@amplitude/analytics-node": "^1.3.3", "@amplitude/identify": "^1.9.0", - "@amplitude/node": "^1.9.0", - "@coveo/cli-commons": "2.5.0", - "@coveo/cli-plugin-source": "2.0.11", + "@coveo/cli-commons": "2.6.0", + "@coveo/cli-plugin-source": "2.0.12", "@coveo/platform-client": "44.1.0", "@oclif/core": "1.24.0", "@oclif/plugin-help": "5.1.23", @@ -30678,16 +30713,17 @@ "coveo": "bin/run" }, "devDependencies": { + "@amplitude/analytics-types": "^2.1.2", "@amplitude/types": "1.10.2", "@babel/core": "7.21.5", "@coveo/angular": "1.36.0", - "@coveo/atomic-component-health-check": "2.1.0", + "@coveo/atomic-component-health-check": "2.1.2", "@coveo/cli-commons-dev": "6.0.6", "@coveo/cra-template": "1.37.0", - "@coveo/create-atomic": "1.38.0", - "@coveo/create-atomic-component": "1.1.0", + "@coveo/create-atomic": "1.38.1", + "@coveo/create-atomic-component": "1.1.2", "@coveo/create-atomic-component-project": "1.1.0", - "@coveo/create-atomic-result-component": "1.1.0", + "@coveo/create-atomic-result-component": "1.1.2", "@coveo/create-headless-vue": "1.2.0", "@oclif/test": "2.2.21", "@types/archiver": "5.3.2", @@ -30727,12 +30763,18 @@ } } }, + "packages/cli/core/node_modules/@amplitude/analytics-types": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@amplitude/analytics-types/-/analytics-types-2.1.2.tgz", + "integrity": "sha512-ASKwH9g+5gglTHr7h7miK8J/ofIzuEtGRDCjnZAtRbE6+laoOfCLYPPJXMYz0k1x+rIhLO/6I6WWjT7zchmpyA==", + "dev": true + }, "packages/cli/source": { "name": "@coveo/cli-plugin-source", - "version": "2.0.11", + "version": "2.0.12", "license": "Apache-2.0", "dependencies": { - "@coveo/cli-commons": "2.5.0", + "@coveo/cli-commons": "2.6.0", "@coveo/platform-client": "44.1.0", "@coveo/push-api-client": "3.1.15", "@oclif/core": "1.24.0", @@ -30764,17 +30806,6 @@ "node": "^16.13.0 || ^18.12.0" } }, - "packages/cli/source/node_modules/@coveo/cli-commons/node_modules/@coveo/platform-client": { - "version": "42.5.0", - "resolved": "https://registry.npmjs.org/@coveo/platform-client/-/platform-client-42.5.0.tgz", - "integrity": "sha512-zCp2QTDD+UMpjDJSAWOPn33TydjPkH7/vWTWFKty5AZFEomYM9APAYkOu2mJA2l+YozA7M+Eljh841/qJCQ7kg==", - "extraneous": true, - "dependencies": { - "exponential-backoff": "^3.1.0", - "query-string-cjs": "npm:query-string@^7.0.0", - "query-string-esm": "npm:query-string@^8.0.0" - } - }, "packages/ui/angular": { "name": "@coveo/angular", "version": "1.36.0", @@ -30807,7 +30838,7 @@ }, "packages/ui/atomic/create-atomic": { "name": "@coveo/create-atomic", - "version": "1.38.0", + "version": "1.38.1", "license": "Apache-2.0", "dependencies": { "@coveo/platform-client": "44.1.0", @@ -30831,7 +30862,7 @@ }, "packages/ui/atomic/create-atomic-component": { "name": "@coveo/create-atomic-component", - "version": "1.1.0", + "version": "1.1.2", "license": "Apache-2.0", "dependencies": { "@coveo/create-atomic-component-project": "1.1.0" @@ -30887,7 +30918,7 @@ }, "packages/ui/atomic/create-atomic-result-component": { "name": "@coveo/create-atomic-result-component", - "version": "1.1.0", + "version": "1.1.2", "license": "Apache-2.0", "dependencies": { "@coveo/create-atomic-component-project": "1.1.0" @@ -31166,7 +31197,7 @@ }, "packages/ui/atomic/health-check": { "name": "@coveo/atomic-component-health-check", - "version": "2.1.0", + "version": "2.1.2", "license": "Apache-2.0", "dependencies": { "chalk": "4.1.2", @@ -31190,7 +31221,7 @@ }, "packages/ui/atomic/template": { "name": "@coveo/create-atomic-template", - "version": "1.39.0", + "version": "1.39.1", "dependencies": { "@coveo/atomic": "2.25.2", "@coveo/headless": "2.13.1", @@ -31372,7 +31403,7 @@ "conventional-changelog-angular": "5.0.13", "npm-registry-fetch": "14.0.5", "octokit": "2.0.14", - "semver": "7.5.0", + "semver": "7.5.2", "ts-dedent": "2.2.0" }, "bin": { diff --git a/package.json b/package.json index d0a14d1f2a..cb57fb5f1f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cli-tools", "private": true, - "version": "1.0.0-16", + "version": "1.0.0-18", "author": "Coveo", "bin": { "coveo": "./bin/run" @@ -46,7 +46,7 @@ "patch-package": "6.5.1", "prettier": "2.8.8", "rimraf": "4.4.1", - "semver": "7.5.0", + "semver": "7.5.2", "ts-dedent": "2.2.0", "ts-node": "10.9.1", "typescript": "4.9.5", @@ -86,11 +86,13 @@ "commit-msg": "node ./hooks/commit-msg.js", "pre-commit": "lint-staged", "postinstall": "patch-package && nx run-many --target=postinstall --all", - "release": "npm run nx:graph && npm run release:phase0 && npm run release:phase1 && npm run release:phase2", + "release:npm": "npm run nx:graph && npm run release:phase0 && npm run release:phase1 && npm run release:phase2", + "release:git": "npx -p=@coveord/release git-publish-all", + "release:github": "npx -p=@coveord/release github-publish", "nx:graph": "nx graph --file=topology.json", "release:phase0": "npx -p=@coveord/release git-lock", "release:phase1": "nx run-many --target=release:phase1 --all --parallel=false --output-style=stream", - "release:phase2": "npx -p=@coveord/release git-publish-all" + "release:phase2": "npx -p=@coveord/release is-cli-release" }, "workspaces": [ "packages/*", diff --git a/packages/cli-e2e/.gitignore b/packages/cli-e2e/.gitignore index 3b0d32155d..7fda9edffa 100644 --- a/packages/cli-e2e/.gitignore +++ b/packages/cli-e2e/.gitignore @@ -2,7 +2,7 @@ node_modules .env artifacts verdaccio -!verdaccio/config.yaml\ +!verdaccio/config.yaml # Ignore copied specs __tests__/*.specs.linux.ts diff --git a/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap b/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap index 3b125ace54..f929cef495 100644 --- a/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap +++ b/packages/cli-e2e/__tests__/__snapshots__/atomic.specs.ts.snap @@ -23,7 +23,7 @@ HashedFolder { HashedFolder { "children": [ HashedFile { - "hash": "8AayDC90AmCwDykctBv05Cq9zu4=", + "hash": "KwR4eJKGc+ZXRbIX4Jhn40THSpI=", "name": "results-manager.tsx", }, HashedFile { @@ -31,7 +31,7 @@ HashedFolder { "name": "template-1.html", }, ], - "hash": "OlEsA/qWpj7+9r4LJ8V+2FRE1OE=", + "hash": "HghfGR6Ktv9oQs8WZP2zA+IjlgE=", "name": "results-manager", }, HashedFolder { @@ -63,7 +63,7 @@ HashedFolder { "name": "sample-result-component", }, ], - "hash": "5P8q9sBQYOIFBbud8itUocf8QuA=", + "hash": "ApFF74n5JpLwWNDx/OdGzyfLNlg=", "name": "components", }, HashedFile { @@ -86,11 +86,11 @@ HashedFolder { HashedFolder { "children": [ HashedFile { - "hash": "61GVF7l8bCVXW00H2rtInTKwoqY=", + "hash": "63iCDjem+a7U2WjolL1DH5P0Ci8=", "name": "index.css", }, ], - "hash": "FQZ6fv/Z/8DhwZWuUbrLwgTt6r8=", + "hash": "0bY2Jd491GZpzxt+9wZdGdawwVY=", "name": "style", }, HashedFolder { @@ -104,7 +104,7 @@ HashedFolder { "name": "utils", }, ], - "hash": "dNPSts5x0Oqehjz8sFo22X9vK5w=", + "hash": "V+jxFTW2uM99XIpoxRle6btFEYo=", "name": "src", }, HashedFile { @@ -112,7 +112,7 @@ HashedFolder { "name": "tsconfig.json", }, ], - "hash": "GCtPEPdDHbnv6hw7mx/iBvIiHbk=", + "hash": "H66A1esbk6Cxyt/R1HNbEeuTMDc=", "name": "normalizedDir", } `; @@ -149,7 +149,7 @@ HashedFolder { HashedFolder { "children": [ HashedFile { - "hash": "QJjgDAdWQehYt60rPIq3b5Urcng=", + "hash": "ggJcPENEYrkDlKP1rUoQNPE0JhM=", "name": "results-manager.tsx", }, HashedFile { @@ -157,7 +157,7 @@ HashedFolder { "name": "template-1.html", }, ], - "hash": "BPEklM42OInkFci0QuyGusyadQI=", + "hash": "kHLkOJ9S2RmK9QsYV4H3vFWRSOY=", "name": "results-manager", }, HashedFolder { @@ -189,7 +189,7 @@ HashedFolder { "name": "sample-result-component", }, ], - "hash": "zcDXsMe88fA/wmx5tmFkfSQG7p4=", + "hash": "wLPpWj43ALvIz9yZsp4BFoMBbow=", "name": "components", }, HashedFile { @@ -212,11 +212,11 @@ HashedFolder { HashedFolder { "children": [ HashedFile { - "hash": "U0XExuwJA8zpHzmPNOnoAXbRUoY=", + "hash": "gk5CR4Hm1yGsg8K5Of+ddP15XUc=", "name": "index.css", }, ], - "hash": "4l9E8DZM4BHRPkTYiQihBKLKe1c=", + "hash": "hxqHCQ2HbA639SAVyjlg/sZ19qY=", "name": "style", }, HashedFolder { @@ -230,7 +230,7 @@ HashedFolder { "name": "utils", }, ], - "hash": "j9cAks0quLyTN84opnsheTegHPc=", + "hash": "DozmbICjZ0Y1PMirUeKxn1+X1UI=", "name": "src", }, HashedFile { @@ -238,7 +238,7 @@ HashedFolder { "name": "tsconfig.json", }, ], - "hash": "Nr3j7z5PKsAqgxVQ+hWUi0ur1nM=", + "hash": "orJQkK4qDRi2Am0THO7BYw1QJcM=", "name": "normalizedDir", } `; @@ -275,7 +275,7 @@ HashedFolder { HashedFolder { "children": [ HashedFile { - "hash": "LiPFXpS1sKZg/jHFeC2NZ0CJU6M=", + "hash": "OvDBAuwZSXzJKEDTu2h16xwmS/4=", "name": "results-manager.tsx", }, HashedFile { @@ -283,7 +283,7 @@ HashedFolder { "name": "template-1.html", }, ], - "hash": "+fkWdok/HnrqsmuNKot00n9mAGw=", + "hash": "Dfe37MVrxMYCBJksItHWKh4iFRU=", "name": "results-manager", }, HashedFolder { @@ -315,7 +315,7 @@ HashedFolder { "name": "sample-result-component", }, ], - "hash": "mN3OMfRS4rnN0gSb4G3ikXw+WFg=", + "hash": "2rr+UEKfg3sYGI7t3rEsd9NaqaI=", "name": "components", }, HashedFile { @@ -356,7 +356,7 @@ HashedFolder { "name": "utils", }, ], - "hash": "inWZt3frzA8egVzFmMRQiBsgABU=", + "hash": "BbDf+PumRFJhCAZDIzDYgYIWO+8=", "name": "src", }, HashedFile { @@ -364,7 +364,7 @@ HashedFolder { "name": "tsconfig.json", }, ], - "hash": "c8JiUF+lYEw2HBxvArluBb06ma0=", + "hash": "qaUjZxOHtN3/gswBxyhbd1pU00g=", "name": "normalizedDir", } `; diff --git a/packages/cli-e2e/package.json b/packages/cli-e2e/package.json index 14914ebe5a..b883f17f3c 100644 --- a/packages/cli-e2e/package.json +++ b/packages/cli-e2e/package.json @@ -61,7 +61,7 @@ "@babel/core": "7.21.5", "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.21.5", - "@coveo/cli": "2.6.0", + "@coveo/cli": "2.6.2", "@coveo/platform-client": "44.1.0", "abortcontroller-polyfill": "1.7.5", "async-retry": "1.3.3", diff --git a/packages/cli-e2e/setup/utils/utils.ts b/packages/cli-e2e/setup/utils/utils.ts index 57401fe362..50d5f1c9ca 100644 --- a/packages/cli-e2e/setup/utils/utils.ts +++ b/packages/cli-e2e/setup/utils/utils.ts @@ -96,11 +96,11 @@ export async function startVerdaccio() { 'verdaccio' ); await verdaccioTerminal - .when(/localhost:4873/) + .when(/127.0.0.1:4873/) .on('stdout') .do() .once(); - await waitOn({resources: ['tcp:4873']}); + await waitOn({resources: ['tcp:127.0.0.1:4873']}); } export function useCIConfigIfEnvIncomplete() { @@ -184,9 +184,9 @@ export const resolveBinary = (programName: string) => { const registryEnv: Record = process.env.E2E_USE_NPM_REGISTRY ? {} : { - npm_config_registry: 'http://localhost:4873', - YARN_NPM_REGISTRY_SERVER: 'http://localhost:4873', - YARN_REGISTRY: 'http://localhost:4873', + npm_config_registry: 'http://127.0.0.1:4873', + YARN_NPM_REGISTRY_SERVER: 'http://127.0.0.1:4873', + YARN_REGISTRY: 'http://127.0.0.1:4873', }; export function getCleanEnv(): Record { diff --git a/packages/cli-e2e/setup/utils/verdaccio.ts b/packages/cli-e2e/setup/utils/verdaccio.ts index a84a7adbcf..0684dda165 100644 --- a/packages/cli-e2e/setup/utils/verdaccio.ts +++ b/packages/cli-e2e/setup/utils/verdaccio.ts @@ -8,7 +8,7 @@ import {dirSync} from 'tmp'; import {writeFileSync} from 'node:fs'; const npmRegistry = 'https://registry.npmjs.org/'; -const verdaccioRegistry = 'http://localhost:4873'; +const verdaccioRegistry = 'http://127.0.0.1:4873'; const verdaccioedPackages = [ '@coveo/atomic-component-health-check', diff --git a/packages/cli-e2e/utils/loginSelectors.ts b/packages/cli-e2e/utils/loginSelectors.ts index 2cb49020c1..7c99c369ad 100644 --- a/packages/cli-e2e/utils/loginSelectors.ts +++ b/packages/cli-e2e/utils/loginSelectors.ts @@ -1,6 +1,6 @@ export class LoginSelectors { public static readonly loginWithOfficeButton = - 'button[formaction="/auth/office365?scope=openid"]'; + 'button[formaction^="/auth/office365"]'; public static readonly passwordView = 'div[data-viewid="2"]'; public static readonly emailView = 'div[data-viewid="1"]'; public static readonly emailInput = 'input[type="email"]'; diff --git a/packages/cli-e2e/utils/npmLogin.ts b/packages/cli-e2e/utils/npmLogin.ts index 3498e55739..3f470ac0fe 100644 --- a/packages/cli-e2e/utils/npmLogin.ts +++ b/packages/cli-e2e/utils/npmLogin.ts @@ -7,7 +7,7 @@ export const npmLogin = async () => { const args = [ ...npm(), 'login', - '--registry=http://localhost:4873', + '--registry=http://127.0.0.1:4873', '--auth-type=legacy', ]; const npmLogin = new Terminal(args.shift()!, args); diff --git a/packages/cli-e2e/verdaccio/config.yaml b/packages/cli-e2e/verdaccio/config.yaml index be485bbe5f..8ea60bd261 100644 --- a/packages/cli-e2e/verdaccio/config.yaml +++ b/packages/cli-e2e/verdaccio/config.yaml @@ -44,4 +44,4 @@ logs: - {type: stdout, format: pretty, level: trace} listen: - - localhost:4873 # default value + - 127.0.0.1:4873 # default value diff --git a/packages/cli/commons/CHANGELOG.md b/packages/cli/commons/CHANGELOG.md index 9c0d4be719..d15edcb9df 100644 --- a/packages/cli/commons/CHANGELOG.md +++ b/packages/cli/commons/CHANGELOG.md @@ -1,3 +1,13 @@ +# 2.6.0 (2023-07-26) + +### Bug Fixes + +- **deps:** update dependency semver to v7.5.2 [security] j:cdx-227 ([#1319](https://github.com/coveo/cli/issues/1319)) ([e4b92d7](https://github.com/coveo/cli/commits/e4b92d72be92057a7d2ef6708c1dea75814ae259)) + +### Features + +- **cli-commons:** add ci-friendly confirm ([30db525](https://github.com/coveo/cli/commits/30db525a680d0f15ce9e0e9a8c71aabb701bde02)) + # 2.5.0 (2023-06-13) ### Bug Fixes diff --git a/packages/cli/commons/package.json b/packages/cli/commons/package.json index 1dd5aa3de7..52f8b1de3c 100644 --- a/packages/cli/commons/package.json +++ b/packages/cli/commons/package.json @@ -1,6 +1,6 @@ { "name": "@coveo/cli-commons", - "version": "2.5.0", + "version": "2.6.0", "author": "Coveo", "description": "Common utils for @coveo/cli plugins", "license": "Apache-2.0", @@ -24,7 +24,8 @@ "typescript": "4.9.5" }, "dependencies": { - "@amplitude/node": "1.10.2", + "@amplitude/analytics-node": "^1.3.3", + "@amplitude/analytics-types": "^2.1.2", "@coveo/platform-client": "44.1.0", "@oclif/core": "1.24.0", "abortcontroller-polyfill": "1.7.5", @@ -34,7 +35,7 @@ "is-ci": "3.0.1", "isomorphic-fetch": "3.0.0", "npm-package-arg": "10.1.0", - "semver": "7.5.0", + "semver": "7.5.2", "ts-dedent": "2.2.0" }, "scripts": { diff --git a/packages/cli/commons/src/analytics/amplitudeClient.ts b/packages/cli/commons/src/analytics/amplitudeClient.ts index 87fd6ade92..67a3d4cbcc 100644 --- a/packages/cli/commons/src/analytics/amplitudeClient.ts +++ b/packages/cli/commons/src/analytics/amplitudeClient.ts @@ -1,14 +1,7 @@ -import {init, NodeClient} from '@amplitude/node'; +import {init} from '@amplitude/analytics-node'; +export {flush, track} from '@amplitude/analytics-node'; const analyticsAPIKey = 'af28cba7acfd392c324bebd399e2d9ea'; -export interface AmplitudeClient extends NodeClient { - identified: boolean; -} - // TODO: CDX-667: support proxy -export const amplitudeClient = init(analyticsAPIKey); - -export const flush = async () => { - await amplitudeClient.flush(); -}; +init(analyticsAPIKey); diff --git a/packages/cli/commons/src/analytics/identifier.spec.ts b/packages/cli/commons/src/analytics/identifier.spec.ts index cfec88316b..790d289639 100644 --- a/packages/cli/commons/src/analytics/identifier.spec.ts +++ b/packages/cli/commons/src/analytics/identifier.spec.ts @@ -1,4 +1,4 @@ -jest.mock('@amplitude/node'); +jest.mock('@amplitude/analytics-node'); jest.mock('@amplitude/identify'); jest.mock('@coveo/platform-client'); jest.mock('../platform/authenticatedClient'); @@ -6,39 +6,36 @@ jest.mock('../config/config'); jest.mock('../config/globalConfig'); import os from 'os'; -import {Identify} from '@amplitude/identify'; +import { + Identify, + identify as amplitudeIdentify, +} from '@amplitude/analytics-node'; import {Config, Configuration} from '../config/config'; import {AuthenticatedClient} from '../platform/authenticatedClient'; import {Identifier} from './identifier'; import PlatformClient from '@coveo/platform-client'; import {configurationMock, defaultConfiguration} from '../config/stub'; import type {Interfaces} from '@oclif/core'; -import type {NodeClient} from '@amplitude/node'; import globalConfig from '../config/globalConfig'; describe('identifier', () => { const mockedGlobalConfig = jest.mocked(globalConfig); const mockedConfig = jest.mocked(Config); - const mockedIdentify = jest.mocked(Identify); + const mockedIdentifyClass = jest.mocked(Identify); + const mockedAmplitudeIdentifyFn = jest.mocked(amplitudeIdentify); const mockedAuthenticatedClient = jest.mocked(AuthenticatedClient); const mockedPlatformClient = jest.mocked(PlatformClient); const mockUserGet = jest.fn(); const mockSetIdentity = jest.fn(); - const mockedLogEvent = jest.fn(); const mockedOsVersion = jest.spyOn(os, 'release'); let identity: Awaited>; - const getDummyAmplitudeClient = () => - ({ - logEvent: mockedLogEvent, - } as unknown as NodeClient); - const doMockOS = () => { mockedOsVersion.mockReturnValue('21.3.4'); }; const doMockIdentify = () => { - mockedIdentify.prototype.set.mockImplementation(mockSetIdentity); + mockedIdentifyClass.prototype.set.mockImplementation(mockSetIdentity); }; const doMockPlatformClient = (email = '') => { mockedPlatformClient.mockImplementation( @@ -191,17 +188,19 @@ describe('identifier', () => { describe('when logging for every user type', () => { beforeEach(async () => { identity = await new Identifier().getIdentity(); - identity.identify(getDummyAmplitudeClient()); + identity.identify(); }); it('should add the CLI version to the event', async () => { - expect(mockedLogEvent).toHaveBeenCalledWith( + expect(mockedAmplitudeIdentifyFn).toHaveBeenCalledWith( + expect.any(Identify), expect.objectContaining({app_version: '1.2.3'}) ); }); it('should add the OS information to the event', async () => { - expect(mockedLogEvent).toHaveBeenCalledWith( + expect(mockedAmplitudeIdentifyFn).toHaveBeenCalledWith( + expect.any(Identify), expect.objectContaining({ app_version: '1.2.3', os_name: 'darwin', diff --git a/packages/cli/commons/src/analytics/identifier.ts b/packages/cli/commons/src/analytics/identifier.ts index a650db8a03..78c544f645 100644 --- a/packages/cli/commons/src/analytics/identifier.ts +++ b/packages/cli/commons/src/analytics/identifier.ts @@ -1,13 +1,16 @@ import os from 'os'; -import {Identify} from '@amplitude/identify'; +import { + Identify, + identify as amplitudeIdentify, +} from '@amplitude/analytics-node'; import {machineId} from 'node-machine-id'; import {createHash} from 'crypto'; import {AuthenticatedClient} from '../platform/authenticatedClient'; import PlatformClient from '@coveo/platform-client'; import {camelToSnakeCase} from '../utils/string'; -import type {NodeClient} from '@amplitude/node'; import globalConfig from '../config/globalConfig'; import {Configuration} from '../config/config'; +import type {EventOptions} from '@amplitude/analytics-types'; export class Identifier { private authenticatedClient: AuthenticatedClient; @@ -35,13 +38,14 @@ export class Identifier { identifier.set(camelToSnakeCase(key), value); }); - const identify = (amplitudeClient: NodeClient) => { - const identifyEvent = { - ...identifier.identifyUser(userId, deviceId), + const identify = () => { + const identifyEvent: EventOptions = { + user_id: userId, + device_id: deviceId, ...this.getAmplitudeBaseEventProperties(), ...this.getOrganizationIdentifier(), }; - amplitudeClient.logEvent(identifyEvent); + amplitudeIdentify(identifier, identifyEvent); }; return {userId, deviceId, identify}; diff --git a/packages/cli/core/CHANGELOG.md b/packages/cli/core/CHANGELOG.md index a29686b512..79659019d1 100644 --- a/packages/cli/core/CHANGELOG.md +++ b/packages/cli/core/CHANGELOG.md @@ -1,3 +1,15 @@ +## 2.6.2 (2023-08-24) + +### Bug Fixes + +- **cli:** remove deploy.example ([#1321](https://github.com/coveo/cli/issues/1321)) ([a79e335](https://github.com/coveo/cli/commits/a79e335a4b476c011945b56f417e13cbd295cf0d)) + +## 2.6.1 (2023-07-26) + +### Bug Fixes + +- **cli:** use ci-friendly confirm ([1a3aab5](https://github.com/coveo/cli/commits/1a3aab557b93039e59966b2c7595873b7adf754b)) + # 2.6.0 (2023-06-13) ### Bug Fixes diff --git a/packages/cli/core/README.md b/packages/cli/core/README.md index 6c85d6fb5c..901b806d95 100644 --- a/packages/cli/core/README.md +++ b/packages/cli/core/README.md @@ -23,7 +23,7 @@ $ npm install -g @coveo/cli $ coveo COMMAND running command... $ coveo (--version) -@coveo/cli/2.6.0 linux-x64 node-v18.16.0 +@coveo/cli/2.6.2 linux-x64 node-v18.17.1 $ coveo --help [COMMAND] USAGE $ coveo COMMAND @@ -85,12 +85,6 @@ The main config file of the Coveo CLI is stored in a JSON file in `configDir`. - [`coveo plugins:uninstall PLUGIN...`](#coveo-pluginsuninstall-plugin-1) - [`coveo plugins:uninstall PLUGIN...`](#coveo-pluginsuninstall-plugin-2) - [`coveo plugins:update`](#coveo-pluginsupdate) -- [`coveo source:catalog:add SOURCEID`](#coveo-sourcecatalogadd-sourceid) -- [`coveo source:catalog:new NAME`](#coveo-sourcecatalognew-name) -- [`coveo source:list`](#coveo-sourcelist) -- [`coveo source:push:add SOURCEID`](#coveo-sourcepushadd-sourceid) -- [`coveo source:push:delete SOURCEID`](#coveo-sourcepushdelete-sourceid) -- [`coveo source:push:new NAME`](#coveo-sourcepushnew-name) - [`coveo ui:create:angular NAME`](#coveo-uicreateangular-name) - [`coveo ui:create:atomic NAME`](#coveo-uicreateatomic-name) - [`coveo ui:create:react NAME`](#coveo-uicreatereact-name) @@ -155,7 +149,7 @@ EXAMPLES $ coveo atomic:component --type=result mySuperResultComponent ``` -_See code: [src/commands/atomic/component.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/atomic/component.ts)_ +_See code: [src/commands/atomic/component.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/atomic/component.ts)_ ## `coveo atomic:deploy` @@ -252,7 +246,7 @@ EXAMPLES $ coveo atomic:init --type=lib myCustomAtomicComponentsLibrary ``` -_See code: [src/commands/atomic/init.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/atomic/init.ts)_ +_See code: [src/commands/atomic/init.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/atomic/init.ts)_ ## `coveo auth:login` @@ -280,7 +274,7 @@ EXAMPLES $ coveo auth:login ``` -_See code: [src/commands/auth/login.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/auth/login.ts)_ +_See code: [src/commands/auth/login.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/auth/login.ts)_ ## `coveo auth:token` @@ -306,7 +300,7 @@ EXAMPLES $ coveo auth:token ``` -_See code: [src/commands/auth/token.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/auth/token.ts)_ +_See code: [src/commands/auth/token.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/auth/token.ts)_ ## `coveo config:get [KEY]` @@ -336,7 +330,7 @@ EXAMPLES $ coveo config:get accessToken ``` -_See code: [src/commands/config/get.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/config/get.ts)_ +_See code: [src/commands/config/get.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/config/get.ts)_ ## `coveo config:set` @@ -359,7 +353,7 @@ EXAMPLES $ coveo config:set --organization myOrgId ``` -_See code: [src/commands/config/set.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/config/set.ts)_ +_See code: [src/commands/config/set.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/config/set.ts)_ ## `coveo help [COMMAND]` @@ -399,7 +393,7 @@ DESCRIPTION Create a new test Coveo organization. ``` -_See code: [src/commands/org/create.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/create.ts)_ +_See code: [src/commands/org/create.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/create.ts)_ ## `coveo org:list` @@ -425,7 +419,7 @@ DESCRIPTION List Coveo organizations. ``` -_See code: [src/commands/org/list.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/list.ts)_ +_See code: [src/commands/org/list.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/list.ts)_ ## `coveo org:resources:list` @@ -456,7 +450,7 @@ EXAMPLES $ coveo org:resources:list -o=myOrgId ``` -_See code: [src/commands/org/resources/list.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/resources/list.ts)_ +_See code: [src/commands/org/resources/list.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/resources/list.ts)_ ## `coveo org:resources:model:create` @@ -470,7 +464,7 @@ DESCRIPTION Create a Snapshot Pull Model ``` -_See code: [src/commands/org/resources/model/create.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/resources/model/create.ts)_ +_See code: [src/commands/org/resources/model/create.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/resources/model/create.ts)_ ## `coveo org:resources:monitor SNAPSHOTID` @@ -499,7 +493,7 @@ EXAMPLES $ coveo org:resources:monitor --organization myorgid --snapshotId mysnapshotid ``` -_See code: [src/commands/org/resources/monitor.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/resources/monitor.ts)_ +_See code: [src/commands/org/resources/monitor.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/resources/monitor.ts)_ ## `coveo org:resources:preview` @@ -535,7 +529,7 @@ EXAMPLES $ coveo org:resources:preview -o=myOrgId -d ``` -_See code: [src/commands/org/resources/preview.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/resources/preview.ts)_ +_See code: [src/commands/org/resources/preview.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/resources/preview.ts)_ ## `coveo org:resources:pull` @@ -590,7 +584,7 @@ EXAMPLES $ coveo org:resources:pull --resourceTypes QUERY_PIPELINE FIELD, ``` -_See code: [src/commands/org/resources/pull.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/resources/pull.ts)_ +_See code: [src/commands/org/resources/pull.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/resources/pull.ts)_ ## `coveo org:resources:push` @@ -634,7 +628,7 @@ EXAMPLES $ coveo org:resources:push --deleteMissingResources ``` -_See code: [src/commands/org/resources/push.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/resources/push.ts)_ +_See code: [src/commands/org/resources/push.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/resources/push.ts)_ ## `coveo org:search:dump` @@ -684,7 +678,7 @@ EXAMPLES $ coveo org:search:dump --fieldsToExclude ec_description ec_summary ``` -_See code: [src/commands/org/search/dump.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.0/packages/cli/core/src/commands/org/search/dump.ts)_ +_See code: [src/commands/org/search/dump.ts](https://github.com/coveo/cli/blob/@coveo/cli@2.6.2/packages/cli/core/src/commands/org/search/dump.ts)_ ## `coveo plugins` @@ -926,189 +920,6 @@ DESCRIPTION _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.12/src/commands/plugins/update.ts)_ -## `coveo source:catalog:add SOURCEID` - -Index a JSON document into a Coveo Catalog source. See https://docs.coveo.com/en/2956 for more information. - -``` -USAGE - $ coveo source:catalog:add [SOURCEID] [-f ] [-c | ] [-m] [-n] [--fullUpload] [--skipFullUploadCheck] - -ARGUMENTS - SOURCEID The identifier of the Catalog source on which to perform the add operation. See `source:list` to obtain the - identifier. - -FLAGS - -c, --maxConcurrent= - [default: 10] The maximum number of requests to send concurrently. Increasing this value increases the speed at - which documents are indexed to the Coveo platform. However, if you run into memory or throttling issues, consider - reducing this value. - - -f, --files=myfile.json... - Combinaison of JSON files and folders (containing JSON files) to push. Can be repeated. - - -m, --[no-]createMissingFields - Analyse documents to detect and automatically create missing fields in the destination organization. When enabled, - an error will be thrown if a field is used to store data of inconsistent type across documents. - - -n, --[no-]normalizeInvalidFields - Whether to normalize invalid fields detected from the documents. If set to `false`, an error will be thrown when - invalid fields are detected. - - --fullUpload - Controls the way your items are added to your catalog source. - - Setting this option to false will trigger a document update (Default operation). Useful to perform incremental - updates for smaller adjustments to your catalog that do not require pushing the entire catalog. A document update - must only be performed after a full catalog upload. - See https://docs.coveo.com/en/l62e0540 - - Setting this option to true will trigger a full catalog upload. This process acts as a full rebuild of your catalog - source. Therefore, previous items that are not included in the new payload will be deleted. - See https://docs.coveo.com/en/lb4a0344 - - --skipFullUploadCheck - Do not check whether a full catalog upload was triggered on the target source. - -DESCRIPTION - Index a JSON document into a Coveo Catalog source. See https://docs.coveo.com/en/2956 for more information. -``` - -_See code: [@coveo/cli-plugin-source](https://github.com/coveo/cli/blob/@coveo/cli@2.0.11/packages/cli/source/src/commands/source/catalog/add.ts)_ - -## `coveo source:catalog:new NAME` - -Create a new catalog source in a Coveo organization - -``` -USAGE - $ coveo source:catalog:new [NAME] [-v PRIVATE|SECURED|SHARED] - -ARGUMENTS - NAME The name of the source to create. - -FLAGS - -v, --sourceVisibility=(PRIVATE|SECURED|SHARED) [default: SECURED] Controls the content security option that should - be applied to the items in a source. See - https://docs.coveo.com/en/1779/index-content/content-security - -DESCRIPTION - Create a new catalog source in a Coveo organization -``` - -_See code: [@coveo/cli-plugin-source](https://github.com/coveo/cli/blob/@coveo/cli@2.0.11/packages/cli/source/src/commands/source/catalog/new.ts)_ - -## `coveo source:list` - -List all available push sources in your Coveo organization - -``` -USAGE - $ coveo source:list [--columns | -x] [--sort ] [--filter ] [--output csv|json|yaml | | - [--csv | --no-truncate]] [--no-header | ] - -FLAGS - -x, --extended show extra columns - --columns= only show provided columns (comma-separated) - --csv output is csv format [alias: --output=csv] - --filter= filter property by partial string matching, ex: name=foo - --no-header hide table header from output - --no-truncate do not truncate output to fit screen - --output=