Skip to content

refactor(daemon): rename assets package to embedded and update related references#2

Merged
adcondev merged 1 commit intomasterfrom
feat/tuis
Feb 4, 2026
Merged

refactor(daemon): rename assets package to embedded and update related references#2
adcondev merged 1 commit intomasterfrom
feat/tuis

Conversation

@adcondev
Copy link
Copy Markdown
Owner

@adcondev adcondev commented Feb 4, 2026

This pull request introduces several changes to improve the build and deployment process for the TicketServicio service, including support for a new "Remote" service variant, and refactors how embedded web assets are managed and accessed in the codebase.

Build and Service Management Enhancements:

  • Added support for a "Remote" Windows Service variant, including new variables (SERVICE_REMOTE, BINARY_REMOTE) and updated build commands in Taskfile.yml to produce separate binaries for local and remote deployments. [1] [2]
  • Introduced new install:remote and uninstall:remote tasks to manage the remote service installation and removal via Windows Service Control (sc). [1] [2]
  • Improved and clarified service management instructions and echo messages in the Taskfile.yml for better usability.

Embedded Assets Refactor:

  • Moved the embedded web assets from internal/assets to a new top-level package embedded (embed.go), and updated the embedding path to internal/assets/web. [1] [2]
  • Updated all references in the codebase to use the new embedded package and the correct embedded path for serving static web files. [1] [2]

@adcondev adcondev requested a review from Copilot February 4, 2026 17:21
@adcondev adcondev added the bug Something isn't working label Feb 4, 2026
@adcondev adcondev added the documentation Improvements or additions to documentation label Feb 4, 2026
@adcondev adcondev moved this to In review in POS RED2000 Feb 4, 2026
Copy link
Copy Markdown

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 refactors the embedded web assets management by moving the embed directive from internal/assets/embed.go to a new top-level embed.go file, and adds support for building and managing a "Remote" Windows Service variant alongside the existing local/test service.

Changes:

  • Moved embedded web assets from internal/assets package to a new top-level embedded package with updated embed path to internal/assets/web
  • Added new service variant "TicketServicioRemote" with separate binary R2k_TicketServicio_Remote.exe for production/remote deployments
  • Added install:remote and uninstall:remote tasks to Taskfile.yml for managing the remote service

Reviewed changes

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

File Description
embed.go New file defining the embedded package with WebFiles embedding internal/assets/web directory
internal/assets/embed.go Removed - functionality moved to top-level embed.go
internal/daemon/program.go Updated import to use new embedded package and adjusted fs.Sub path to match new embed directive
Taskfile.yml Renamed BINARY variable to distinguish local/test builds, added BINARY_REMOTE and SERVICE_REMOTE variables, and added remote service management tasks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"github.com/judwhite/go-svc"

"github.com/adcondev/ticket-daemon/internal/assets"
embed "github.com/adcondev/ticket-daemon"
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The import alias "embed" conflicts with the standard library "embed" package that's being imported. This creates ambiguity about whether "embed.WebFiles" refers to the imported package or this module's package. Since the package name in embed.go is "embedded" (not "embed"), the import should either use no alias (if the package name matches) or use a different alias that doesn't conflict with the standard library.

Suggested change
embed "github.com/adcondev/ticket-daemon"
embedded "github.com/adcondev/ticket-daemon"

Copilot uses AI. Check for mistakes.
Comment thread Taskfile.yml
SERVICE_TEST: TicketServicioTest
BINARY: R2k_TicketServicio.exe
SERVICE_REMOTE: TicketServicioRemote
BINARY: R2k_TicketServicio_Local.exe
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The binary name "R2k_TicketServicio_Local.exe" is potentially misleading. This binary is built with BuildEnvironment=test (line 54) and listens only on localhost:8766, but the name suggests it's a local/production variant. The name doesn't clearly indicate it's for testing purposes. Consider renaming to something like "R2k_TicketServicio_Test.exe" to align with the SERVICE_TEST variable and avoid confusion between "test/local" and "prod/remote" deployments.

Suggested change
BINARY: R2k_TicketServicio_Local.exe
BINARY: R2k_TicketServicio_Test.exe

Copilot uses AI. Check for mistakes.
Comment thread embed.go

// WebFiles contiene el sitio web estático (HTML, CSS, JS)
//
//go:embed internal/assets/web
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The documentation in README.md still references the old file structure with "internal/assets/embed.go" at line 346, but this file has been removed and replaced with a top-level "embed.go". The documentation should be updated to reflect the new structure where embedded assets are managed at the root level instead of under internal/assets/.

Suggested change
//go:embed internal/assets/web
//go:embed web

Copilot uses AI. Check for mistakes.
Comment thread embed.go
@@ -0,0 +1,11 @@
package embedded
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The package name "embedded" doesn't match the import path used in program.go. The import statement uses "github.com/adcondev/ticket-daemon" as the module root, which would make this the root package. However, since this file is at the root of the module, the package name should match the directory name or be a descriptive name that aligns with Go conventions for root-level packages. Consider either:

  1. Naming the package to match the module's intent (e.g., "daemon" or "ticketdaemon")
  2. Moving this file to a subdirectory like "pkg/embedded" with package name "embedded"
  3. Using a more conventional name for a root-level utility package
Suggested change
package embedded
package ticketdaemon

Copilot uses AI. Check for mistakes.
Comment thread embed.go

import (
"embed"
_ "embed"
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The blank import "_ embed" is unnecessary. The embed package is already imported directly on line 4, and the blank import is only needed when you want to trigger init functions without directly using the package. Since the embed.FS type is explicitly used, the blank import should be removed.

Suggested change
_ "embed"

Copilot uses AI. Check for mistakes.
@adcondev adcondev merged commit e554857 into master Feb 4, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in POS RED2000 Feb 4, 2026
@adcondev adcondev deleted the feat/tuis branch February 6, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants