Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(crafting-schema): add organization resolver #2465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

@Piskoo
Copy link
Collaborator

@Piskoo Piskoo commented Oct 14, 2025

This PR updates current organization middleware with handler for in schema defined organization.

Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
@Piskoo Piskoo marked this pull request as ready for review October 14, 2025 07:31
return "", err
}

return resourceBase.Metadata.Organization, nil
Copy link
Member

@migmartri migmartri Oct 14, 2025

Choose a reason for hiding this comment

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

what if it doesn't have metadata as is an old format?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated unmarshalling to not return an error when old schema is used

return "", nil
}
// Convert bytes to base64 string for consistent handling
return base64.StdEncoding.EncodeToString(rawBytes), nil
Copy link
Member

@migmartri migmartri Oct 14, 2025

Choose a reason for hiding this comment

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

why return strings and not bytes?

Copy link
Collaborator Author

@Piskoo Piskoo Oct 14, 2025
edited
Loading

Choose a reason for hiding this comment

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

Removed, it was there to make it consistent with platform

Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
// Extracts raw data
func getRawData(req interface{}) ([]byte, error) {
// Check if the request implements RequestWithRawContract
if rawContractReq, ok := req.(RequestWithRawContract); ok {
Copy link
Member

Choose a reason for hiding this comment

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

This is superspecific to contracts. I think we can deprecate the field raw_contract in the proto definition and call it raw_resource, for example, just to make it generic enough so that we can reuse this interface for other resources (policies, etc). Would it be possible?

Copy link
Member

Choose a reason for hiding this comment

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

I think we are using raw_schema in other places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Naming is all over the place, policies use raw_schema, policy groups raw_group, contracts raw_contract. Chainloop OSS will be only responsible for contracts so I think there's no need to add another field to proto def

jiparis reacted with thumbs up emoji
@Piskoo Piskoo merged commit 5751fb0 into chainloop-dev:main Oct 29, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@migmartri migmartri migmartri left review comments

@jiparis jiparis jiparis approved these changes

@javirln javirln Awaiting requested review from javirln

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /