Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @mikeharder @weshaggard @raych1 @danieljurek
* @mikeharder @weshaggard @raych1 @danieljurek @scbedd
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ updates:
directory: "/"
schedule:
interval: "daily"
ignore:
# dependencies

# Locked to "^15.4.1", since newer majors include breaking changes that may impact us
- dependency-name: "yargs"

# devDependencies

# Locked to "^20.0.0" to align with our minimum node version in package.json/engines
- dependency-name: "@types/node"

# Updated manually
- dependency-name: "prettier"
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,43 @@
# Changelog

## 0.9.4
## 0.10.4

- Replace `yargs` dependency with Node.js built-in `parseArgs()` function

## 0.10.3

- Bump `@azure/swagger-validation-common` from `0.0.5` to `0.1.2`
- Bump `@ts-common/async-iterator` from `0.2.3` to `^1.1.0`
- Bump `@ts-common/fs` to `0.2.0` to `^1.1.0`
- Bump `@ts-common/json` from `0.3.1` to `^1.1.0`
- Bump `@ts-common/json-parser` from `0.9.0` to `^1.1.0`
- Bump `@ts-common/string-map` from `0.3.0` to `^1.1.1`
- Bump `glob` from `^9.3.5` to `^11.0.3`
- Bump `node-object-hash` from `^1.4.2` to `^3.1.1`

## 0.10.2

- Revert `yargs` to `^15.4.1`

## 0.10.1

- Fix bug triggered by upgrade to `yargs` in 0.10.0

## 0.10.0

- Breaking Change: Requires Node 20 or higher
- Remove unused dependency `node-fetch`
- Remove unused dependency `node-notifier`
- Bump `yargs` from `^15.4.1` to `^18.0.0`
- Bump `js-yaml` from `^3.13.1` to `^4.1.0`
- Pin `@azure/openapi-markdown` to `0.9.4`
- Pin `@azure/swagger-validation-common` to `0.0.5`
- Pin `@ts-common/async-iterator` to `0.2.3`
- Pin `@ts-common/fs` to `0.2.0`
- Pin `@ts-common/json` to `0.3.1`
- Pin `@ts-common/json-parser` to `0.9.0`
- Pin `@ts-common/string-map` to `0.3.0`
- Pin `commonmark` to `0.31.2`

## 0.9.3

Expand Down
49 changes: 23 additions & 26 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extends:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: 20.x
versionSpec: 22.x

- script: npm ci
displayName: 'npm ci'
Expand Down Expand Up @@ -52,10 +52,10 @@ extends:
- job: Test_Windows
strategy:
matrix:
Win.Node18:
node.version: 18.x
Win.Node20:
node.version: 20.x
Win.Node22:
node.version: 22.x
pool:
image: $(WINDOWSVMIMAGE)
name: $(WINDOWSPOOL)
Expand All @@ -68,10 +68,10 @@ extends:
- job: Test_Linux
strategy:
matrix:
Linux.Node18:
node.version: 18.x
Linux.Node20:
node.version: 20.x
Linux.Node22:
node.version: 22.x
pool:
image: $(LINUXVMIMAGE)
name: $(LINUXPOOL)
Expand All @@ -95,31 +95,28 @@ extends:
image: ubuntu-24.04
os: linux

variables:
- name: ArtifactPath
value: $(Pipeline.Workspace)/drop

templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: drop
itemPattern: '**/*.tgz'
targetPath: $(ArtifactPath)

strategy:
runOnce:
deploy:
steps:
- checkout: self
submodules: false

- download: current
artifact: drop
timeoutInMinutes: 5

- task: PowerShell@2
inputs:
filePath: '$(Build.SourcesDirectory)/eng/scripts/determine-release-tag.ps1'
failOnStderr: true
pwsh: true

- pwsh: |
Write-Host "Will deploy with tag of $(Tag)"
Get-ChildItem "$(Pipeline.Workspace)/drop" -Recurse -Force `
| Where-Object { $_.Name -like "*.tgz" } `
| Copy-Item -Destination "$(Build.ArtifactStagingDirectory)"

Get-ChildItem "$(Build.ArtifactStagingDirectory)" -Recurse -Force | % { Write-Host $_.FullName }
displayName: Move artifact to $(Build.ArtifactStagingDirectory)
Write-Host "Will deploy with tag of latest"
Get-ChildItem "$(ArtifactPath)" *.tgz -Recurse | % { Write-Host $_.FullName }
displayName: Packages to be published

- task: EsrpRelease@9
displayName: 'Publish oav to ESRP'
Expand All @@ -132,9 +129,9 @@ extends:
SignCertName: 'azure-sdk-esrp-release-certificate'
Intent: 'PackageDistribution'
ContentType: 'npm'
FolderLocation: $(Build.ArtifactStagingDirectory)
FolderLocation: $(ArtifactPath)
Owners: ${{ coalesce(variables['Build.RequestedForEmail'], '[email protected]') }}
Approvers: '[email protected]'
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
MainPublisher: 'ESRPRELPACMANTEST'
productstate: $(Tag)
productstate: 'latest'
88 changes: 70 additions & 18 deletions bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,81 @@
#!/usr/bin/env node
const cli = require('../dist/cli')
const index = require('../dist/index')
const { parseArgs } = require('util')

var argv = require('yargs')
.usage('Usage: avocado [options]')
.alias('f', 'file')
.describe('f', 'output detail result to log file')
.alias('d', 'dir')
.describe('d', 'run avocado under directory')
.option('excludePaths', {
type: 'array',
desc: 'array contains path patterns to be ignored',
})
.option('includePaths', {
type: 'array',
desc:
'array contains path patterns to be included. If this option is not set, all files will be included. If this option is set, only files that match at least one pattern will be included',
// Define help text
const showHelp = () => {
console.log(`Usage: avocado [options]

Options:
--version Show version number [boolean]
-f, --file output detail result to log file
-d, --dir run avocado under directory
--excludePaths array contains path patterns to be ignored [array]
--includePaths array contains path patterns to be included. If this option is
not set, all files will be included. If this option is set,
only files that match at least one pattern will be included
[array]
-h, --help Show help [boolean]`)
}

// Define parseArgs configuration
const options = {
file: {
type: 'string',
short: 'f'
},
dir: {
type: 'string',
short: 'd'
},
excludePaths: {
type: 'string',
multiple: true
},
includePaths: {
type: 'string',
multiple: true
},
help: {
type: 'boolean',
short: 'h'
},
version: {
type: 'boolean'
}
}

// Parse arguments
let parsedArgs
try {
parsedArgs = parseArgs({
options,
allowPositionals: true
})
.help('h')
.alias('h', 'help').argv
} catch (error) {
console.error(`Error: ${error.message}`)
showHelp()
process.exit(1)
}

const { values: argv } = parsedArgs

// Handle help
if (argv.help) {
showHelp()
process.exit(0)
}

// Handle version
if (argv.version) {
const packageJson = require('../package.json')
console.log(packageJson.version)
process.exit(0)
}

cli.run(index.avocado, index.UnifiedPipelineReport(argv.f), {
cli.run(index.avocado, index.UnifiedPipelineReport(argv.file), {
cwd: process.cwd(),
env: process.env,
args: { dir: argv.d, excludePaths: argv.excludePaths, includePaths: argv.includePaths },
args: { dir: argv.dir, excludePaths: argv.excludePaths, includePaths: argv.includePaths },
})
18 changes: 0 additions & 18 deletions eng/scripts/determine-release-tag.ps1

This file was deleted.

15 changes: 15 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import eslint from '@eslint/js'
import { defineConfig } from 'eslint/config'
import globals from 'globals'
import tseslint from 'typescript-eslint'

/** @type {import('eslint').Linter.Config[]} */
export default defineConfig({ ignores: ['dist/**'] }, eslint.configs.recommended, tseslint.configs.recommended, {
languageOptions: { globals: globals.node },
rules: {
// 17 errors
'@typescript-eslint/no-explicit-any': 'off',
// 5 errors
'@typescript-eslint/no-require-imports': 'off',
},
})
Loading