Skip to content

NOT_LATEST_API_VERSION_IN_DEFAULT_TAG false positive comparing date-based and version-based tags #159

@mikeharder

Description

@mikeharder

This may be a false positive related to date vs version based tagging:

https://github.com/Azure/azure-rest-api-specs/actions/runs/16039568796/job/45258366665?pr=35604#step:4:21

Repro Steps

$ npx avocado -d specification/keyvault/data-plane

{"level":"Error","code":"NOT_LATEST_API_VERSION_IN_DEFAULT_TAG","message":"The default tag does not contains the latest API version. Please make sure the latest api version swaggers are in the default tag.","tag":"default","readMeUrl":"/home/mharder/specs/specification/keyvault/data-plane/readme.md","jsonUrl":"/home/mharder/specs/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.6/storage.json","path":"/home/mharder/specs/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.6/storage.json","apiPath":"/storage/{storage-account-name}/sas/{sas-definition-name}"}

An easy fix could be to sort all numeric versions (e.g. 7.6) lower than all date-based versions (e.g. 2024-01-01).

if (!startsWithDate(apiVersion)) {
  // Prefix non-date-based strings with "!", so they sort before other date-based
  let apiVersionForSorting = `!${apiVersion}`;
}

This would work, if all new versions should be date-based. However, there is a new proposal for some specs to have both date-based and number-based versions in parallel. So, I don't think Avocado should change anything, until this new proposal is finalized.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions