-
Notifications
You must be signed in to change notification settings - Fork 282
Add Dependents/Dependencies API for UCM Desktop #5876
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually just moved this over from GetDefinitions.hs
and generalized it to hold more than one endpoint, I'm surprised Git isn't smart enough to pick up on that :'(
|
||
-- | Servant utility for a query param that's required, providing a useful error message if it's missing. | ||
type RequiredQueryParam = Servant.QueryParam' '[Servant.Required, Servant.Strict] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types were all added so the output format can match what's on Share :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I don't really know what this file is... is it a debugfile thing (What's that?) or is it the dependents-dependencies transcript?
Hmmm we might need to support a by-hash as well (those come into place when clicking on a link in some source and then clicking dependents on that newly opened definition). I feel like I've seen the |
a68d185
to
b5dce6e
Compare
Yeah, actually the I'm happy to do either, I just copied existing (questionable) conventions for this one I went ahead and added a transcript for the by-hash case. |
fa48919
to
6061365
Compare
Also added the |
f66c830
to
833a4ec
Compare
a4498b3
to
e16ced0
Compare
Overview
Adds
/api/projects/<project>/branches/<branch>/getDefinitionDependen(ts|cies)?name=<fqn>
which lists the dependents/dependencies of a term in the same format as Share (includes the type signature, name, hash, kind, and tag).Implementation notes
dependents
anddependencies
implementations into core logic, which I moved into the Codebase module, and the CLI stuff which stayed behind so I can use bits of it outside of the Cli monad (we should probably depend less on Cli or split it up for commands going forwards, since more commands will be converted to APIs.See transcript for api format.
Note: @hojberg this doesn't support the
relativeTo
query param at the moment, the name must be the fqn and it returns all dependents within the scope of the project. Let me know if that needs to change.Test coverage
See transcripts