Skip to content

fix: use lib notebook for default notebook for aqora.load#201

Open
jpopesculian wants to merge 1 commit into
mainfrom
jpop/default-lib
Open

fix: use lib notebook for default notebook for aqora.load#201
jpopesculian wants to merge 1 commit into
mainfrom
jpop/default-lib

Conversation

@jpopesculian

@jpopesculian jpopesculian commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added audience-group targeting for events and competitions, including bulk creation and updates.
    • Workspaces now support separate overview and library notebooks, including clearer identification of notebook files.
    • Workspace notebook download/load can now target a specific workspace version.
  • Breaking Changes
    • Workspace cloning now uses a version-based selector (fromVersionId instead of fromWorkspaceId).
    • Workspace version updates now allow optional semver.
  • Bug Fixes
    • Notebook downloads now use the correct library-notebook fallback when no notebook is specified.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 67ee0de2-d8a4-47a0-8a2e-16f129f267f2

📥 Commits

Reviewing files that changed from the base of the PR and between 2bfe803 and c501757.

📒 Files selected for processing (7)
  • python/aqora/_aqora.pyi
  • python/aqora/notebook.py
  • schema.graphql
  • src/graphql/get_workspace_notebook_download_url.graphql
  • src/graphql/get_workspace_version_notebook_download_url.graphql
  • src/python_module.rs
  • src/workspace.rs
✅ Files skipped from review due to trivial changes (1)
  • src/graphql/get_workspace_version_notebook_download_url.graphql
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/graphql/get_workspace_notebook_download_url.graphql
  • schema.graphql

📝 Walkthrough

Walkthrough

This PR adds audience-group GraphQL schema support, updates workspace notebook/version metadata fields, and makes notebook download and Python loading version-aware. It also switches notebook selection to libNotebook and adds a version-specific download query.

Changes

Audience Group Targeting

Layer / File(s) Summary
Audience group types and inputs
schema.graphql
Defines the audience-group object, connection, edge, item, and bulk create/update inputs.
Audience fields on competition and event inputs
schema.graphql
Adds audience fields to competition and event create/update inputs and adds the event audience-group connection field.

Workspace Notebook Versioning

Layer / File(s) Summary
Workspace schema updates
schema.graphql
Changes workspace cloning and notebook metadata fields, makes workspace version optional in updates, and adds notebook-related fields on workspace, workspace version, and workspace file types.
Notebook download queries
src/graphql/get_workspace_notebook_download_url.graphql, src/graphql/get_workspace_version_notebook_download_url.graphql
Switches the latest-workspace notebook query to libNotebook and adds a version-specific notebook download query.
Version-aware notebook download and loading
src/workspace.rs, src/python_module.rs, python/aqora/notebook.py, python/aqora/_aqora.pyi
Introduces version-aware notebook metadata fetching in Rust, passes the version through the Python-exposed download API, and extends the Python notebook loader and type stubs with a version argument.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PythonLoader as python/aqora/notebook.py
  participant PyClient as PyClient._download_workspace_notebook
  participant RustWorkspace as download_workspace_notebook
  participant GraphQLQuery as GetWorkspaceVersionNotebookDownloadUrl

  PythonLoader->>PyClient: load(..., version)
  PyClient->>RustWorkspace: _download_workspace_notebook(..., version)
  RustWorkspace->>GraphQLQuery: fetch libNotebook and entries
  GraphQLQuery-->>RustWorkspace: notebook metadata and file URLs
  RustWorkspace-->>PyClient: downloaded notebook path
  PyClient-->>PythonLoader: loaded module
Loading

Possibly related PRs

  • aqora-io/cli#182: Introduced the notebook download flow that this PR extends with version-aware selection and libNotebook.
  • aqora-io/cli#183: Touches the same download API surface and notebook selection path updated here.
  • aqora-io/cli#189: Modifies python/aqora/notebook.py, which this PR extends with the version parameter.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main user-facing change: aqora.load now defaults to the lib notebook, with version-aware notebook loading added around it.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jpop/default-lib

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/workspace.rs (1)

37-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update stale "default notebook" wording after switch to lib_notebook.

The fallback now uses workspace.lib_notebook, but the error message and hint still reference "default notebook", which will confuse users.

💬 Proposed fix
     let notebook_name = notebook.or(workspace.lib_notebook).ok_or_else(|| {
         error::user(
             &format!(
-                "No notebook specified and workspace '{owner}/{slug}' has no default notebook"
+                "No notebook specified and workspace '{owner}/{slug}' has no lib notebook"
             ),
-            "Please provide a filename or set a default notebook on the workspace",
+            "Please provide a filename or set a lib notebook on the workspace",
         )
     })?;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/workspace.rs` around lines 37 - 44, Update the fallback error text in
workspace notebook selection to match the new lib_notebook terminology. In the
`notebook.or(workspace.lib_notebook).ok_or_else(...)` path, change the
`error::user` message and hint so they no longer mention “default notebook” and
instead refer to the workspace’s `lib_notebook` or equivalent current
terminology. Keep the fix localized to the notebook resolution logic in
`workspace.rs`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/workspace.rs`:
- Around line 37-44: Update the fallback error text in workspace notebook
selection to match the new lib_notebook terminology. In the
`notebook.or(workspace.lib_notebook).ok_or_else(...)` path, change the
`error::user` message and hint so they no longer mention “default notebook” and
instead refer to the workspace’s `lib_notebook` or equivalent current
terminology. Keep the fix localized to the notebook resolution logic in
`workspace.rs`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb1ce213-9b0d-4eaf-a6df-1da98b21f9eb

📥 Commits

Reviewing files that changed from the base of the PR and between 65859de and 2bfe803.

📒 Files selected for processing (3)
  • schema.graphql
  • src/graphql/get_workspace_notebook_download_url.graphql
  • src/workspace.rs

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.

1 participant