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 Admin and move its methods to JobManager #349

Merged
merged 1 commit into from
Nov 20, 2020
Merged

Conversation

ewjoachim
Copy link
Member

@ewjoachim ewjoachim commented Nov 13, 2020

Closes #333

Successful PR Checklist:

  • Tests
    • (not applicable?)
  • Documentation
    • (not applicable?)
  • Had a good time contributing?

def serial():
return itertools.count(1)


Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove this? The job_factory fixture still uses it…

Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if it wouldn't make more sense to make an undefered job, and then let the manager defer it. The InMemory backend already maintains a counter.

(Anyway, WIP :D )

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. But with this the object provided by the new job_factory fixture (that you'd named deferred_job_factory) would a coroutine function. So that would imply doing job = await job_factory(…) instead of job = job_factory(…) everywhere we use that fixture. That's a lot of changes. I'd suggest that, if we want to do that, we do it with a separate PR.


return factory


Copy link
Contributor

Choose a reason for hiding this comment

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

I also don't see the reason for this new fixture. It's not used currently.

for row in await self.connector.execute_query_all_async(
query=sql.queries["list_tasks"],
queue_name=queue,
name=task,
Copy link
Contributor

@elemoine elemoine Nov 15, 2020

Choose a reason for hiding this comment

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

It should be task_name=task here.

@elemoine
Copy link
Contributor

I added a WIP3 commit (a wommit in our new jargon :) that fixes the tests.

@codecov
Copy link

codecov bot commented Nov 15, 2020

Codecov Report

Merging #349 (dd0b2e6) into master (9553b9e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #349   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        28    -1     
  Lines         1575      1568    -7     
  Branches       172       171    -1     
=========================================
- Hits          1575      1568    -7     
Impacted Files Coverage Δ
procrastinate/app.py 100.00% <ø> (ø)
procrastinate/cli.py 100.00% <100.00%> (ø)
procrastinate/jobs.py 100.00% <100.00%> (ø)
procrastinate/manager.py 100.00% <100.00%> (ø)
procrastinate/shell.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9553b9e...dd0b2e6. Read the comment docs.

@elemoine elemoine force-pushed the admin-333 branch 2 times, most recently from cbf7485 to bf13f0b Compare November 20, 2020 10:19
@elemoine elemoine changed the title WIP - remove Admin 333 Remove Admin and move its methods to JobManager Nov 20, 2020
Remove the Admin class and move its methods to JobManager.

Co-authored-by: Éric Lemoine <[email protected]>
@elemoine elemoine marked this pull request as ready for review November 20, 2020 10:27
@elemoine
Copy link
Contributor

I fixed the tests, and improved the doc strings making sure that the generated API reference looks good.

I think this is ready for merging.

Copy link
Member Author

@ewjoachim ewjoachim left a comment

Choose a reason for hiding this comment

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

👍 (cannot approve my own PR)

@ewjoachim ewjoachim merged commit cef4062 into master Nov 20, 2020
@ewjoachim ewjoachim deleted the admin-333 branch November 20, 2020 13:20
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.

Admin and JobManager are ambiguous
2 participants