Skip to content

fix(ci): drop nc31; add nc34#449

Open
oleksandr-nc wants to merge 5 commits into
mainfrom
fix/ci-drop-nc31-add-nc34
Open

fix(ci): drop nc31; add nc34#449
oleksandr-nc wants to merge 5 commits into
mainfrom
fix/ci-drop-nc31-add-nc34

Conversation

@oleksandr-nc

@oleksandr-nc oleksandr-nc commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Mark failed circles tests with xfail

Summary by CodeRabbit

  • Bug Fixes
    • Improved TalkBot secret handling by persisting the registration secret server-side so other workers can sign requests reliably.
  • Documentation
    • Updated TalkBot registration notes to clarify secret storage behavior across AppAPI versions.
  • Tests
    • Marked a known flaky local-circle test as expected to fail due to an upstream HTTP 400 permission regression.
  • Chores
    • Refined CI workflow branch matrices and checkout pinning for multiple database targets, and added a Notifications build step when required.

Nextcloud 31 is removed from the analysis-coverage matrix and Nextcloud
34 takes its place across the OCI, PgSQL and SQLite/client jobs, keeping
the job count unchanged. The Notes checkout condition is simplified to
pin only stable32 to the 4.x line (Notes v5 requires NC >= 33).

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Creating a local circle through an ExApp (app mode) started returning
HTTP 400 after the nextcloud/circles local-controller permission changes
landed on the stable branches in mid-2026. The request is well-formed
(client mode is unaffected), so this is an upstream Circles regression,
not an nc_py_api bug. Mark the test xfail (non-strict) so CI stays green
and an xpass flags the day Circles is fixed on the stable branches.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: caa54cde-8fe6-4177-aaf1-edfd4cb55859

📥 Commits

Reviewing files that changed from the base of the PR and between f4bbf65 and 9cf12d3.

📒 Files selected for processing (2)
  • nc_py_api/nextcloud.py
  • nc_py_api/talk_bot.py

📝 Walkthrough

Walkthrough

Updates CI branch coverage and checkout handling, persists TalkBot secrets into appconfig_ex for sync and async paths, and marks one teams test as expected to fail.

Changes

CI Workflow and Test Updates

Layer / File(s) Summary
Global branch and naming updates
.github/workflows/analysis-coverage.yml
Global NEXTCLOUD_BRANCH is set to stable33, and the OCI job display name is updated to match.
Test matrix and checkout ref updates
.github/workflows/analysis-coverage.yml
MariaDB pins only stable32 to v4.13.1, PostgreSQL switches to stable32/stable34, and SQLite switches to stable33/stable34 with nextcloud/notes always checked out from main.
Notifications checkout install step
.github/workflows/analysis-coverage.yml
A conditional composer install step is added when Notifications needs a generated vendor/autoload.php for stable34.

TalkBot Secret Persistence

Layer / File(s) Summary
TalkBot secret persistence
nc_py_api/nextcloud.py, nc_py_api/talk_bot.py
register_talk_bot docstrings describe version-specific secret handling, and TalkBot.enabled_handler stores the returned secret in appconfig_ex with sensitive=True after registration.
AsyncTalkBot secret persistence
nc_py_api/nextcloud.py, nc_py_api/talk_bot.py
The async registration docs are updated to the same secret-handling contract, and AsyncTalkBot.enabled_handler persists the bot secret in appconfig_ex with sensitive=True.

Teams Test Xfail

Layer / File(s) Summary
Xfail marker for local circle test
tests/actual_tests/teams_test.py
Adds pytest.mark.xfail(strict=False) with a regression note to test_teams_local_circle.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • cloud-py-api/nc_py_api#436: Both PRs adjust analysis-coverage.yml checkout pinning logic for nextcloud/notes across stable branch matrices.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 CI matrix change by removing Nextcloud 31 and adding 34, though it omits the code and test updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 fix/ci-drop-nc31-add-nc34

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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/analysis-coverage.yml (1)

548-554: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Dead conditional branch: sqlite matrix never includes stable32.

The sqlite job matrix (Line 518) only contains stable33/stable34, so matrix.nextcloud == 'stable32' here always evaluates false — the ref always resolves to main. Functionally correct but the copy-pasted conditional is misleading; could simplify to a hardcoded main for this job.

🤖 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 @.github/workflows/analysis-coverage.yml around lines 548 - 554, The
conditional in the Checkout Notes step is dead for this sqlite job because the
matrix only ever uses stable33 and stable34, so matrix.nextcloud == 'stable32'
can never be true. Update the Checkout Notes configuration to remove the
unreachable branch and reference the existing Checkout Notes step in the
workflow, simplifying ref to the fixed target actually used here (main) for this
job.
🤖 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.

Inline comments:
In @.github/workflows/analysis-coverage.yml:
- Line 518: The matrix entry for nextcloud uses bracket spacing that violates
YAMLlint. Update the nextcloud matrix definition to match the same compact
bracket style used elsewhere in the workflow, and check the surrounding matrix
keys in analysis-coverage.yml for consistent YAMLlint-compliant formatting.
- Line 341: Fix the YAML bracket spacing in the `nextcloud` matrix entry so it
matches YAMLlint expectations. Update the array formatting in the workflow
definition to remove the extra spaces inside the brackets while keeping the same
values (`stable32` and `stable34`) in the same `nextcloud` section.

In `@tests/actual_tests/teams_test.py`:
- Around line 325-330: The xfail on the affected test is too broad because it
will hide unrelated failures; tighten the marker in the teams test by adding a
raises= constraint to the pytest.mark.xfail around the ExApp local circle
creation case. Use the specific exception type thrown for the HTTP 400 path from
nc_py_api (for example the NextcloudException returned by the call in the test)
so only the documented Circles regression is treated as expected failure while
other test regressions still fail normally.

---

Outside diff comments:
In @.github/workflows/analysis-coverage.yml:
- Around line 548-554: The conditional in the Checkout Notes step is dead for
this sqlite job because the matrix only ever uses stable33 and stable34, so
matrix.nextcloud == 'stable32' can never be true. Update the Checkout Notes
configuration to remove the unreachable branch and reference the existing
Checkout Notes step in the workflow, simplifying ref to the fixed target
actually used here (main) for this job.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 611bfcf8-021e-4db3-abd4-7fbe7764b53c

📥 Commits

Reviewing files that changed from the base of the PR and between a343e7f and 679eb63.

📒 Files selected for processing (2)
  • .github/workflows/analysis-coverage.yml
  • tests/actual_tests/teams_test.py

Comment thread .github/workflows/analysis-coverage.yml
Comment thread .github/workflows/analysis-coverage.yml
Comment thread tests/actual_tests/teams_test.py
The new stable34 matrix entries failed during Nextcloud setup:

- notifications since stable34 pulls a Composer dependency (web-push) and its
  composer/autoload.php now requires vendor/autoload.php, which a plain git
  checkout does not contain. Build the app when the checked-out branch needs
  it (older branches load without a vendor dir, so the step is a no-op there).
- NC >= 34 sets the DB session timezone to Etc/UTC, which the EOL oracle-xe:11
  image cannot resolve (ORA-01882). Keep the OCI job on stable33 until the
  Oracle image is bumped to 18+; stable34 stays covered by the PgSQL and
  SQLite jobs.

Also drop the now dead stable32 branch from the sqlite Notes checkout ref.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Add raises=NextcloudException so only the documented Circles HTTP 400 is
treated as an expected failure; any other error in the test still fails
normally.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>

@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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@nc_py_api/nextcloud.py`:
- Around line 390-395: The docstring for register_talk_bot should explicitly
tell direct consumers how to persist the returned secret instead of only
pointing to TalkBot.enabled_handler. Update the note to mention that callers who
do not use TalkBot/AsyncTalkBot must store the secret themselves with
appconfig_ex.set_value(bot_id, bot_secret, sensitive=True) or equivalent,
alongside the existing AppAPI 34+ behavior note, so the public method
documentation clearly covers the new compatibility requirement.

In `@nc_py_api/talk_bot.py`:
- Around line 133-140: The new appconfig persistence in `enabled_handler` can
throw after `register_talk_bot` has already succeeded, which can break the
enable flow and leave the bot half-configured. Update the `enabled_handler` path
around `nc.appconfig_ex.set_value` to catch and handle persistence failures
explicitly, so the secret is still set in `os.environ` and the failure is
surfaced as a clear warning or log message instead of propagating. Use the
existing `register_talk_bot`, `appconfig_ex.set_value`, and `enabled_handler`
symbols to keep the fix localized and make retries or later recovery possible.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 05d47b35-98fd-4071-b235-87dfef5342cf

📥 Commits

Reviewing files that changed from the base of the PR and between 643b1e6 and f4bbf65.

📒 Files selected for processing (2)
  • nc_py_api/nextcloud.py
  • nc_py_api/talk_bot.py

Comment thread nc_py_api/nextcloud.py
Comment thread nc_py_api/talk_bot.py
@oleksandr-nc oleksandr-nc force-pushed the fix/ci-drop-nc31-add-nc34 branch from f4bbf65 to 643b1e6 Compare July 7, 2026 15:19
AppAPI 34 moved TalkBot bookkeeping to a dedicated table and no longer
mirrors the bot secret into `appconfig_ex`, which `get_bot_secret` reads
back. So any ExApp process that did not itself register the bot (a second
uvicorn worker, or the test's callback server) raised "Can't find the
'secret' of the bot" and never replied on NC 34.

Persist the secret from `enabled_handler` under a nc_py_api-owned
`appconfig_ex` key (a hash distinct from `bot_id`) and read it back as an
extra fallback in `get_bot_secret`. The key is deliberately NOT `bot_id`:
AppAPI <= 33 still owns and re-reads that key on re-registration, so writing
there ourselves makes it mint a different secret and Talk rejects the
re-install. This leaves 32/33 untouched and fixes multi-worker bots on 34.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.69%. Comparing base (9058723) to head (9cf12d3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #449      +/-   ##
==========================================
+ Coverage   94.67%   94.69%   +0.01%     
==========================================
  Files          48       48              
  Lines        5636     5650      +14     
==========================================
+ Hits         5336     5350      +14     
  Misses        300      300              
Files with missing lines Coverage Δ
nc_py_api/nextcloud.py 94.87% <ø> (ø)
nc_py_api/talk_bot.py 63.63% <100.00%> (+2.66%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oleksandr-nc oleksandr-nc requested a review from kyteinsky July 7, 2026 16:01
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