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

Create task for initial device provisioning #13102

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AlexVelezLl
Copy link
Member

Summary

  • Create task for initial device provisioning

Note: Welcome modal for LOD and on my own devices not appearing is not a regression from this PR, and its probably related to the same cause as #13071

References

Closes #12753

Reviewer guidance

Play with the setup wizard and check that the device is successfully provisioned for all its variants

@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: frontend labels Feb 21, 2025
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Let's leave the task API untouched for now, this close to release!

throw new Error('Device provisioning task not found');
}
if (task.status === TaskStatuses.COMPLETED) {
const facilityId = task.result.facility_id;
Copy link
Member

Choose a reason for hiding this comment

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

Add this to the extra_metadata instead, rather than updating the API endpoint to return result.

@@ -100,6 +100,7 @@ def _job_to_response(self, job):
"args": job.args,
"kwargs": job.kwargs,
"extra_metadata": job.extra_metadata,
"result": job.result,
Copy link
Member

Choose a reason for hiding this comment

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

Let's not add this, and just utilize extra_metadata instead.

provision_device(**provisioning_data)

schedule_ping() # Trigger telemetry pingback after we've provisioned

Copy link
Member

Choose a reason for hiding this comment

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

job = get_current_job()
if job:
    job.update_metadata(facility_id=facility.id)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle initial device provisioning in an async task rather than a synchronous API request
2 participants