Skip to content
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

enable using session with unmarshalable repository specs #512

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

fabianburth
Copy link
Contributor

What this PR does / why we need it:
The session's LookupRepository() method so far always calculated the respective key to cache the repository through calling json.Marshal on the RepositorySpec. This led to errors when the given RepositorySpec contained fields that cannot be Marshaled (such as file systems).
This PR introduces a Key(). Instead of calling json.Marshal, the LookupRepository() method now first checks whether the RepositorySpec implements Key() to provide an alternative key.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release Notes:

@fabianburth fabianburth marked this pull request as ready for review September 21, 2023 11:25
mandelsoft
mandelsoft previously approved these changes Sep 21, 2023
@fabianburth fabianburth merged commit 4fdca21 into open-component-model:main Sep 21, 2023
@fabianburth fabianburth deleted the session branch September 21, 2023 15:35
robertwol pushed a commit that referenced this pull request Sep 25, 2023
* enable using session with unmarshalable repository specs

* make Key function more generically usable

* move into global utils package

* make format
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