Skip to content

projects refresh background service #2011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 7, 2025
Merged

Conversation

motatoes
Copy link
Contributor

@motatoes motatoes commented Jul 5, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a background service to refresh project data from Git repositories, including a new executable, Dockerfile, and deployment configuration.
    • Added a service client to trigger project refresh via an external API.
    • Added new configuration and ignore files for the background service.
  • Refactor

    • Centralized and updated Git repository cloning utilities into a shared library for improved maintainability.
    • Replaced local project refresh logic with asynchronous external service invocation.
  • Bug Fixes

    • Improved logging and error handling during project refresh and Git operations.
  • Chores

    • Updated test imports and configuration files to align with new utility structure.

Copy link
Contributor

coderabbitai bot commented Jul 5, 2025

Walkthrough

A new background service for refreshing project data from repositories was introduced, including its Dockerfile, deployment configuration, and implementation. The process of cloning repositories and refreshing projects has been refactored to use a shared git_utils library. Calls to local clone utilities were replaced with calls to the new library, and the refresh operation is now delegated to an external service via an API client.

Changes

Files/Groups Change Summary
background/projects-refresh-service/.gitignore, .go.mod, projects_refesh_main.go Added new background Go service for refreshing projects, with module definition and gitignore.
Dockerfile_bg_projects_refresh, fly-projects-refresh-service.toml Added Dockerfile and Fly.io configuration for deploying the new projects refresh service.
backend/service_clients/projects_service.go Added client for triggering the projects refresh service via external API.
libs/git_utils/clone_utils.go Added new shared git utility package for cloning repos and executing actions, moved logic here from other locations.
backend/utils/github.go, ee/cli/pkg/utils/github.go Removed/relocated local git clone utility functions to libs/git_utils.
backend/controllers/cache.go, backend/controllers/github.go, backend/utils/bitbucket.go, Updated imports and calls to use git_utils.CloneGitRepoAndDoAction instead of local utils.
backend/utils/gitlab.go, next/controllers/github.go, ee/cli/pkg/policy/policy.go,
ee/drift/tasks/github.go, ee/drift/utils/github.go, next/services/config.go,
backend/utils/github_test.go Updated test imports and calls to use git_utils.
backend/models/storage.go Added debug log for each project during refresh in RefreshProjectsFromRepo.
backend/services/repos.go Changed logic to trigger external projects refresh service instead of local repo clone and config load.
fly-pro.toml Added environment variables to configure projects refresh service app name and enable loading projects on push.
.github/workflows/pro-deploy.yml Renamed and repurposed CI/CD workflow for deploying the projects-refresh-service with updated configuration and tokens.
.github/workflows/drift_deploy.yml Deleted old driftapp deployment workflow.

Sequence Diagram(s)

sequenceDiagram
    participant User/API
    participant Backend
    participant ProjectsRefreshService
    participant GitRepo
    participant Database

    User/API->>Backend: Request to refresh projects
    Backend->>ProjectsRefreshService: TriggerProjectsRefreshService API call (with repo info)
    ProjectsRefreshService->>GitRepo: Clone repository using git_utils
    ProjectsRefreshService->>ProjectsRefreshService: Load digger.yml config
    ProjectsRefreshService->>Database: Refresh projects in DB
    ProjectsRefreshService-->>Backend: Respond with result
    Backend-->>User/API: Return refresh status
Loading

Possibly related PRs

  • Pro deployment initial #1883: Introduced the initial pro-deploy.yml workflow which was later renamed and repurposed for the projects-refresh-service deployment in this PR.

Poem

🐇
A service hops to life anew,
To fetch and freshen projects true.
With shared git skills and Docker might,
It clones and logs by day and night.
External calls, a seamless flow—
The garden of code continues to grow!
🌱✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc510a7 and 3a911ec.

📒 Files selected for processing (1)
  • libs/git_utils/clone_utils.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/git_utils/clone_utils.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Security Check
  • GitHub Check: Build
  • GitHub Check: Build
  • GitHub Check: Build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/projects-refresh-service

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

