Skip to content

fix(admin): stop MetaDataTransfer.mapToVO dropping the namespace id - #7388

Open
Sean-Walker0 wants to merge 1 commit into
apache:masterfrom
Sean-Walker0:fix/metadata-map-to-vo-namespace-id
Open

Sean-Walker0 wants to merge 1 commit into
apache:masterfrom
Sean-Walker0:fix/metadata-map-to-vo-namespace-id

Conversation

@Sean-Walker0

Copy link
Copy Markdown
Contributor

Completes the fix started by #7324: it stopped MetaDataTransfer from dropping namespaceId on the write paths (copy(), mapToData), but the read path still drops it. mapToVO builds the MetaDataVO returned by the metadata list/detail APIs without copying namespaceId, so every row is reported with a null namespace even though the stored metadata is namespaced (MetaDataDO and MetaDataVO both carry the field).

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw test -pl shenyu-admin -am and ./mvnw checkstyle:check -pl shenyu-admin (module-scoped; full build left to CI).

Modifications

  • MetaDataTransfer#mapToVO now copies namespaceId from the DO to the VO, like every other field.

Verifying this change

Notes

apache#7324 fixed the write paths (copy() and mapToData) but the read path
kept dropping the field: mapToVO builds MetaDataVO from MetaDataDO for
the metadata list/detail APIs without copying namespaceId, so every
row is reported with a null namespace even though the stored metadata
is namespaced. Copy it like every other field, completing the fix
started by apache#7324.

The new test follows the testCopyKeepsNamespaceId convention from
apache#7324 and fails on current master with expected <ns-1> but was
<null>.

Verified with ./mvnw test -pl shenyu-admin -am and
./mvnw checkstyle:check -pl shenyu-admin (module-scoped).

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good completion of #7324: mapToVO was still dropping namespaceId on the read path, so the metadata list/detail APIs reported a null namespace even though the stored entity carries it. One-line fix plus test. The red jobs (e2e, e2e-storage mysql) are the known infrastructure failures, not this change. Approving.

This branch has not been deployed

No deployments
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.

2 participants