Skip to content

Conversation

@CountRedClaw
Copy link
Collaborator

@CountRedClaw CountRedClaw commented Aug 25, 2025

build type: changelog

  • calculate diffs for whole specifications, split per operations afterwards
  • optimize diffs deduplication

build type: build

  • remove hash calculation for each operation (not used anymore on frontend)

@github-actions github-actions bot added enhancement New feature or request refactor labels Aug 25, 2025
@CountRedClaw CountRedClaw linked an issue Aug 27, 2025 that may be closed by this pull request
version: 0.1.0
paths:
/api/v1/path1:
get:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing changed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content type changed from application/xml to application/json

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so then rename change-method to change-content-type :)

version: 0.1.0
paths:
/api/v1/path1:
get:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing changed (before)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content type changed from application/xml to application/json

@github-actions github-actions bot added the bug Something isn't working label Sep 8, 2025
let operationDiffs: Diff[] = []
if (operationChanged) {
operationDiffs = [...(methodData as WithAggregatedDiffs<GraphApiOperation>)[DIFFS_AGGREGATED_META_KEY]??[]]
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatted

prevDocData = createCopyWithEmptyPathItems(currDocData)
}
if (prevDocData && !currDocData) {
currDocData = createCopyWithEmptyPathItems(prevDocData)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to have collisions here? I mean, can prevDocData and currDocData be overridden in second if operators?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collision- no. Added comments to clarify what cases are handled by each piece. This is sequential processing and result of first step (if there are prefix groups) should still be processed by second step (create empty counterpart document if necessary)

// externalDocs?: ExternalDocumentationObject;
// 'x-express-openapi-additional-middleware'?: (((request: any, response: any, next: any) => Promise<void>) | ((request: any, response: any, next: any) => void))[];
// 'x-express-openapi-validation-strict'?: boolean;
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we remove it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed


const groupSlug = convertToSlug(areOperationsFromCurrentVersion ? currentGroup : previousGroup)
function removeRedundantPartialPairs<T extends [object | undefined, object | undefined]>(
tuples: T[],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add unit tests for such not trivial utilities

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added unit tests for dedupeTuples and removeRedundantPartialPairs functions

})

test('comparison should have 1 breaking and 1 annotation changes', async () => {
test('Comparison should have 1 breaking and 1 annotation changes', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comparison of...what?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the name of the test group to make it clear these are tests for changelog build type.

title: test
version: 0.1.0
servers:
- url: https://example1.com/api/v2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this in before.yaml?

version: 0.1.0
servers:
- url: https://example2.com
description: It is a description of server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it in after.yaml?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched before and after to avoid confusion.

@@ -1 +1 @@
# test
# test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file necessary for tests?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file was changed in the PR due to linter errors.
This is an existing test called multifiles, so I wouldn't change it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Process whole specs for GraphQL and REST to collect per-operation data for build type changelog Add e2e tests for build types 'build' and 'changelog'

5 participants