Skip to content

Conversation

@makeev-pavel
Copy link
Collaborator

… operation

@makeev-pavel makeev-pavel requested a review from b41ex as a code owner December 8, 2025 08:02
@makeev-pavel makeev-pavel marked this pull request as draft December 8, 2025 08:02
@makeev-pavel makeev-pavel changed the title feat: POC - Reclassify diffs to risky in a merged document for no-bwc… feat: Reclassify diffs to risky in a merged document for no-bwc operation Dec 12, 2025
@makeev-pavel makeev-pavel marked this pull request as ready for review December 12, 2025 07:16
expect.objectContaining({
scope: 'response',
action: DiffAction.replace,
type: risky,
Copy link
Collaborator

Choose a reason for hiding this comment

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

extend expected values with "before/afterDeclarationPaths" to clarify where diffs are expected.
you may use expect.arrayContaining matcher to avoid copy-pasting whole addresses, if you want.

expect.objectContaining({
scope: 'response',
action: DiffAction.replace,
type: risky,
Copy link
Collaborator

Choose a reason for hiding this comment

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

extend expected values with "before/afterDeclarationPaths" to clarify where diffs are expected.
you may use expect.arrayContaining matcher to avoid copy-pasting whole addresses, if you want.

expect.objectContaining({
scope: 'response',
action: DiffAction.replace,
type: breaking,
Copy link
Collaborator

Choose a reason for hiding this comment

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

extend expected values with "before/afterDeclarationPaths" to clarify where diffs are expected.
you may use expect.arrayContaining matcher to avoid copy-pasting whole addresses, if you want.

expect.objectContaining({
scope: 'components',
action: DiffAction.replace,
type: breaking,
Copy link
Collaborator

Choose a reason for hiding this comment

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

extend expected values with "before/afterDeclarationPaths" to clarify where diffs are expected.
you may use expect.arrayContaining matcher to avoid copy-pasting whole addresses, if you want.

]))
})

it('should mark GET method as risky and POST as breaking when only GET is in scope', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

One of these tests is excessive, since they are testing the same case, just on different data. One is enough, remove another one.

'should mark GET method as risky and POST as breaking when only GET is in scope'
'should mark POST method as breaking and GET as risky when only POST is in scope'

import {
AdapterContext,
AdapterResolver,
BwcState,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's be consistent with naming.
BwcState -> ApiCompatibilityScope
ApiCompatibilityKind: OK
backwardCompatibility -> apiCompatibilityScope
bwcScopeFunction -> apiCompatibilityScopeFunction
BwcScopeFunction -> ApiCompatibilityScopeFunction
parentBwc -> parentApiCompatibilityScope
computedBwc -> computedApiCompatibilityScope

"value": {
"type": "string"
},
"currency": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to have two fields here, simplify the case by removing field which is not changed.

onCreateDiffError?: (message: string, diff: Diff, ctx: CompareContext) => void
beforeValueNormalizedProperty?: symbol
afterValueNormalizedProperty?: symbol
bwcScopeFunction?: BwcScopeFunction
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a documentation for this function to clarify it's intended use-case.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FE] Reclassify diffs to risky in a merged document for no-bwc operation

4 participants