Skip to content

Support HTTP URLs in file fetcher and system-test instrumentation#22044

Merged
bolekk merged 4 commits intodevelopfrom
tejaswi/cw-fetcher-and-system-tests
Apr 21, 2026
Merged

Support HTTP URLs in file fetcher and system-test instrumentation#22044
bolekk merged 4 commits intodevelopfrom
tejaswi/cw-fetcher-and-system-tests

Conversation

@nadahalli
Copy link
Copy Markdown
Contributor

Summary

  • Add HTTP URL support in file fetcher so local testing works when binary URLs are HTTP (the enclave fetches over HTTP, but the syncer reads from disk).
  • Add ConfidentialRelayCapability constant for E2E test support.
  • Fix mock capability type (ACTION, not TRIGGER).
  • Add timing instrumentation to node/key generation in system tests.

Confidential workflows register HTTP URLs for the enclave. The file
fetcher extracts the filename for local testing. Add relay capability
constant and timing logs for system tests.
@nadahalli nadahalli requested review from a team as code owners April 16, 2026 16:08
Copilot AI review requested due to automatic review settings April 16, 2026 16:08
@github-actions
Copy link
Copy Markdown
Contributor

👋 nadahalli, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

✅ No conflicts with other open PRs targeting develop

@nadahalli nadahalli marked this pull request as draft April 16, 2026 16:11
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

Risk Rating: MEDIUM (touches workflow artifact fetching logic + path validation in core syncer; warrants careful review)

This PR aligns local confidential-workflow testing behavior with enclave behavior by allowing the syncer’s file fetcher to accept http(s) URLs (mapping them to local filenames), and adds system-test capability/test instrumentation updates.

Changes:

  • Allow file fetchers (syncer v1 + v2) to accept http(s) request URLs by extracting the basename for local disk reads.
  • Add ConfidentialRelayCapability and add timing instrumentation for node metadata + node key generation in system tests.
  • Fix mock capability type to ACTION and add a changeset entry.

Reviewed changes

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

Show a summary per file
File Description
core/services/workflows/syncer/fetcher.go Accept http(s) URLs in file fetcher by converting URL path to basename.
core/services/workflows/syncer/v2/fetcher.go Same as above for v2 syncer fetcher.
system-tests/lib/cre/types.go Add capability constant and timing instrumentation helpers/log fields.
system-tests/lib/cre/features/mock/mock.go Fix mock capability type to ACTION.
.changeset/cw-fetcher-and-system-tests.md Record patch-level change summary.

Comment thread core/services/workflows/syncer/fetcher.go
Comment thread core/services/workflows/syncer/fetcher.go
Comment thread core/services/workflows/syncer/v2/fetcher.go
Comment thread core/services/workflows/syncer/v2/fetcher.go
Comment thread system-tests/lib/cre/types.go Outdated
}

func roundSeconds(d time.Duration) float64 {
return float64(d.Milliseconds()) / 1000.0
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

roundSeconds doesn’t actually round, and it truncates sub-millisecond precision by using Milliseconds(). Consider either renaming to reflect what it returns (e.g., secondsFromDuration) or implementing actual rounding (or just using d.Seconds() if you don’t need rounding).

Suggested change
return float64(d.Milliseconds()) / 1000.0
return d.Seconds()

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Inlined Seconds() and removed the helper in 1072792.

Comment thread system-tests/lib/cre/types.go Outdated
Comment on lines +1526 to +1529
Int("evm_chains", len(input.EVMChainIDs)).
Int("solana_chains", len(input.SolanaChainIDs)).
Bool("imported", input.ImportedSecrets != "").
Float64("duration_s", roundSeconds(time.Since(start))).
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This log line is only reached when ImportedSecrets == "", so the Bool("imported", input.ImportedSecrets != "") field will always be false and can be misleading. Consider either removing the field, hardcoding it to false here, or adding a corresponding log (and duration) in the early-return ImportedSecrets branch so both paths are instrumented consistently.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the field in 2b5bf52.

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 16, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@nadahalli nadahalli force-pushed the tejaswi/cw-fetcher-and-system-tests branch from 7594339 to 396a390 Compare April 16, 2026 16:25
@nadahalli nadahalli marked this pull request as ready for review April 16, 2026 16:27
Comment thread system-tests/lib/cre/types.go Outdated
Comment on lines +1702 to +1703
func roundSeconds(d time.Duration) float64 {
return d.Seconds()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we just call Seconds() inline instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 1072792. Inlined time.Since(...).Seconds() at both call sites and deleted the helper.

@cl-sonarqube-production
Copy link
Copy Markdown

}
// Confidential workflows register with HTTP URLs (for the enclave).
// Extract the filename so the file fetcher can find the local copy.
if u.Scheme == "http" || u.Scheme == "https" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if it's "confidential" shall it only allow https ?

Copy link
Copy Markdown
Contributor Author

@nadahalli nadahalli Apr 20, 2026

Choose a reason for hiding this comment

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

Confidential means that the workflow runs in TEE's. If the user wants to do http requests from TEE's, why stop them? They know what they are doing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, this is the fetcher URL. It can be http because we check the returned binary's hash against the hash that was sent in the request - so, the server that hosts the wasm binary cannot send back bad things.

@bolekk bolekk added this pull request to the merge queue Apr 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 21, 2026
@bolekk bolekk added this pull request to the merge queue Apr 21, 2026
Merged via the queue into develop with commit de6ecbc Apr 21, 2026
225 of 227 checks passed
@bolekk bolekk deleted the tejaswi/cw-fetcher-and-system-tests branch April 21, 2026 16:06
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.

6 participants