Skip to content

Add the GCP log import web flow - #38

Merged
STRRL merged 1 commit into
masterfrom
conductor/lapp-gcp-import-web-frontend
Jul 27, 2026
Merged

Add the GCP log import web flow#38
STRRL merged 1 commit into
masterfrom
conductor/lapp-gcp-import-web-frontend

Conversation

@STRRL

@STRRL STRRL commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Problem

Large Cloud Logging imports use too many read requests, and the complete import flow is not available in the browser.

Solution

Add the browser import flow and stream Cloud Logging entries with larger pages, quota retry, and atomic file writes.

Major Changes

  • Web import flow
    • Add the GCP import form, progress, history, recent queries, structured errors, and truncation warnings
  • Cloud Logging fetch
    • Use pages of up to 10,000 entries with longer deadlines and quota retry
  • Import storage
    • Stream NDJSON into a temporary file and publish it only after a successful import

Note

Medium Risk
Changes the GCP import path (new API client, streaming I/O) and adds user-facing import controls that rely on local ADC; failures are recorded on ImportRun but large pulls still touch external quotas and disk.

Overview
Browser GCP imports — New Imports tab with project/filter/limit, quick 1h/6h/24h ranges, recent query picker (cross-workspace), latest-run status, and history from ImportRun records. Starts imports via createImportRun and polls GetOperation (shared with discovery); hasActiveRun blocks uploads, log deletes, discovery, and workspace delete while an import or discovery operation is in flight.

Streaming import pipelineImportFetcher now takes an ImportLineWriter instead of returning in-memory lines. RunImport writes NDJSON to a temp file under logs/, enforces the entry cap during writes, and **rename**s only on success (zero entries leaves no file).

Cloud Logging clientgcplog.FetchLines becomes gcplog.Fetch, using Logging API v2 ListLogEntries with up to 10,000 entries per page, 5m call timeout, and gax retry on quota/transient errors; entries are converted and passed to the writer as they arrive. CLI and web server fetchers are wired to the new signature.

Reviewed by Cursor Bugbot for commit 9b84bc9. Bugbot is set up for automated code reviews on this repo. Configure here.

@STRRL
STRRL marked this pull request as ready for review July 27, 2026 04:19
@STRRL
STRRL merged commit 332dcef into master Jul 27, 2026
2 checks passed
@STRRL
STRRL deleted the conductor/lapp-gcp-import-web-frontend branch July 27, 2026 04:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9b84bc9. Configure here.

Comment thread pkg/workspace/import.go
func newImportLogOutput(config ImportConfig, runID string) (*importLogOutput, error) {
fileName := config.Provider + "-" + runID + ".ndjson"
logPath := filepath.Join(config.Dir, "logs", fileName)
file, err := os.CreateTemp(filepath.Dir(logPath), "."+fileName+".*.tmp")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Import temps listed as logs

Low Severity

Streaming imports create a temporary NDJSON file under logs/ via CreateTemp, and ListLogFiles returns every file in that directory. While an import is running, that incomplete temp file can show up in the web Logs tab and in any flow that reads all files in logs/.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b84bc9. Configure here.

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.

1 participant