Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ trigger:
branches:
include:
- main
pr:
branches:
include:
- main
paths:
include:
- package.json
- package-lock.json
- scripts/buildJdtlsExt.js
- jdtls.ext/pom.xml
- jdtls.ext/**/pom.xml
Comment thread
Copilot marked this conversation as resolved.
Resolved
- jdtls.ext/**/META-INF/MANIFEST.MF
- jdtls.ext/com.microsoft.jdtls.ext.target/com.microsoft.jdtls.ext.tp.target
- jdtls.ext/.mvn/wrapper/maven-wrapper.properties
- jdtls.ext/mvnw
- jdtls.ext/mvnw.cmd
- .azure-pipelines/ci.yml
- .azure-pipelines/npm-cfs.yml
- .azure-pipelines/npm-cfs-variables.yml
- .azure-pipelines/maven-cfs-variables.yml
- .azure-pipelines/cfs-settings.xml
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
Expand All @@ -34,8 +55,37 @@ extends:
stages:
- stage: Build
jobs:
- job: CFSValidation
displayName: Validate dependencies from CFS
condition: eq(variables['Build.Reason'], 'PullRequest')
steps:
- checkout: self
fetchTags: false
- task: JavaToolInstaller@0
displayName: Use Java 21
inputs:
versionSpec: "21"
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: NodeTool@0
displayName: Use Node 20.x
inputs:
versionSpec: 20.x
- template: /.azure-pipelines/npm-cfs.yml@self
parameters:
useReadOnlyCredential: true
Comment thread
wenytang-ms marked this conversation as resolved.
Resolved
- script: npm ci --ignore-scripts --prefer-online --cache "$(Agent.TempDirectory)/npm-cache"
Comment thread
wenytang-ms marked this conversation as resolved.
Resolved
displayName: Validate npm dependencies from CFS
- script: npm run build-server
displayName: Validate Maven dependencies from CFS
env:
SYSTEM_ACCESSTOKEN: $(CFS_READ_TOKEN)
MVNW_PASSWORD: $(CFS_READ_TOKEN)
MAVEN_USER_HOME: $(Agent.TempDirectory)/m2
MAVEN_ARGS: -s $(Build.SourcesDirectory)/.azure-pipelines/cfs-settings.xml -Dmaven.repo.local=$(Agent.TempDirectory)/m2/repository -U
Comment thread
wenytang-ms marked this conversation as resolved.
Resolved
- job: Job_1
displayName: CI
condition: ne(variables['Build.Reason'], 'PullRequest')
templateContext:
outputs:
- output: pipelineArtifact
Expand Down
24 changes: 20 additions & 4 deletions .azure-pipelines/npm-cfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
# pipelines is the 1ES extends template in another repository, so the unqualified
# form is looked up in 1ESPipelineTemplates and fails YAML compilation.

parameters:
- name: useReadOnlyCredential
type: boolean
default: false

steps:
- script: npm config set registry $(npm_config_registry) --location=user --userconfig="$(npm_config_userconfig)"
displayName: Configure CFS npm registry
Expand All @@ -44,10 +49,21 @@ steps:
# registry it finds in the file above. `always-auth` is deliberately not written:
# it is not read by this task and is rejected outright by the npm 10 shipped with
# Node 20.
- task: NpmAuthenticate@0
displayName: Authenticate to CFS feed
inputs:
workingFile: $(npm_config_userconfig)
- ${{ if not(parameters.useReadOnlyCredential) }}:
- task: NpmAuthenticate@0
displayName: Authenticate to CFS feed
inputs:
workingFile: $(npm_config_userconfig)

# PR validation runs repository-controlled code, so it must not receive the
# project-scoped System.AccessToken used by trusted branch builds. Its pipeline
# definition supplies a secret PAT restricted to Packaging Read.
- ${{ if parameters.useReadOnlyCredential }}:
- script: >-
node -e "const fs=require('fs');const r=new URL(process.env.npm_config_registry);const key='//'+r.host+r.pathname.replace(/\/?$/,'/');fs.appendFileSync(process.env.npm_config_userconfig,key+':_authToken='+process.env.CFS_READ_TOKEN+'\n');"
Comment thread
wenytang-ms marked this conversation as resolved.
Resolved
Comment thread
wenytang-ms marked this conversation as resolved.
Resolved
displayName: Authenticate to CFS feed with read-only credential
env:
CFS_READ_TOKEN: $(CFS_READ_TOKEN)

# Restore silently falling back to the public registry is the failure mode this
# whole template exists to prevent, and it leaves no trace in the build log, so it
Expand Down
12 changes: 0 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
# CI restores packages from the Central Feed Service, which withholds
# upstream versions until they are roughly a week old (measured at ~6.8
# days; both the packument entry and the tarball return 404 before then).
# Dependabot's built-in cooldown is only 3 days, so bumps otherwise land in
# a window where the feed 404s and the build fails. 10 days leaves margin
# in case the feed's ingestion lag drifts.
cooldown:
default-days: 10
- package-ecosystem: "github-actions"
Comment thread
wenytang-ms marked this conversation as resolved.
Resolved
directory: "/"
groups:
Expand Down