Skip to content

Remove enable_record_ecosystem_meta feature flag#14353

Merged
pavera merged 5 commits intomainfrom
copilot/remove-enable-record-ecosystem-meta-ff
Mar 4, 2026
Merged

Remove enable_record_ecosystem_meta feature flag#14353
pavera merged 5 commits intomainfrom
copilot/remove-enable-record-ecosystem-meta-ff

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

What are you trying to accomplish?

Remove the enable_record_ecosystem_meta experiment flag, making record_ecosystem_meta unconditionally active, and make it truly best-effort (no retries) to avoid adding latency to update jobs.

  • updater/lib/dependabot/api_client.rb: Removed the Experiments.enabled?(:enable_record_ecosystem_meta) early-return guard. Replaced the retry loop (MAX_REQUEST_RETRIES with sleep) with a single fire-and-forget POST aligned with increment_metric's best-effort pattern. HTTP 4xx+ responses are logged as errors without retrying. A single StandardError rescue acts as a safety net for any unexpected failures.
  • updater/spec/dependabot/api_client_spec.rb: Removed experiment stubs and the "when feature flag is disabled" test context. Added stub_request for record_ecosystem_meta_url so tests validate the actual 204 success path. Fixed Layout/EmptyLinesAroundBlockBody lint offense.
  • silent/tests/silent_test.go: Updated the Go integration test to check the message type field before attempting full CreatePR struct unmarshal, so record_ecosystem_meta messages (which have a different data structure) are skipped gracefully instead of causing unmarshal errors.

Anything you want to highlight for special attention from reviewers?

The 8 operation spec files that reference record_ecosystem_meta: nil in mock doubles are unchanged — those are standard instance_double stubs unrelated to the feature flag.

The Go integration test (silent/tests/silent_test.go) needed a fix because record_ecosystem_meta is now unconditionally sent in the output stream. The data field in record_ecosystem_meta messages is an array of ecosystem objects, not an array of DependencyFile structs, so the test now filters by message type via a lightweight preliminary unmarshal before attempting the full CreatePR struct decode.

The retry loop was removed from record_ecosystem_meta because, now that the method is unconditional and invoked from multiple ensure blocks, outages could add up to ~30s of extra latency per job. The method is now best-effort with a single POST call, matching increment_metric's fire-and-forget behavior. Note that record_cooldown_meta still retains its retry loop — only record_ecosystem_meta was changed per the review feedback.

How will you know you've accomplished your goal?

Existing record_ecosystem_meta tests pass without the experiment stubs, confirming the method executes unconditionally. CI lint and integration tests pass cleanly.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove enable_record_ecosystem_meta FF from dependabot-core</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes github/dependabot-updates#12616

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Remove enable_record_ecosystem_meta feature flag from dependabot-core Remove enable_record_ecosystem_meta feature flag Mar 3, 2026
@pavera pavera marked this pull request as ready for review March 3, 2026 18:11
@pavera pavera requested a review from a team as a code owner March 3, 2026 18:11
Copilot AI review requested due to automatic review settings March 3, 2026 18:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the enable_record_ecosystem_meta experiment gating so record_ecosystem_meta is always executed, and updates the updater specs accordingly.

Changes:

  • Made ApiClient#record_ecosystem_meta run unconditionally by removing the experiment early-return.
  • Simplified ApiClient specs by removing experiment stubs and the “feature flag disabled” context.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
updater/lib/dependabot/api_client.rb Removes the experiment guard so ecosystem metadata is always recorded.
updater/spec/dependabot/api_client_spec.rb Removes feature-flag-related stubbing/contexts for ecosystem meta recording.

@pavera
Copy link
Contributor

pavera commented Mar 3, 2026

@copilot review and fix the lint failures as well as the integration test failures

Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot review and fix the lint failures as well as the integration test failures

Fixed both issues in commits 1ca8cef and 9049dfc:

  1. Lint: Removed the extra empty line before the closing end that triggered Layout/EmptyLinesAroundBlockBody. Also added stub_request for record_ecosystem_meta_url so tests validate the actual 204 response flow.

  2. Integration test: Updated silent/tests/silent_test.go to check the message type field before attempting full CreatePR struct unmarshal. The record_ecosystem_meta messages have a different data structure (array of ecosystem objects vs. updated-dependency-files), so they now get skipped gracefully.

Also cleaned up accidentally committed go_modules fixture files in 9049dfc.

Warning

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:

  • dependabot.com
    • Triggering command: /usr/bin/go go mod tidy -e (dns block)
    • Triggering command: /usr/bin/go go get -v ./... (dns block)
  • example.com
    • Triggering command: /usr/bin/go go mod tidy -e (dns block)
  • google.golang.org
    • Triggering command: /usr/bin/go go mod tidy -e (dns block)
  • gopkg.in
    • Triggering command: /usr/bin/go go mod tidy -e (dns block)
  • k8s.io
    • Triggering command: /usr/bin/go go mod tidy -e (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@pavera pavera force-pushed the copilot/remove-enable-record-ecosystem-meta-ff branch 2 times, most recently from f6db6c0 to 181ec34 Compare March 3, 2026 23:25
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot review and fix the lint failures as well as the integration test failures

Lint and Go integration test (silent/tests/silent_test.go) were fixed in 9b29b0c. The remaining Smoke test failures are caused by the expectation YAML files in the external dependabot/smoke-tests repo — those files need record_ecosystem_meta entries added now that the message is unconditional. That repo will need a separate update.

Copilot AI and others added 5 commits March 4, 2026 08:09
The record_ecosystem_meta functionality is now always active (no longer
gated behind an experiment flag). Removed:
- Feature flag guard in api_client.rb
- Associated test stubs and "when feature flag is disabled" test context

Co-authored-by: pavera <660677+pavera@users.noreply.github.com>
- Fix RuboCop Layout/EmptyLinesAroundBlockBody offense (extra empty line)
- Add stub_request for record_ecosystem_meta_url in spec
- Fix Go integration test: check message type before full struct unmarshal
  so record_ecosystem_meta messages (which have different data structure)
  are skipped gracefully instead of causing unmarshal errors

Co-authored-by: pavera <660677+pavera@users.noreply.github.com>
Remove go.sum/go.mod fixture files that were accidentally picked up
by git add and are not related to the feature flag removal.

Co-authored-by: pavera <660677+pavera@users.noreply.github.com>
Remove the retry loop from record_ecosystem_meta to avoid adding
up to ~30s of extra latency per job when the API call fails. Since
this is now unconditional and invoked from multiple ensure blocks,
it should be truly best-effort (like increment_metric) with no
sleep/retry behavior. Network errors and HTTP 4xx+ responses are
logged as errors without retrying.

Co-authored-by: pavera <660677+pavera@users.noreply.github.com>
Remove redundant inner rescue for Excon/SSL errors since the outer
StandardError rescue already catches those. Single rescue block is
cleaner and matches the reviewer's suggested pattern.

Co-authored-by: pavera <660677+pavera@users.noreply.github.com>
@pavera pavera force-pushed the copilot/remove-enable-record-ecosystem-meta-ff branch from d14f7ba to 7be8284 Compare March 4, 2026 15:09
Copy link
Contributor

@pavera pavera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smoke tests need to be updated with the new default output.

Comment on lines +105 to +113
var msg struct {
Type string `json:"type"`
}
if err := json.Unmarshal([]byte(scanner.Text()), &msg); err != nil {
return nil, fmt.Errorf("failed to decode line %s: %w", scanner.Text(), err)
}
if msg.Type != prType {
continue
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting find... did you spot this bug or had it been silently failing until Copilot spotted it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test failed when we made the default behavior the FF behavior. There wasn't a test previously that exercised this code with the FF enabled so when the output changed, the test started failing.

@pavera pavera merged commit c1516a5 into main Mar 4, 2026
166 of 233 checks passed
@pavera pavera deleted the copilot/remove-enable-record-ecosystem-meta-ff branch March 4, 2026 16:59
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.

4 participants