feat(ci): add /explain-ci bot command for PR failure help#60821
Draft
miaulalala wants to merge 1 commit into
Draft
feat(ci): add /explain-ci bot command for PR failure help#60821miaulalala wants to merge 1 commit into
miaulalala wants to merge 1 commit into
Conversation
2a82f09 to
a893f1f
Compare
- Adds `.github/workflows/ci-bot.yml`: slash command `/explain-ci` on
any PR triggers nextcloud-bot to post a summary of all currently-
failing checks with purpose, fix steps, Docker commands, and
prerequisites. Covers all ~40 PR-facing workflows. Uses the
`issue_comment` trigger (works on fork PRs) and posts via
`COMMAND_BOT_PAT`, matching the `/compile` and `/update-3rdparty`
pattern.
- Extends `autotest.sh` with Docker-backed service helpers so external-
service CI failures can be reproduced locally without manual setup:
- `EXTERNAL_STORAGE=ftp/sftp/smb/webdav/amazons3` — spins up the
relevant service container, installs Nextcloud, enables
files_external, runs the storage tests, and tears down the container
- `PRIMARY_STORAGE_CONFIG=s3/azure USEDOCKER=1` — spins up MinIO or
Azurite as primary object store
- `ENABLE_MEMCACHE=memcached USEDOCKER=1` — spins up Memcached
- Pre-flight checks warn about missing system dependencies before
wasting time on an install
- Adds `tests/memcached.config.php` for Memcached cache configuration
AI-Assisted-By: claude-sonnet-4-6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
063c0a7 to
a767e76
Compare
|
|
||
| echo "Using database $DATABASENAME" | ||
|
|
||
| function execute_external_tests { |
Member
There was a problem hiding this comment.
You're aware of autotest-external.sh?
| with: | ||
| github-token: ${{ secrets.COMMAND_BOT_PAT }} | ||
| script: | | ||
| const WORKFLOW_EXPLANATIONS = { |
Member
There was a problem hiding this comment.
I fear that the keys will get out of sync and we won't notice. I don't have a good solution for it though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/ci-bot.yml: a new slash-command bot triggered by commenting/explain-cion any pull requestnextcloud-botreacts to the comment with 👍 and posts a single summary of all currently-failing CI checks, explaining what each one validates and how to fix it locallyautotest.shwith Docker-backed service helpers for local reproduction of external-service CI failuresHow the bot works
The bot uses the
issue_commenttrigger (same pattern as/compileand/update-3rdparty), so it has access toCOMMAND_BOT_PATand works on fork PRs too. It:Workflows covered
All PHPUnit variants (SQLite, MariaDB, MySQL, PostgreSQL, OCI, nodb, 32bits, memcached, sharding, primary object store, all files_external backends), ESLint, Stylelint, PHP lint, PHP-CS-Fixer, Psalm, Cypress, Node build/tests, REUSE, OpenAPI, Rector, Behat integration tests (DAV, Litmus, SQLite), object storage tests (S3, Azure, Swift), Samba Kerberos SSO, Code checkers, block checks (fixup commits, unconventional commits, outdated 3rdparty/), and CodeQL.
New
autotest.shDocker service helpersautotest.shnow supports spinning up Docker-backed external services automatically, making it possible to reproduce CI failures locally without any manual container setup:EXTERNAL_STORAGE=ftpfiles_externalFTP testsEXTERNAL_STORAGE=sftpfiles_externalSFTP testsEXTERNAL_STORAGE=smbfiles_externalSMB testsEXTERNAL_STORAGE=webdavfiles_externalWebDAV testsEXTERNAL_STORAGE=amazons3files_externalS3 testsPRIMARY_STORAGE_CONFIG=s3 USEDOCKER=1PRIMARY_STORAGE_CONFIG=azure USEDOCKER=1ENABLE_MEMCACHE=memcached USEDOCKER=1tests/memcached.config.phpEach helper installs Nextcloud, enables the relevant app/config, waits for the service to be healthy, runs the tests, and tears down the container — no manual cleanup needed. Pre-flight checks catch missing system dependencies (e.g.
php-smbclient,smbclientbinary) before wasting time on an install.Example usage
Comment
/explain-cion a PR with failing checks →nextcloud-botreplies:Test plan
/explain-cion a PR with at least one failing check → bot reacts with 👍 and posts summary/explain-cion a PR where all checks pass → bot replies "no failing checks found"/explain-cion a fork PR → bot works (issue_comment runs in base repo context)/explain-ci→ only still-failing checks appear in summaryEXTERNAL_STORAGE=ftp NOCOVERAGE=1 ./autotest.sh→ all FTP tests passEXTERNAL_STORAGE=amazons3 NOCOVERAGE=1 ./autotest.sh→ all S3 tests passPRIMARY_STORAGE_CONFIG=s3 USEDOCKER=1 NOCOVERAGE=1 ./autotest.sh sqlite lib/Files/ObjectStore/S3Test.php→ MinIO tests pass🤖 Generated with Claude Code