Repository navigation
fix(rest): wait for pending code security attachments and retry on 409 - #972
Merged
Merged
Conversation
Attaching a code security configuration to several repositories in one
apply failed for every repository:
- GitHub answers 204 to GET /repos/{owner}/{repo}/code-security-configuration
until an accepted attachment is processed. This was reported as an error
with an empty body, although the repository got attached.
- The attachment of the next repository then reached GitHub while that
enablement was still in progress, and GitHub rejected it with 409.
While waiting for an attachment, treat a 204 as "not attached yet". Send
an attachment that GitHub rejects with 409 again, once per second, for up
to 30 attempts.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: sebastien.heurtematte <sebastien.heurtematte@eclipse-foundation.org>
heurtematte
temporarily deployed
to
pull-request-preview
November 30, 2026 09:02 — with
GitHub Actions
Inactive
Contributor
|
📖 The preview of the documentation was removed (pull request closed). |
The polling loops of code security configurations repeated their number of attempts and their wait as literals, in the loop and in the messages. Name them as module constants. No behaviour change. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: sebastien.heurtematte <sebastien.heurtematte@eclipse-foundation.org>
|
netomi
approved these changes
Nov 30, 2026
heurtematte
temporarily deployed
to
pull-request-preview
November 30, 2026 12:50 — with
GitHub Actions
Inactive
4 of 11 tasks
This branch was previously deployed
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.



Description
otterdog applycould not attach a code security configuration to several repositories in one run. The patchesof the repositories failed one after the other, alternating between two errors:
failed retrieving the code security configuration of repo '<repo>':with an empty body, although GitHub didattach the configuration;
failed to attach code security configuration with name '<name>': {"message":"Another enablement event is in progress. Applying this configuration is not available until it's finished.", ..., "status":"409"}, and therepository was not attached.
Each new
applyattached only about half of the remaining repositories.There were two causes:
202),GET /repos/{owner}/{repo}/code-security-configurationanswers204 No Contentuntil a configuration is attached.wait_for_code_security_configurationtreated every statusother than
200as an error, so it failed on its first poll instead of waiting. It now treats204as "notattached yet" and keeps polling, within its existing limit of 10 seconds. Any other status still fails at once.
reached GitHub while the previous enablement was still running, and GitHub rejected it with
409.attach_code_security_configurationnow sends a request rejected with409again, once per second, for up to 30attempts. If the conflict is still there after that, the error of GitHub is reported as before. Any other error
is not sent again.
Creating a repository with
code_security_configuration(plain, forked or from a template) goes through the sameattachment and wait, so it is fixed too.
The reference page of code security configurations now gives the 10-second wait for an attachment and the 30-second
retry.
issue related: eclipse-kuksa/.eclipsefdn#39
logs
Type of change
Tests
tests/Manual testing
Checklist
docs/, reference docs for new/changed settings,make docsbuilds):docs/reference/organization/code-security-configuration.mddefaults change