Skip to content

feat(extract/microsoft): derive Supersedes field from SupersededBy#771

Merged
MaineK00n merged 1 commit intonightlyfrom
MaineK00n/supersedes
Apr 23, 2026
Merged

feat(extract/microsoft): derive Supersedes field from SupersededBy#771
MaineK00n merged 1 commit intonightlyfrom
MaineK00n/supersedes

Conversation

@MaineK00n
Copy link
Copy Markdown
Owner

@MaineK00n MaineK00n commented Apr 16, 2026

  • Add DeriveSupersedes to pkg/extract/microsoft/util, inverting SupersededBy
    to populate Supersedes at both KB-level and Update-level
  • Add Supersedes field to KB and Update types
  • Refactor bulletin, cvrf, msuc, wsusscn2 extractors to use DeriveSupersedes
  • msuc/wsusscn2 use a two-pass approach: write SupersededBy in pass 1,
    read all KB files and derive Supersedes in pass 2
  • Add TestDeriveSupersedes covering KB-level, Update-level, edge cases

@MaineK00n MaineK00n self-assigned this Apr 16, 2026
@MaineK00n MaineK00n force-pushed the MaineK00n/supersedes branch 10 times, most recently from 389a89d to 10bccb6 Compare April 22, 2026 17:11
@MaineK00n MaineK00n changed the title feat(microsoftkb): add Supersedes field derived from SupersededBy feat(extract/microsoft): derive Supersedes field from SupersededBy Apr 22, 2026
@MaineK00n MaineK00n marked this pull request as ready for review April 22, 2026 17:13
Copilot AI review requested due to automatic review settings April 22, 2026 17:13
@MaineK00n MaineK00n force-pushed the MaineK00n/supersedes branch from 10bccb6 to 37850c0 Compare April 22, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a derived Supersedes relationship for Microsoft KB data by inverting existing SupersededBy references, so consumers can traverse supersession in both directions at the KB level and per-update level.

Changes:

  • Added Supersedes fields to Microsoft KB and Update models plus a new supersedes type with comparison helpers.
  • Implemented microsoft/util.DeriveSupersedes and refactored extractors to populate Supersedes (including a second pass for msuc/wsusscn2).
  • Added unit tests and updated golden fixtures to reflect the new supersedes JSON output.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/extract/types/microsoftkb/update/update.go Adds Supersedes to Update model and includes it in sorting/comparison.
