Skip to content

Allow creating/updating draft package revisions with a failing pipeline#194

Closed
kispaljr wants to merge 5 commits into
kptdev:mainfrom
nokia:allow-render-failure-in-drafts
Closed

Allow creating/updating draft package revisions with a failing pipeline#194
kispaljr wants to merge 5 commits into
kptdev:mainfrom
nokia:allow-render-failure-in-drafts

Conversation

@kispaljr
Copy link
Copy Markdown
Contributor

@kispaljr kispaljr commented Mar 8, 2025

See related discussion here: nephio-project/nephio#876

Right now the creation of a new draft PackageRevision fails if the pipeline in the kpt package fails. Isn't only proposal/approval should be rejected in this case? Similarly how we allow to create draft packages with not-ready readiness gates, and only check readiness at proposal/approval time.

This makes it very hard to debug cases, when an algorithm tries to create a new package (like a PackageVariant, or any other higher level controller). This means that the content of the newly created package is calculated, it doesn't exists on the developers machine, so she cannot try to fix the package by locally running kpt fn render or similar.
On the other hand if we allow the creation of a half-ready draft, it would allow the developer to download the faulty package and try to troubleshoot the problem. I believe the purpose of draft revisions is to allow the preparation of the final version of a package anyway.

@nephio-prow
Copy link
Copy Markdown
Contributor

nephio-prow Bot commented Mar 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kispaljr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nephio-prow nephio-prow Bot requested review from liamfallon and s3wong March 8, 2025 13:55
@nephio-prow nephio-prow Bot added the approved #ededed label Mar 8, 2025
@kispaljr kispaljr requested review from Catalin-Stratulat-Ericsson, mozesl-nokia and nagygergo and removed request for s3wong March 8, 2025 13:55
@nagygergo
Copy link
Copy Markdown
Contributor

Could you move the vendoring of the kpt function sdk libraries into a separate PR? I'm fine with it, just so it's not bundled with this one.

@Catalin-Stratulat-Ericsson
Copy link
Copy Markdown
Contributor

  • i agree also with what Istvan & Gergely are saying however i don't believe we should allow render to pass as you are describing UNTIL the render status is properly propagated through either in the packagerevision status section or somewhere easily ascertained by someone using porch. This was introduced as a temporary measure until that issue is handled,
  • if we remove the blocker at draft phase right now "faulty" rendered packages can be pushed through and no mention is logged regarding its faults and this can mistakenly be pushed through later in the system and even if this block gets pushed to the approved phase the user will get a return saying their package has some issue but when they inspect no mention will be made as to what this issue is from my understanding.
  • I believe the render status needs to be handled first then naturally this change can follow right behind it.

@Catalin-Stratulat-Ericsson
Copy link
Copy Markdown
Contributor

  1. after looking at the code a bit i see you are adding the render status in the kpt file itself, im not quite sure from first glance where you are storing this? in the conditions? or are you adding another section in the api for it.
  2. i believe we discussed about this before that if were making api changes on kpt on porch then a kpt "render" and a porch "render" will no longer be interchangeable.
  3. Is that something we are willing to live with? or am i misreading things somewhere?

@lapentad
Copy link
Copy Markdown
Contributor

/retest

@liamfallon
Copy link
Copy Markdown
Contributor

@kispaljr we have tweaked the Sonarcloud checks but i think you may need to rebase to pick up the tweaked config file.

@kispaljr
Copy link
Copy Markdown
Contributor Author

Could you move the vendoring of the kpt function sdk libraries into a separate PR? I'm fine with it, just so it's not bundled with this one.

@nagygergo Good idea, I did that: #212 . Unfortunately until that PR is merged all the changes related to the vendoring are also showing up in this change. I will update the original description soon to point to the important parts of the change.

@kispaljr kispaljr force-pushed the allow-render-failure-in-drafts branch 2 times, most recently from 7390344 to 13b49fc Compare March 26, 2025 00:11
@kispaljr kispaljr force-pushed the allow-render-failure-in-drafts branch from 13b49fc to 07aac3a Compare March 26, 2025 00:27
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
Image 35.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@kispaljr
Copy link
Copy Markdown
Contributor Author

  • i agree also with what Istvan & Gergely are saying however i don't believe we should allow render to pass as you are describing UNTIL the render status is properly propagated through either in the packagerevision status section or somewhere easily ascertained by someone using porch. This was introduced as a temporary measure until that issue is handled,

This PR adds a condition to the status of the Kptfile, that indicates the success or failure of the latest render.

Proposal and approval is rejected if this condition is false.

This condition is easily observed by any porch client either in the status of the PackageRevision object, or as part of the Kptfile.

@kispaljr
Copy link
Copy Markdown
Contributor Author

if we remove the blocker at draft phase right now "faulty" rendered packages can be pushed through and no mention is logged regarding its faults and this can mistakenly be pushed through later in the system and even if this block gets pushed to the approved phase the user will get a return saying their package has some issue but when they inspect no mention will be made as to what this issue is from my understanding.

The error that user gets when propose/approve is rejected, states clearly that the pipeline execution has failed, and the Message of the Render condition will even contain the full render status in JSON format

@kispaljr
Copy link
Copy Markdown
Contributor Author

kispaljr commented Mar 26, 2025

I believe the render status needs to be handled first then naturally this change can follow right behind it.

This change only handles the binary result (failed or succeeded ) of the render operation. I believe this is enough for this particular use case.

Making the full RenderStatus always available is still a good functionality to add, but it can come independently from this.

@kispaljr
Copy link
Copy Markdown
Contributor Author

after looking at the code a bit i see you are adding the render status in the kpt file itself, im not quite sure from first glance where you are storing this? in the conditions? or are you adding another section in the api for it.

Yes, I store a condition that stores the binary result of the last render. Since conditions are already a part of Kptfile, this doesn't require any API change

@kispaljr
Copy link
Copy Markdown
Contributor Author

i believe we discussed about this before that if were making api changes on kpt on porch then a kpt "render" and a porch "render" will no longer be interchangeable.

Since conditions are already a part of Kptfile, this doesn't require any API change. That leaves kpt render and porch render as compatible as it is now.

@efiacor
Copy link
Copy Markdown
Contributor

efiacor commented May 7, 2025

Hi @kispaljr ,
Is this PR still blocked or?

@kispaljr
Copy link
Copy Markdown
Contributor Author

This code is so old that is not meaningful anymore.

@kispaljr kispaljr closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants