Add --no-cache global flag to bypass Drupal.org CDN caching#325
Add --no-cache global flag to bypass Drupal.org CDN caching#325
--no-cache global flag to bypass Drupal.org CDN caching#325Conversation
Co-authored-by: mglaman <3698644+mglaman@users.noreply.github.com>
--no-cache global flag to bypass Drupal.org CDN caching
There was a problem hiding this comment.
Pull request overview
Adds a global CLI switch to bypass Drupal.org’s CDN/Varnish caching so agents can fetch fresh issue/comment data, and updates the agent skill docs to stop referencing a non-existent cache command.
Changes:
- Add global
--no-cacheSymfony Console option available to all commands. - Thread the flag through command initialisation into the Drupal.org API
Client. - Update
skills/drupalorg-cli/SKILL.mdto removecache:clearand document cache bypass usage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Cli/Command/Command.php | Reads --no-cache from input and passes it into the API client. |
| src/Cli/Application.php | Registers --no-cache as a global console option. |
| src/Api/Client.php | Adds request headers when cache bypass is enabled. |
| skills/drupalorg-cli/SKILL.md | Documents --no-cache and removes invalid cache:clear guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -31,16 +31,22 @@ public function __construct() | |||
| 'default_retry_multiplier' => 1.5, | |||
| ]), 'retry'); | |||
|
|
|||
| $headers = [ | |||
| 'User-Agent' => 'DrupalOrgCli/0.0.1', | |||
| 'Accept' => 'application/json', | |||
| 'Accept-Encoding' => '*', | |||
| ]; | |||
| if ($noCache) { | |||
| $headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'; | |||
| $headers['Pragma'] = 'no-cache'; | |||
| } | |||
There was a problem hiding this comment.
This new --no-cache behavior is user-facing and implemented in the HTTP client constructor, but there’s no test asserting that new Client(true) actually sets the expected request headers on the underlying Guzzle client. Since the repo has PHPUnit coverage for actions, please add a small unit test for Client that inspects the Guzzle client config/handler to verify the headers are applied when the flag is enabled (and absent when disabled).
| `--no-cache` sends `Cache-Control: no-cache, no-store, must-revalidate` and | ||
| `Pragma: no-cache` headers so the upstream CDN returns a fresh response. | ||
|
|
There was a problem hiding this comment.
The docs state --no-cache sends Cache-Control: no-cache, no-store, must-revalidate, but must-revalidate isn’t a request directive and may be ignored. Update this section to reflect the actual (standards-aligned) request headers that will be sent after adjusting the client header value.
| `--no-cache` sends `Cache-Control: no-cache, no-store, must-revalidate` and | |
| `Pragma: no-cache` headers so the upstream CDN returns a fresh response. | |
| `--no-cache` sends a `Cache-Control: no-cache` request header so the upstream CDN will revalidate and return a fresh response where supported. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
issue:show --with-comments --format=llmreturns stale data when Drupal.org's CDN serves a cached response, making it impossible for agents to see recently-posted comments. The skill docs also listed adrupalorg cache:clearcommand that doesn't exist, actively causing agent failures.Changes
Client::__construct(bool $noCache = false)— when set, addsCache-Control: no-cache, no-store, must-revalidate+Pragma: no-cacheto all Guzzle requestsApplication::getDefaultInputDefinition()— injects--no-cacheas a Symfony Console global option; available on every command with no per-command changes requiredCommand::initialize()— reads--no-cachevia$input->hasOption()and passes it toClientskills/drupalorg-cli/SKILL.md— removes the non-existentcache:clearentry; adds a## Cache Bypasssection documenting--no-cache# Fetch fresh issue data, bypassing CDN cache drupalorg issue:show 3578142 --with-comments --format=llm --no-cacheWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/caseyamcl/guzzle_retry_middleware/zipball/17c9299cde438b00bbeb099c6480319a81636a60/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/consolidation/self-update/zipball/714b09fdf0513f83292874bb12de0566066040c2/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/czproject/git-php/zipball/1f1ecc92aea9ee31120f4f5b759f5aa947420b0a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/dg/rss-php/zipball/18f00ab1828948a8cfe107729ca1f11c20129b47/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/doctrine/deprecations/zipball/d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/jolicode/JoliNotif/zipball/a10a7cb3bf6dbf8833d1d1f1f0554506cb1d9eaa/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/modelcontextprotocol/php-sdk/zipball/1f5f7e16a3af23dd43ec0a5c972d7aa8e8429024/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/opis/json-schema/zipball/8458763e0dd0b6baa310e04f1829fc73da4e8c8a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/opis/string/zipball/3e4d2aaff518ac518530b89bb26ed40f4503635e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/opis/uri/zipball/0f3ca49ab1a5e4a6681c286e0b2cc081b93a7d5a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/5cee1d3dfc2d2aa6599834520911d246f656bcb8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a004701b11273a26cd7955a61d67a7f1e525a45a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/a22b36b955a2e9a3d39fe533b6c1bb5359f9c319/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b21c03d4f6f3a446e4311155f4be9d65048218e6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpstan/phpstan-symfony/zipball/7e78605a699d183f5a6936cf91904f4c16ca79b2/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/phpstan/phpstan/zipball/fcf8b71aeab4e1a1131d1783cef97b23a51b87a9/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3f7dd5066ebde5809296a81f0b19e8b00e5aab49/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/console/zipball/0bc2199c6c1f05276b05956f1ddc63f6d7eb5fc3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/filesystem/zipball/441c6b69f7222aadae7cbf5df588496d5ee37789/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/finder/zipball/9590e86be1d1c57bfbb16d0dd040345378c20896/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/process/zipball/c46e854e79b52d07666e43924a20cb6dc546644e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/string/zipball/50590a057841fa6bf69d12eceffce3465b9e32cb/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/symfony/uid/zipball/6b973c385f00341b246f697d82dc01a09107acdd/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ELTx8V /usr/bin/composer install --quiet(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
drupalorg issue:show --format=llmunable to find latest comments #321📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.