pkg/extract/types/microsoftkb/supersedes/supersedes.go New type representing “older update this update supersedes”.
pkg/extract/types/microsoftkb/supersededby/supersededby.go Removes no-op Sort() (Compare-only type).
pkg/extract/types/microsoftkb/microsoftkb.go Adds KB-level Supersedes, sorts/compares/merges it.
pkg/extract/microsoft/util/util.go Adds DeriveSupersedes utility that inverts SupersededBy.
pkg/extract/microsoft/util/util_test.go Adds TestDeriveSupersedes covering KB/update inversion + edge cases.
pkg/extract/microsoft/wsusscn2/wsusscn2.go Adds phase-2 pass to read all KBs, derive Supersedes, rewrite KBs.
pkg/extract/microsoft/msuc/msuc.go Adds phase-2 pass to read all KBs, derive Supersedes, rewrite KBs.
pkg/extract/microsoft/cvrf/cvrf.go Derives Supersedes on the in-memory KB set before returning/writing.
pkg/extract/microsoft/bulletin/bulletin.go Derives Supersedes on the in-memory KB set before returning/writing.
pkg/extract/microsoft/wsusscn2/testdata/golden/microsoftkb/5066xxx/5066835.json Updates golden output to include supersedes for an update.
pkg/extract/microsoft/msuc/testdata/golden/microsoftkb/5026xxx/5026446.json Updates golden output to include supersedes.
pkg/extract/microsoft/msuc/testdata/golden/microsoftkb/5026xxx/5026372.json Updates golden output to include supersedes.
pkg/extract/microsoft/msuc/testdata/golden/microsoftkb/5025xxx/5025305.json Updates golden output to include supersedes.
pkg/extract/microsoft/cvrf/testdata/golden/microsoftkb/5027xxx/5027543.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/cvrf/testdata/golden/microsoftkb/5027xxx/5027536.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/cvrf/testdata/golden/microsoftkb/5020xxx/5020687.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/cvrf/testdata/golden/microsoftkb/5019xxx/5019964.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/cvrf/testdata/golden/microsoftkb/3147xxx/3147461.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/cvrf/testdata/golden/microsoftkb/3135xxx/3135456.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/bulletin/testdata/golden/microsoftkb/955xxx/955069.json Updates golden output to include KB-level supersedes.
pkg/extract/microsoft/bulletin/testdata/golden/microsoftkb/4014xxx/4014329.json Updates golden output to include KB-level supersedes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/extract/microsoft/msuc/msuc.go Outdated
Comment thread pkg/extract/microsoft/util/util_test.go
Comment thread pkg/extract/microsoft/util/util.go Outdated
Comment thread pkg/extract/microsoft/wsusscn2/wsusscn2.go Outdated
@MaineK00n MaineK00n force-pushed the MaineK00n/supersedes branch from 37850c0 to b377d1b Compare April 22, 2026 17:22
Copilot AI review requested due to automatic review settings April 22, 2026 17:24
@MaineK00n MaineK00n force-pushed the MaineK00n/supersedes branch from b377d1b to ca67fd9 Compare April 22, 2026 17:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/extract/microsoft/wsusscn2/wsusscn2.go
Comment thread pkg/extract/microsoft/msuc/msuc.go Outdated
@MaineK00n MaineK00n force-pushed the MaineK00n/supersedes branch from ca67fd9 to 354e900 Compare April 22, 2026 17:31
- Add DeriveSupersedes to pkg/extract/microsoft/util, inverting SupersededBy
  to populate Supersedes at both KB-level and Update-level
- Add Supersedes field to KB and Update types
- Refactor bulletin, cvrf, msuc, wsusscn2 extractors to use DeriveSupersedes
- msuc/wsusscn2 use a two-pass approach: write SupersededBy in pass 1,
  read all KB files and derive Supersedes in pass 2
- Add TestDeriveSupersedes covering KB-level, Update-level, edge cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 22, 2026 17:33
@MaineK00n MaineK00n force-pushed the MaineK00n/supersedes branch from 354e900 to ad5f125 Compare April 22, 2026 17:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MaineK00n MaineK00n requested a review from shino April 22, 2026 17:38
Copy link
Copy Markdown
Collaborator

@shino shino left a comment

Choose a reason for hiding this comment

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

🏁

@MaineK00n MaineK00n merged commit ab85fe2 into nightly Apr 23, 2026
5 checks passed
@MaineK00n MaineK00n deleted the MaineK00n/supersedes branch April 23, 2026 04:27
MaineK00n added a commit that referenced this pull request Apr 23, 2026
)

- Add DeriveSupersedes to pkg/extract/microsoft/util, inverting SupersededBy
  to populate Supersedes at both KB-level and Update-level
- Add Supersedes field to KB and Update types
- Refactor bulletin, cvrf, msuc, wsusscn2 extractors to use DeriveSupersedes
- msuc/wsusscn2 use a two-pass approach: write SupersededBy in pass 1,
  read all KB files and derive Supersedes in pass 2
- Add TestDeriveSupersedes covering KB-level, Update-level, edge cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MaineK00n added a commit that referenced this pull request Apr 23, 2026
)

- Add DeriveSupersedes to pkg/extract/microsoft/util, inverting SupersededBy
  to populate Supersedes at both KB-level and Update-level
- Add Supersedes field to KB and Update types
- Refactor bulletin, cvrf, msuc, wsusscn2 extractors to use DeriveSupersedes
- msuc/wsusscn2 use a two-pass approach: write SupersededBy in pass 1,
  read all KB files and derive Supersedes in pass 2
- Add TestDeriveSupersedes covering KB-level, Update-level, edge cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants