Skip to content

Document Task progress api - #1710

Open
brendanheywood wants to merge 1 commit into
moodle:mainfrom
brendanheywood:task-progress
Open

brendanheywood wants to merge 1 commit into
moodle:mainfrom
brendanheywood:task-progress

Conversation

@brendanheywood

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings September 28, 2026 00:56
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8a043ea
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6ab9c0ed4b46000008cd5c3a
😎 Deploy Preview https://deploy-preview-1710--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The adhoc stored-progress initialization issue must be corrected before approval.

Review effort: Lite
Findings: 4 Medium severity

Open (4)
What changed in this PR

Documents task progress and stored progress polling APIs across current and versioned Moodle documentation.

Changes:

  • Adds scheduled and adhoc task progress examples.
  • Documents polling and cleanup behavior.
  • Mirrors updates across Moodle 4.5–5.2.
File Summary and findings
versioned_docs/​version-5.2/​apis/​subsystems/​task/​index.md Adds task progress guidance. Moderate (4 votes): queue adhoc tasks before initializing stored progress. Nit (1 vote): add polling/rendering instructions.
versioned_docs/​version-5.2/​apis/​subsystems/​output/​index.md Documents polling and cleanup. Nit (1 vote each, reported twice): clarify cleanup behavior for records with old lastupdate values.
versioned_docs/​version-5.1/​apis/​subsystems/​task/​index.md Adds task progress guidance. Moderate (4 votes): queue adhoc tasks before initializing stored progress. Nit (1 vote): add polling/rendering instructions.
versioned_docs/​version-5.1/​apis/​subsystems/​output/​index.md Documents polling and cleanup. Nit (1 vote): clarify cleanup behavior for records with old lastupdate values.
versioned_docs/​version-5.0/​apis/​subsystems/​task/​index.md Adds task progress guidance. Moderate (4 votes): queue adhoc tasks before initializing stored progress. Nit (1 vote): add polling/rendering instructions.
versioned_docs/​version-5.0/​apis/​subsystems/​output/​index.md Documents polling and cleanup. Nit (1 vote): clarify cleanup behavior for records with old lastupdate values.
versioned_docs/​version-4.5/​apis/​subsystems/​task/​index.md Adds task progress guidance. Nit (1 vote): add polling/rendering instructions.
versioned_docs/​version-4.5/​apis/​subsystems/​output/​index.md Documents polling and cleanup.
docs/​apis/​subsystems/​task/​index.md Adds task progress guidance. Moderate (4 votes): queue adhoc tasks before initializing stored progress. Nit (1 vote): add polling/rendering instructions.
docs/​apis/​subsystems/​output/​index.md Documents polling and cleanup. Nit (1 vote): clarify cleanup behavior for records with old lastupdate values.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/apis/subsystems/task/index.md Outdated
Comment thread versioned_docs/version-5.0/apis/subsystems/task/index.md Outdated
Comment thread versioned_docs/version-5.1/apis/subsystems/task/index.md Outdated
Comment thread versioned_docs/version-5.2/apis/subsystems/task/index.md Outdated

@safatshahin safatshahin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @brendanheywood
Thank you working on his. The patch is looking great, some quick ones worth fixing:

  1. Broken links on main: Both links point to main/admin/tool/task/, since the move to public/ folder in 5.1, that path returns 404 on main. Either link to public/admin/tool/task/..., or, better, pin each versioned doc to its stable branch (e.g. MOODLE_405_STABLE).
  2. One code comment is misleading: In the 5.x versions, the comment says start_stored_progress() "updates the stored progress record with a start time". That's only true if a pending record already exists; otherwise it creates a new one. The 4.5 wording ("creates the stored progress record") is closer.
  3. Cleanup doesn't catch every record: The cleanup task deletes rows where lastupdate < 24h ago. A pending record that was never updated has a NULL lastupdate, so it won't be deleted. The docs say records "not updated within the last 24 hours" are removed, which overstates it. It could use a short caveat, or be raised as a core bug.
  4. Super minor
  • The example message 'i am at ' . $i would be nicer as a get_string() or at least properly capitalised.
  • The display example assigns $idnumber twice in a row, which reads like a mistake. An if/else or separate snippets would be clearer.

Cheers!

This branch has not been deployed

No deployments
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.

3 participants