Skip to content

Commit e5e39b5

Browse files
[docs] Add troubleshooting guide (#71) (#79)
* Add troubleshooting guide * Update wiki submodule pointer for PR #79 * Update wiki pointer Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * Update wiki submodule pointer for PR #79 --------- Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4122bba commit e5e39b5

3 files changed

Lines changed: 240 additions & 1 deletion

File tree

.github/wiki

Submodule wiki updated from f2283d4 to 5cea16d

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ fit together.
2424
api/index
2525
internals/index
2626
links/index
27+
troubleshooting
2728
faq

docs/troubleshooting.rst

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
Troubleshooting
2+
===============
3+
4+
Use this page when ``fast-forward/dev-tools`` fails locally or in GitHub
5+
Actions. Each entry starts with the visible symptom, then lists likely causes
6+
and safe recovery steps.
7+
8+
Composer Install or Authentication Failures
9+
-------------------------------------------
10+
11+
Scope: local and CI.
12+
13+
Symptoms:
14+
15+
- ``composer install`` cannot download a private package;
16+
- GitHub Actions reports an authentication or rate-limit error;
17+
- Composer asks for credentials in a non-interactive job.
18+
19+
Likely causes:
20+
21+
- the repository is missing ``COMPOSER_AUTH`` or a GitHub token secret;
22+
- the token does not have access to a private dependency;
23+
- Composer is trying to prompt in CI.
24+
25+
Recovery:
26+
27+
.. code-block:: bash
28+
29+
composer diagnose
30+
composer install -vvv
31+
32+
In CI, check that the workflow receives the expected secrets and that private
33+
repositories are available to the token used by Composer. Prefer repository or
34+
organization secrets over hard-coded credentials.
35+
36+
Missing ``vendor/`` or Lock-File Mismatch
37+
-----------------------------------------
38+
39+
Scope: local and CI.
40+
41+
Symptoms:
42+
43+
- ``composer dev-tools`` fails because a binary is missing;
44+
- CI installs a dependency set that differs from the local machine;
45+
- Composer reports that ``composer.lock`` is not compatible with
46+
``composer.json``.
47+
48+
Likely causes:
49+
50+
- ``vendor/`` was deleted or was created with a different PHP version;
51+
- ``composer.json`` changed without updating ``composer.lock``;
52+
- the local PHP version does not match the repository constraint.
53+
54+
Recovery:
55+
56+
.. code-block:: bash
57+
58+
php -v
59+
composer validate
60+
composer install
61+
62+
If Composer reports a lock mismatch, update the lock file intentionally and
63+
review the dependency diff:
64+
65+
.. code-block:: bash
66+
67+
composer update --lock
68+
git diff composer.lock
69+
70+
Branch Protection or Bot Commit Blocks
71+
--------------------------------------
72+
73+
Scope: GitHub Actions.
74+
75+
Symptoms:
76+
77+
- a wiki or reports preview job cannot push generated updates;
78+
- GitHub rejects a bot commit with a protected-branch error;
79+
- a pull request is mergeable locally but blocked after the preview job runs.
80+
81+
Likely causes:
82+
83+
- ``main`` is protected and the workflow tried to push there directly;
84+
- the workflow token cannot update pull request branches;
85+
- required status checks were changed after the pull request opened.
86+
87+
Recovery:
88+
89+
- confirm that preview jobs write to pull request branches or PR-specific
90+
preview locations;
91+
- keep final publishing jobs tied to merges into ``main``;
92+
- allow workflow-generated commits on pull request branches when the repository
93+
relies on generated wiki pointers;
94+
- rerun the workflow after branch protection settings are corrected.
95+
96+
``.github/wiki`` Submodule Pointer Conflicts
97+
--------------------------------------------
98+
99+
Scope: local and CI.
100+
101+
Symptoms:
102+
103+
- Git reports a conflict on ``.github/wiki``;
104+
- a pull request contains an unexpected submodule pointer change;
105+
- the wiki preview branch exists, but the parent repository points elsewhere.
106+
107+
Likely causes:
108+
109+
- ``main`` moved while the pull request had a generated wiki pointer;
110+
- the preview workflow produced a newer wiki commit;
111+
- the local submodule is stale.
112+
113+
Recovery for pull request ``123``:
114+
115+
.. code-block:: bash
116+
117+
git fetch origin main
118+
git rebase origin/main
119+
git -C .github/wiki fetch origin master pr-123
120+
git -C .github/wiki switch --detach origin/pr-123
121+
git add .github/wiki
122+
git rebase --continue
123+
git push --force-with-lease
124+
125+
If the preview branch no longer exists, regenerate the wiki preview before
126+
choosing a pointer.
127+
128+
No-TTY Process Errors
129+
---------------------
130+
131+
Scope: local scripts and CI.
132+
133+
Symptoms:
134+
135+
- a process fails with ``/dev/tty`` errors;
136+
- a command works in an interactive terminal but fails in GitHub Actions;
137+
- Composer or a wrapped tool waits for input forever.
138+
139+
Likely causes:
140+
141+
- a command expects an interactive terminal;
142+
- a tool is prompting for confirmation;
143+
- CI is missing required environment variables.
144+
145+
Recovery:
146+
147+
.. code-block:: bash
148+
149+
composer dev-tools -- --no-interaction
150+
151+
When calling lower-level tools directly, use their non-interactive flags and
152+
provide required values through environment variables or workflow inputs.
153+
154+
Coverage Threshold Failures
155+
---------------------------
156+
157+
Scope: local and CI.
158+
159+
Symptoms:
160+
161+
- PHPUnit passes tests but fails the job because coverage is too low;
162+
- a new class or branch is missing coverage metadata;
163+
- coverage reports differ between local and CI runs.
164+
165+
Likely causes:
166+
167+
- new behavior was added without tests;
168+
- Xdebug or PCOV is not enabled consistently;
169+
- coverage configuration changed in ``phpunit.xml``.
170+
171+
Recovery:
172+
173+
.. code-block:: bash
174+
175+
composer dev-tools tests
176+
composer dev-tools tests -- --coverage=public/coverage
177+
178+
Add focused tests for the changed behavior before lowering thresholds. If local
179+
coverage differs from CI, compare PHP, Xdebug or PCOV, and PHPUnit versions.
180+
181+
PHPDoc or Template Generation Issues
182+
------------------------------------
183+
184+
Scope: local and CI.
185+
186+
Symptoms:
187+
188+
- ``composer dev-tools docs`` fails during API documentation generation;
189+
- generated docs are missing classes or links;
190+
- PHPDoc validation fails after a source change.
191+
192+
Likely causes:
193+
194+
- a class is missing required PHPDoc metadata;
195+
- a docblock references a renamed class or method;
196+
- templates or generated output from an older run are stale.
197+
198+
Recovery:
199+
200+
.. code-block:: bash
201+
202+
composer dev-tools phpdoc
203+
composer dev-tools docs
204+
205+
Fix source PHPDoc first, then regenerate docs. Avoid editing generated API
206+
output directly; it should reflect source files and templates.
207+
208+
Reports or Wiki Preview Cleanup Issues
209+
--------------------------------------
210+
211+
Scope: GitHub Actions.
212+
213+
Symptoms:
214+
215+
- closed pull requests still show old report preview links;
216+
- a wiki preview branch remains after merge or close;
217+
- a PR comment points to a missing preview.
218+
219+
Likely causes:
220+
221+
- the cleanup workflow did not run on the pull request close event;
222+
- the workflow token lacks permission to update Pages or the wiki repository;
223+
- a preview was removed after the comment was posted.
224+
225+
Recovery:
226+
227+
- rerun the cleanup workflow for the closed pull request when available;
228+
- remove stale preview directories or branches only after confirming the pull
229+
request is closed or merged;
230+
- check the reports and wiki workflow logs before deleting artifacts manually.
231+
232+
Related References
233+
------------------
234+
235+
- :doc:`usage/github-actions`
236+
- :doc:`usage/documentation-workflows`
237+
- :doc:`usage/syncing-consumer-projects`
238+
- :doc:`running/index`

0 commit comments

Comments
 (0)