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

Remove EntitySource #108

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

perdasilva
Copy link
Contributor

@perdasilva perdasilva commented Jul 18, 2023

This PR replaces #95 by rebasing it and fixing merge conflicts. The intent of this PR is to remove the concepts of EntitySource and Entity from Deppy. The VariableSource interface can be implemented with access to specific backend clients (e.g. registry, kube client, etc.) in order to provide their Variables.

Closes #97

@perdasilva perdasilva requested a review from a team as a code owner July 18, 2023 14:39
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #108 (54375ee) into main (4c15c99) will increase coverage by 3.54%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main     #108      +/-   ##
==========================================
+ Coverage   61.90%   65.45%   +3.54%     
==========================================
  Files          16       11       -5     
  Lines         567      495      -72     
==========================================
- Hits          351      324      -27     
+ Misses        198      152      -46     
- Partials       18       19       +1     
Files Changed Coverage Δ
cmd/dimacs/cmd.go 0.00% <0.00%> (ø)
cmd/dimacs/dimacs_constraints.go 67.85% <100.00%> (+67.85%) ⬆️
pkg/deppy/solver/solver.go 82.85% <100.00%> (-0.48%) ⬇️

... and 1 file with indirect coverage changes

@ncdc
Copy link
Member

ncdc commented Jul 18, 2023

Is there some background on this change?

@ncdc
Copy link
Member

ncdc commented Jul 18, 2023

I take it this is for #97? And it presumably replaces #95?

@perdasilva perdasilva force-pushed the rewrite/entitysrc-per branch from a585358 to 32471fb Compare August 2, 2023 11:20
@perdasilva
Copy link
Contributor Author

Sorry @ncdc - I started this just before I left for holidays. Yeah, the idea was to take Varsha's PR, rebase, fix and put it back here. I'll fill out the description and tie it to a ticket.

@perdasilva perdasilva force-pushed the rewrite/entitysrc-per branch 11 times, most recently from e3c8255 to beb7312 Compare August 7, 2023 16:34
Copy link
Member

@m1kola m1kola left a comment

Choose a reason for hiding this comment

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

The change looks good to me apart from removal of rand.Seed.

Updating operator-controller will be fun. And I'll be missing predicates.

// adapted from: https://github.com/go-air/gini/blob/871d828a26852598db2b88f436549634ba9533ff/sudoku_test.go#L10
variables := make(map[deppy.Identifier]*input.SimpleVariable, 0)
inorder := make([]deppy.Variable, 0)
rand.Seed(time.Now().UnixNano())
Copy link
Member

Choose a reason for hiding this comment

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

We are not on Go 1.20 yet in Deppy:

deppy/go.mod

Line 3 in d928511

go 1.19

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I just merged the Go 1.20 bump. Need to rebase here now, it looks like.

@tmshort
Copy link

tmshort commented Aug 10, 2023

Requires another rebase...

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2023
varshaprasad96 and others added 5 commits August 11, 2023 11:37
Removes Entity and EntitySource. The solver takes in
the Variable Source directly. The constraints, filters, sort
or any transformation should be performed on variables before
providing it to solver.

Signed-off-by: Varsha Prasad Narsing <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
@perdasilva perdasilva force-pushed the rewrite/entitysrc-per branch from beb7312 to 54375ee Compare August 11, 2023 09:38
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2023
Copy link
Member

@m1kola m1kola left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@perdasilva perdasilva merged commit f4b138b into operator-framework:main Aug 15, 2023
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.

Remove the EntitySource API and replace it with the VariableSource API
7 participants