refactor(openapi): resource-oriented paths for /openapi/v1 + difyctl version gate (#38367)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
L1nSn0w
2026-07-08 02:22:59 +00:00
committed by GitHub
co-authored by autofix-ci[bot]
parent abd720146d
commit 915655683c
69 changed files with 1097 additions and 570 deletions
+18 -18
View File
@@ -15,41 +15,41 @@ function run(args: string[]): { code: number, stdout: string, stderr: string } {
}
}
describe('release-naming compat-check (compat 1.15.0..1.15.0)', () => {
describe('release-naming compat-check (compat 1.16.0..1.16.0)', () => {
it('accepts a version inside the window', () => {
expect(run(['compat-check', '1.15.0']).code).toBe(0)
expect(run(['compat-check', '1.16.0']).code).toBe(0)
})
it('accepts the inclusive lower bound', () => {
expect(run(['compat-check', '1.15.0']).code).toBe(0)
expect(run(['compat-check', '1.16.0']).code).toBe(0)
})
it('accepts the inclusive upper bound', () => {
expect(run(['compat-check', '1.15.0']).code).toBe(0)
expect(run(['compat-check', '1.16.0']).code).toBe(0)
})
it('accepts a v-prefixed tag', () => {
expect(run(['compat-check', 'v1.15.0']).code).toBe(0)
expect(run(['compat-check', 'v1.16.0']).code).toBe(0)
})
it('rejects a version below the lower bound', () => {
expect(run(['compat-check', '1.14.9']).code).not.toBe(0)
expect(run(['compat-check', '1.15.9']).code).not.toBe(0)
})
it('rejects a version above the upper bound', () => {
expect(run(['compat-check', '1.15.1']).code).not.toBe(0)
expect(run(['compat-check', '1.16.1']).code).not.toBe(0)
})
it('treats a prerelease of the bound as below it (1.15.0-rc1 < 1.15.0)', () => {
expect(run(['compat-check', '1.15.0-rc1']).code).not.toBe(0)
it('treats a prerelease of the bound as below it (1.16.0-rc1 < 1.16.0)', () => {
expect(run(['compat-check', '1.16.0-rc1']).code).not.toBe(0)
})
it('ignores build metadata on the bound (1.15.0+build == 1.15.0)', () => {
expect(run(['compat-check', '1.15.0+build123']).code).toBe(0)
it('ignores build metadata on the bound (1.16.0+build == 1.16.0)', () => {
expect(run(['compat-check', '1.16.0+build123']).code).toBe(0)
})
it('ignores build metadata when out of range (1.15.1+build still rejected)', () => {
expect(run(['compat-check', '1.15.1+build123']).code).not.toBe(0)
it('ignores build metadata when out of range (1.16.1+build still rejected)', () => {
expect(run(['compat-check', '1.16.1+build123']).code).not.toBe(0)
})
it('requires a version argument', () => {
@@ -60,7 +60,7 @@ describe('release-naming compat-check (compat 1.15.0..1.15.0)', () => {
describe('release-naming github-env', () => {
it('emits difyctlTag = tagPrefix + version', () => {
const { stdout } = run(['github-env'])
expect(stdout).toMatch(/^difyctlTag=difyctl-v0\.1\.0-alpha$/m)
expect(stdout).toMatch(/^difyctlTag=difyctl-v0\.2\.0-alpha$/m)
})
it('still emits the existing trace fields', () => {
@@ -75,14 +75,14 @@ describe('release-naming edge channel', () => {
expect(run(['channels']).stdout).toMatch(/^edge$/m)
})
it('edge-version derives <pkgcore>-edge.<sha> stripping the alpha prerelease', () => {
// package.json version is 0.1.0-alpha -> core 0.1.0
expect(run(['edge-version', '2fd7b82']).stdout.trim()).toBe('0.1.0-edge.2fd7b82')
it('edge-version derives <pkgcore>-edge.<sha> from the package version', () => {
// package.json version is 0.2.0-alpha -> core 0.2.0
expect(run(['edge-version', '2fd7b82']).stdout.trim()).toBe('0.2.0-edge.2fd7b82')
})
it('edge-version accepts a 40-char sha', () => {
const sha = '2fd7b829e1f0aaaabbbbccccddddeeeeffff0000'
expect(run(['edge-version', sha]).stdout.trim()).toBe(`0.1.0-edge.${sha}`)
expect(run(['edge-version', sha]).stdout.trim()).toBe(`0.2.0-edge.${sha}`)
})
it('edge-version rejects a non-hex sha', () => {
+1 -1
View File
@@ -81,7 +81,7 @@ describe('release-r2-edge manifest', () => {
it('carries the compat window from package.json', () => {
const { json } = buildManifest()
expect(json.compat).toEqual({ minDify: '1.15.0', maxDify: '1.15.0' })
expect(json.compat).toEqual({ minDify: '1.16.0', maxDify: '1.16.0' })
})
it('lists all 5 targets with asset name + sha256 from the checksums file', () => {