devcontainers / ci

A GitHub Action and Azure DevOps Task designed to simplify using Dev Containers (https://containers.dev) in CI/CD systems.
MIT License
334 stars 51 forks source link

Azure DevOps build step failing #197

Closed stuartleeks closed 1 year ago

stuartleeks commented 1 year ago

The Run AzDO test stage of the PR validation builds is failing (see here):

About to run devcontainer exec --workspace-folder /home/runner/work/ci/ci --remote-env BUILD_NUMBER=3996901503 --remote-env IMAGE_TAG=pr-194 --remote-env IS_CI=1 --remote-env BRANCH=refs/heads/main --remote-env AZDO_TOKEN=*** --remote-env AZURE_DEVOPS_EXT_PAT=*** --remote-env AZDO_ORG=https://dev.azure.com/monacotools --remote-env AZDO_PROJECT=Monaco --remote-env AZDO_BUILD=devcontainers.ci --remote-env MARKETPLACE_TOKEN=*** bash -c echo "Starting"
  ./scripts/test-azdo.sh
  [2023-01-24T14:03:46.740Z] Starting
  [2023-01-24T14:03:46.765Z] Using VSIX_FILE=output/devcontainers-dev.ci-0.2.1900000235.vsix
  Publishing private extension version...
  [2023-01-24T14:03:47.115Z] TFS Cross Platform Command Line Interface v0.12.0
  [2023-01-24T14:03:47.116Z] Copyright Microsoft Corporation
  [2023-01-24T14:03:47.188Z] Checking if this extension is already published
  [2023-01-24T14:03:47.646Z] It isn't, create a new extension.
  [2023-01-24T14:03:47.691Z] error: Received response 401 (Not Authorized). Check that your personal access token is correct and hasn't expired.
stuartleeks commented 1 year ago

Currently we have two tokens in the project secrets: AZDO_TOKEN (updated in Dec 2022) and MARKETPLACE_TOKEN (updated Sept 2022).

I have an open PR to update the target Azure DevOps orgs when publishing/sharing: https://github.com/devcontainers/ci/pull/140

When originally working on this, the marketplace publish token needed to be a global PAT

Since Oct 2022, this requirement has been lifted, so my theory is that the AZDO_TOKEN can possibly be used for both (i.e. the stale MARKETPLACE_TOKEN may no longer be needed).

stuartleeks commented 1 year ago

This pipeline run tests the theory that MARKETPLACE_TOKEN can be replaced with AZDO_TOKEN.

The build failed overall due to a test failure in the AzDO pipeline, but the AzDO pipeline was launched (a step forwards!)