delve-auditor bot commented Jul 5, 2025

No security or compliance issues detected. Reviewed everything up to 3a911ec.

Security Overview
  • 🔎 Scanned files: 25 changed file(s)
Detected Code Changes
Change Type Relevant files
Bug Fix ► backend/utils/github.go
    Do not panic in createTempDir
► libs/git_utils/clone_utils.go
    Move git utils to dedicated package
Enhancement ► background/projects-refresh-service/projects_refesh_main.go
    Add projects refresh service
► backend/service_clients/projects_service.go
    Add projects service client
► Dockerfile_bg_projects_refresh
    Add Dockerfile for projects refresh service
Configuration changes ► fly-projects-refresh-service.toml
    Add Fly.io configuration for projects refresh service
► fly-pro.toml
    Update configuration with projects service settings

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@motatoes motatoes marked this pull request as ready for review July 6, 2025 18:46
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces a new background service for refreshing projects configuration, moving Git operations to a centralized package, and implementing asynchronous project updates via Fly.io machines.

  • Introduced background/projects-refresh-service/projects_refesh_main.go daemon process for handling repository cloning and config updates asynchronously
  • Moved Git operations to centralized libs/git_utils/clone_utils.go with enhanced logging and error handling
  • Added backend/service_clients/projects_service.go for triggering on-demand Fly.io machines for project refresh operations
  • Added debug logging in backend/models/storage.go for improved project refresh operation visibility
  • Refactored backend/services/repos.go to delegate project refresh logic to the new background service

22 files reviewed, 21 comments
Edit PR Review Bot Settings | Greptile

@@ -0,0 +1,3 @@
module github.com/diggerhq/digger/backgorund/projects-refresh-service
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Module path contains typo: 'backgorund' should be 'background'

Suggested change
module github.com/diggerhq/digger/backgorund/projects-refresh-service
module github.com/diggerhq/digger/background/projects-refresh-service

@@ -0,0 +1,3 @@
module github.com/diggerhq/digger/backgorund/projects-refresh-service

go 1.24.0
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Using Go 1.24.0 which is not a valid Go version. Latest stable release is 1.22.x

Suggested change
go 1.24.0
go 1.22.0

ARG COMMIT_SHA
WORKDIR /app

RUN apt-get update && apt-get install -y ca-certificates curl && apt-get install -y git && apt-get clean all
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Add --no-install-recommends to apt-get install to reduce image size (consistent with other Dockerfiles)

Suggested change
RUN apt-get update && apt-get install -y ca-certificates curl && apt-get install -y git && apt-get clean all
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git && apt-get clean all

# Copy all required source, blacklist files that are not required through `.dockerignore`
COPY . .

RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o projects_refresh_exe ./background/projects-refresh-service
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Add 'go mod download' before build step to ensure dependencies are properly cached

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Value 'stop' is invalid for auto_stop_machines. Should be boolean true/false.

Suggested change
auto_stop_machines = 'stop'
auto_stop_machines = true

