Skip to content

Fixes #27130: Stored procedure version view shows empty Code tab#27531

Open
hyspacex wants to merge 1 commit intoopen-metadata:mainfrom
hyspacex:fix/27130-stored-procedure-version-code
Open

Fixes #27130: Stored procedure version view shows empty Code tab#27531
hyspacex wants to merge 1 commit intoopen-metadata:mainfrom
hyspacex:fix/27130-stored-procedure-version-code

Conversation

@hyspacex
Copy link
Copy Markdown

@hyspacex hyspacex commented Apr 20, 2026

Describe your changes:

Fixes #27130

On the stored procedure version view (/storedProcedure/<fqn>/versions/<version>), the Code tab rendered only the description with no code block, while the current (non-version) details page showed the stored procedure code correctly. This made historical versions appear to have lost their DDL.

The version tab didn't render any code component — it only had DescriptionV1. The fix adds the existing StoredProcedureCodeCard (already used in StoredProceduresUtils.tsx for the main details page) into the version tab's layout. It reads the code via useGenericContext<StoredProcedure>(), which is already populated with the version's currentVersionData by the surrounding GenericProvider, so historical versions resolve their own storedProcedureCode correctly.

How it was tested

  • Created a stored procedure, updated storedProcedureCode to bump to v0.2, then opened /versions/0.1 and /versions/0.2 — each version now renders its own historical code (v0.1 shows the original DDL, v0.2 shows the updated DDL).
  • Verified the non-version details page still renders code correctly (no regression).
  • Verified the Custom Properties tab on the version view still renders (no regression).
  • Existing Jest test file updated to mock the new child and assert it mounts in the version tab.
  • Mock fixture updated so storedProcedureCode matches the real StoredProcedureCodeObject shape.

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added a test that covers the exact scenario we are fixing.

@hyspacex hyspacex requested a review from a team as a code owner April 20, 2026 04:57
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 20, 2026

Code Review ✅ Approved

Updates the stored procedure version view to correctly populate the Code tab. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

[UI] Stored Procedure "Code" tab is empty when viewing historical versions (versions/0.x)

1 participant