You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created a few issues around some type annotation and idiomatic style awkwardness I've felt exist with the Jobs API from the standpoint of nautobot-plugin-ssot. I'm creating this as an overall discussion item because I think there should be some conversation around the design of the API so that you can ensure it's idiomatic and hard to do the wrong thing. The things I've noticed:
App / Plugin / Job Developers are encouraged it seems to use the nautobot.apps module. I think this makes sense overall as it would allow the core project to iterate while maintaining a stable API for plugins / jobs to consume. However:
The way to consume the logger is a bit muddy and there's many examples and the docs seem to encourage any usage. Probably should have one consistent way that takes into account nautobot-plugin-ssot's case (but don't pass job=self)
The grouping behavior of setting name at the top level of the module is awkward now that you have to call register_jobs(). A better approach would probably be to have register_jobs() take a kwarg of name or grouping and pass that in and it would cover all jobs that were passed in.
Need to think about and expand on examples around testing jobs inside of plugins or repos. The way tests are run it causes almost no code to be tested in nautobot-plugin-ssot.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've created a few issues around some type annotation and idiomatic style awkwardness I've felt exist with the Jobs API from the standpoint of nautobot-plugin-ssot. I'm creating this as an overall discussion item because I think there should be some conversation around the design of the API so that you can ensure it's idiomatic and hard to do the wrong thing. The things I've noticed:
nautobot.apps
module. I think this makes sense overall as it would allow the core project to iterate while maintaining a stable API for plugins / jobs to consume. However:job=self
)name
at the top level of the module is awkward now that you have to callregister_jobs()
. A better approach would probably be to haveregister_jobs()
take a kwarg ofname
orgrouping
and pass that in and it would cover all jobs that were passed in.Beta Was this translation helpful? Give feedback.
All reactions