Comment on lines +40 to +43
if cloneUrl == "" && branch == "" && token == "" && orgId == "" && repoFullName == "" {
slog.Info("smoketests mode, skipping this run")
os.Exit(0)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Exit code 0 when required env vars are missing may mask deployment issues. Consider requiring at least orgId and repoFullName. Validate vars individually for better error messages.

Suggested change
if cloneUrl == "" && branch == "" && token == "" && orgId == "" && repoFullName == "" {
slog.Info("smoketests mode, skipping this run")
os.Exit(0)
}
if orgId == "" || repoFullName == "" {
slog.Error("required environment variables missing", "orgId", orgId == "", "repoFullName", repoFullName == "")
os.Exit(1)
}
if cloneUrl == "" && branch == "" && token == "" {
slog.Info("smoketests mode, skipping this run")
os.Exit(0)
}

Comment on lines +51 to +52
slog.Error("failed to load digger.yml: %v", "error", err)
return fmt.Errorf("error loading digger.yml %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Error string formatting uses %v twice incorrectly. The first should be plain text.

Suggested change
slog.Error("failed to load digger.yml: %v", "error", err)
return fmt.Errorf("error loading digger.yml %v", err)
slog.Error("failed to load digger.yml", "error", err)
return fmt.Errorf("error loading digger.yml: %v", err)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (5)
background/projects-refresh-service/.gitignore (1)

1-1: .gitignore pattern is overly broad

Using a bare main pattern will ignore any file or directory named main anywhere in the tree, which might unintentionally hide unrelated sources (e.g. pkg/main/helpers.go). To only ignore the compiled binary produced at the service root, anchor the pattern:

-main
+/main
next/services/config.go (1)

6-6: Use meaningful alias instead of utils3

The alias utils3 does not communicate intent and suggests copy-paste residue. Import the package unaliased or as gitutils for clarity:

-	utils3 "github.com/diggerhq/digger/libs/git_utils"
+	gitutils "github.com/diggerhq/digger/libs/git_utils"

Remember to update the call sites accordingly.

Dockerfile_bg_projects_refresh (2)

6-6: Consider using modern Go workspace instead of GOPATH.

The $GOPATH approach is less common in modern Go. Consider using /app or similar as the working directory.

-WORKDIR $GOPATH/src/github.com/diggerhq/digger
+WORKDIR /app

18-18: Improve apt cleanup for smaller image size.

The current cleanup could be more thorough to reduce image size.

-RUN apt-get update && apt-get install -y ca-certificates curl && apt-get install -y git && apt-get clean all
+RUN apt-get update && apt-get install -y ca-certificates curl git && \
+    apt-get clean && rm -rf /var/lib/apt/lists/*
background/projects-refresh-service/projects_refesh_main.go (1)

1-1: Fix the filename typo.

The filename contains a typo: "refesh" should be "refresh". Consider renaming the file to projects_refresh_main.go for consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 368b373 and 681e3ca.

⛔ Files ignored due to path filters (1)
  • go.work is excluded by !**/*.work
📒 Files selected for processing (21)
  • Dockerfile_bg_projects_refresh (1 hunks)
  • backend/controllers/cache.go (2 hunks)
  • backend/controllers/github.go (2 hunks)
  • backend/models/storage.go (1 hunks)
  • backend/service_clients/projects_service.go (1 hunks)
  • backend/services/repos.go (2 hunks)
  • backend/utils/bitbucket.go (2 hunks)
  • backend/utils/github.go (0 hunks)
  • backend/utils/github_test.go (3 hunks)
  • backend/utils/gitlab.go (2 hunks)
  • background/projects-refresh-service/.gitignore (1 hunks)
  • background/projects-refresh-service/go.mod (1 hunks)
  • background/projects-refresh-service/projects_refesh_main.go (1 hunks)
  • ee/cli/pkg/policy/policy.go (2 hunks)
  • ee/cli/pkg/utils/github.go (0 hunks)
  • ee/drift/tasks/github.go (1 hunks)
  • ee/drift/utils/github.go (1 hunks)
  • fly-projects-refresh-service.toml (1 hunks)
  • libs/git_utils/clone_utils.go (1 hunks)
  • next/controllers/github.go (2 hunks)
  • next/services/config.go (1 hunks)
💤 Files with no reviewable changes (2)
  • ee/cli/pkg/utils/github.go
  • backend/utils/github.go
🧰 Additional context used
🧠 Learnings (3)
backend/utils/bitbucket.go (1)
Learnt from: wenzel-felix
PR: diggerhq/digger#1933
File: libs/storage/azure_plan_storage.go:19-44
Timestamp: 2025-04-03T16:10:15.929Z
Learning: When handling errors from the Azure SDK for Go's blob storage, check for "404" or "not found" strings in the error message to detect missing blobs: `if strings.Contains(err.Error(), "404") || strings.Contains(strings.ToLower(err.Error()), "not found")`. This approach works reliably across different versions of the SDK.
backend/controllers/cache.go (1)
Learnt from: wenzel-felix
PR: diggerhq/digger#1933
File: libs/storage/azure_plan_storage.go:19-44
Timestamp: 2025-04-03T16:10:15.929Z
Learning: When handling errors from the Azure SDK for Go's blob storage, check for "404" or "not found" strings in the error message to detect missing blobs: `if strings.Contains(err.Error(), "404") || strings.Contains(strings.ToLower(err.Error()), "not found")`. This approach works reliably across different versions of the SDK.
backend/controllers/github.go (1)
Learnt from: wenzel-felix
PR: diggerhq/digger#1933
File: libs/storage/azure_plan_storage.go:19-44
Timestamp: 2025-04-03T16:10:15.929Z
Learning: When handling errors from the Azure SDK for Go's blob storage, check for "404" or "not found" strings in the error message to detect missing blobs: `if strings.Contains(err.Error(), "404") || strings.Contains(strings.ToLower(err.Error()), "not found")`. This approach works reliably across different versions of the SDK.
🧬 Code Graph Analysis (7)
backend/utils/github_test.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
backend/utils/bitbucket.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
backend/utils/gitlab.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
ee/cli/pkg/policy/policy.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
backend/controllers/cache.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
backend/controllers/github.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
next/controllers/github.go (1)
libs/git_utils/clone_utils.go (1)
  • CloneGitRepoAndDoAction (26-73)
🪛 golangci-lint (1.64.8)
background/projects-refresh-service/projects_refesh_main.go

64-64: slog: slog.Error arg "err" should be a string or a slog.Attr (possible missing key or value)

(govet)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Security Check
🔇 Additional comments (22)
backend/models/storage.go (1)

1645-1646: Good: extra context in debug log

The added slog.Debug provides useful visibility during project refresh and has negligible overhead at debug level.

backend/controllers/github.go (2)

9-9: LGTM: Proper import for centralized Git utilities

Adding the import for the new git_utils package is correct and aligns with the refactoring to centralize Git cloning functionality.


919-919: LGTM: Function call correctly updated to use centralized Git utilities

The function call update maintains the same parameters while correctly referencing the new centralized git_utils.CloneGitRepoAndDoAction. This refactoring improves code modularity and prepares for the new background service architecture.

ee/drift/tasks/github.go (1)

8-8: LGTM: Import alias correctly updated to point to centralized Git utilities

The import alias change correctly points to the new libs/git_utils package while maintaining the same alias name, ensuring no other code changes are needed in this file. This is a clean refactoring that supports the centralization effort.

backend/utils/bitbucket.go (2)

5-5: LGTM: Import addition for centralized Git utilities

The import for git_utils package is correctly added to support the refactored Git cloning functionality.


98-98: LGTM: Function call correctly updated to use centralized implementation

The function call properly references the new git_utils.CloneGitRepoAndDoAction while maintaining the same parameters. This supports the modularization effort and takes advantage of the enhanced logging and error handling in the new implementation.

backend/utils/gitlab.go (2)

5-5: LGTM: Import addition completes the consistent refactoring pattern

The import for git_utils package correctly supports the centralized Git cloning functionality, completing the consistent pattern across all Git provider utilities.


117-117: LGTM: Function call correctly updated with enhanced implementation

The function call properly uses git_utils.CloneGitRepoAndDoAction with the same parameters. This completes the refactoring effort to centralize Git operations and benefits from the enhanced logging, cleanup, and error handling in the new implementation.

ee/drift/utils/github.go (1)

11-11: LGTM: Import refactored to use centralized git utilities.

The import change correctly points to the new centralized libs/git_utils package while maintaining the same alias, ensuring compatibility with existing function calls.

next/controllers/github.go (2)

15-15: LGTM: Import added for centralized git utilities.

The import addition correctly introduces the centralized git_utils package.


542-542: LGTM: Function call updated to use centralized implementation.

The function call correctly uses the new centralized git_utils.CloneGitRepoAndDoAction with compatible parameters.

backend/controllers/cache.go (2)

5-5: LGTM: Import added for centralized git utilities.

The import addition correctly introduces the centralized git_utils package for the refactored cloning functionality.


71-71: LGTM: Function call updated to use centralized implementation.

The asynchronous cache update correctly uses the new centralized git_utils.CloneGitRepoAndDoAction function with compatible parameters.

ee/cli/pkg/policy/policy.go (2)

4-4: LGTM: Import updated to use centralized git utilities.

The import change correctly points to the new centralized libs/git_utils package.


65-65: LGTM: Function call updated with correct parameters.

The function call correctly uses the new centralized implementation with proper parameter mapping:

  • p.ManagementRepoUrl as repo URL
  • "main" as branch
  • Empty string for commit hash (not needed)
  • p.GitToken as token
  • Empty string for token username (not needed)
Dockerfile_bg_projects_refresh (2)

11-11: LGTM: Well-structured multi-stage build.

The Dockerfile follows good practices with:

  • Multi-stage build for smaller final image
  • Version embedding via COMMIT_SHA
  • Proper binary permissions
  • Clear entrypoint definition

Also applies to: 24-25, 28-28


1-1: Base Image Go Version

Go 1.24.0 is available (released Feb 11, 2025), and the latest patch release is 1.24.4 (June 5, 2025). Consider updating your Dockerfile to:

  • Pin to the exact patch:
    FROM golang:1.24.4 AS builder
  • Or use the minor-version alias to automatically pick up patches:
    FROM golang:1.24 AS builder

This ensures you get critical fixes while keeping your builds reproducible.

fly-projects-refresh-service.toml (1)

1-24: Configuration looks good for a background service.

The Fly.io configuration is well-structured with appropriate resource allocation and auto-scaling settings for an on-demand background service.

background/projects-refresh-service/projects_refesh_main.go (1)

33-68: Well-structured service implementation.

The main function correctly implements the project refresh workflow with proper error handling and logging throughout.

backend/services/repos.go (1)

44-50: Good refactoring to use external service.

The refactoring successfully delegates the project refresh operation to the external service, simplifying the code and enabling asynchronous processing.

libs/git_utils/clone_utils.go (1)

26-73: Excellent centralization of git cloning logic.

The CloneGitRepoAndDoAction function is well-structured with comprehensive logging, proper error handling, and cleanup. This centralization eliminates code duplication across the codebase.

backend/service_clients/projects_service.go (1)

42-107: Well-implemented service client.

The TriggerProjectsRefreshService function is well-structured with proper error handling, logging, and machine configuration. The use of auto-destroy for cost efficiency is a good practice.

return nil
})
if err != nil {
slog.Error("error while cloning repo: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the slog.Error formatting.

The error argument is not properly formatted in the slog.Error call.

Apply this diff to fix the formatting:

-		slog.Error("error while cloning repo: %v", err)
+		slog.Error("error while cloning repo", "error", err)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
slog.Error("error while cloning repo: %v", err)
slog.Error("error while cloning repo", "error", err)
🧰 Tools
🪛 golangci-lint (1.64.8)

64-64: slog: slog.Error arg "err" should be a string or a slog.Attr (possible missing key or value)

(govet)

🤖 Prompt for AI Agents
In background/projects-refresh-service/projects_refesh_main.go at line 64, the
slog.Error call incorrectly formats the error argument by using a printf-style
format string. Replace the current call with one that passes the error as a
separate argument or uses structured logging fields, ensuring the error is
properly included in the log output without using a format string.

@motatoes motatoes changed the title wip: projects refresh background service projects refresh background service Jul 7, 2025
@motatoes motatoes merged commit fc4f2c2 into develop Jul 7, 2025
13 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jul 7, 2025
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