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

Ent Modernization #80

Merged
merged 19 commits into from
Nov 16, 2022
Merged

Ent Modernization #80

merged 19 commits into from
Nov 16, 2022

Conversation

KCarretto
Copy link
Collaborator

What type of PR is this?

/kind cleanup
/kind api-change

What this PR does / why we need it:

Updates us to use the latest and greatest entgo.io technology, and deletes a bunch of the old ents (since we will likely want to rewrite them with the new first party relay support in mind)

Which issue(s) this PR fixes:

Well I’m on mobile and didn’t write an issue, sorry team.

@KCarretto KCarretto changed the title Entgo bluesky Ent Modernization Nov 12, 2022
@KCarretto KCarretto added cleanup Code cleanup and tech debt removal api-change labels Nov 12, 2022
Ref("file").
Comment("Deployment Configurations that depend on this file."),
}
return []ent.Edge{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have the edges been removed here just since this PR is a clean slate or will we not being using edges in our models?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Clean slate o7

ent.Schema
}

// Fields of the Tome.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this describe the tome only on disk or as it's being passed to an agent as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Stores backend info, it will differ both from how it is stored on disk as well as from how it is passed to an agent (probably)

- github.com/kcarretto/realm/tavern/ent/implantserviceconfig
- github.com/kcarretto/realm/tavern/ent/tag
- github.com/kcarretto/realm/tavern/ent/target
- github.com/kcarretto/realm/tavern/ent/user
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably just my not understanding ent.go but do we need to include the tome scheme in here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it is now, but yeah you're right

Copy link
Collaborator

@hulto hulto 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.
Couple questions mostly for my clarification on how ent works.
One request to delete instead of commenting code.

@@ -4,24 +4,24 @@ import (
"context"

"github.com/kcarretto/realm/tavern/ent"
"github.com/kcarretto/realm/tavern/ent/credential"
// "github.com/kcarretto/realm/tavern/ent/credential"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should delete this instead of commenting just to avoid dead code piling up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I love dead code :(

@KCarretto KCarretto merged commit ba3383a into main Nov 16, 2022
@KCarretto KCarretto deleted the entgo-bluesky branch November 16, 2022 03:53
KCarretto added a commit that referenced this pull request Feb 1, 2024
 
Ent Modernization  (#80)

* It works?

* inject ent client

* Okay, looks like the mutations and such work

* Updated docs <3

* Tests <3

* Added test for update user

* Remove file mutations for now

* Upgrade to go 1.19.3

* Minor app cleanup

* Added tome entity

* Added support for 'users' query

* Added core ents

* Enum for Tag

* Implemented root query resolvers

* Delete stuff :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change cleanup Code cleanup and tech debt removal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants