Skip to content

Replace context.TODO() with the current component's context#488

Merged
NGTmeaty merged 1 commit intointernetarchive:mainfrom
vbanos:context-todo
Sep 20, 2025
Merged

Replace context.TODO() with the current component's context#488
NGTmeaty merged 1 commit intointernetarchive:mainfrom
vbanos:context-todo

Conversation

@vbanos
Copy link
Copy Markdown
Collaborator

@vbanos vbanos commented Sep 20, 2025

Note that we leave context.TODO() in internal/pkg/source/hq/consumer.go because its a special case.

Fixing issue: #472

Note that we leave `context.TODO()` in `internal/pkg/source/hq/consumer.go`
because its a special case.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 20, 2025

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.29%. Comparing base (aa20de5) to head (9cb8c1a).
⚠️ Report is 57 commits behind head on main.

Files with missing lines Patch % Lines
internal/pkg/source/hq/consumer.go 0.00% 2 Missing ⚠️
internal/pkg/source/hq/finisher.go 0.00% 1 Missing ⚠️
internal/pkg/source/hq/hq.go 0.00% 1 Missing ⚠️
internal/pkg/source/hq/producer.go 0.00% 1 Missing ⚠️
internal/pkg/source/hq/seencheck.go 0.00% 1 Missing ⚠️
internal/pkg/source/lq/lq.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #488   +/-   ##
=======================================
  Coverage   56.29%   56.29%           
=======================================
  Files         130      130           
  Lines        8109     8109           
=======================================
  Hits         4565     4565           
  Misses       3177     3177           
  Partials      367      367           
Flag Coverage Δ
e2etests 40.57% <30.00%> (ø)
unittests 29.31% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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

This PR replaces instances of context.TODO() with appropriate context objects to improve context propagation and cancellation handling across the Zeno web crawler's source components. This change ensures that operations can be properly cancelled and traced through their execution context.

Key changes:

  • Replace context.TODO() with component context (s.ctx) for client operations
  • Use function parameter context (ctx) where available for better scope alignment
  • Remove unused context import where no longer needed

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/pkg/source/lq/lq.go Replace context.TODO() with s.ctx in resetURL call
internal/pkg/source/lq/finisher.go Replace context.TODO() with ctx parameter in delete operation
internal/pkg/source/lq/consumer.go Replace context.TODO() with s.ctx in getURLs and fix context usage
internal/pkg/source/hq/seencheck.go Replace context.TODO() with s.ctx in Seencheck call and remove unused import
internal/pkg/source/hq/producer.go Replace context.TODO() with ctx parameter in Add operation
internal/pkg/source/hq/hq.go Replace context.TODO() with s.ctx in ResetURL call
internal/pkg/source/hq/finisher.go Replace context.TODO() with ctx parameter in Delete operation
internal/pkg/source/hq/consumer.go Replace context.TODO() with s.ctx in Get and errgroup operations

Comment thread internal/pkg/source/lq/consumer.go
Copy link
Copy Markdown
Collaborator

@NGTmeaty NGTmeaty left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@NGTmeaty NGTmeaty merged commit ef940db into internetarchive:main Sep 20, 2025
2 checks passed
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