Skip to content

refactor: enhance Dockerfile and Justfile for multi-feature builds; i…#39

Merged
tamada merged 1 commit into
release/v0.4.3from
issues/#37_docker_image_of_each_features
Jan 12, 2026
Merged

refactor: enhance Dockerfile and Justfile for multi-feature builds; i…#39
tamada merged 1 commit into
release/v0.4.3from
issues/#37_docker_image_of_each_features

Conversation

@tamada

@tamada tamada commented Jan 12, 2026

Copy link
Copy Markdown
Owner

…mprove logging in Gixor initialization

@tamada tamada added this to the v1.0.0 milestone Jan 12, 2026
@tamada tamada requested a review from Copilot January 12, 2026 08:54
@tamada tamada self-assigned this Jan 12, 2026
@tamada tamada added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 12, 2026
@tamada tamada merged commit ea75899 into release/v0.4.3 Jan 12, 2026
6 checks passed

Copilot AI 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.

Pull request overview

This pull request refactors the Dockerfile and Justfile to support building Docker images with multiple feature flags (default, uselibgit, usegix), fixes a bug in the git2 repository opening logic, and adds debug logging to the Gixor initialization process.

Changes:

  • Refactored Docker build recipes in Justfile to support multiple feature builds with different tags
  • Updated Dockerfile to accept FEATURES and APT_OPTIONAL build arguments for flexible builds
  • Fixed bug in git2.rs where repository was incorrectly opened using file path instead of repository path
  • Added debug logging in Gixor initialization to display config path and contents

Reviewed changes

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

File Description
lib/src/lib.rs Added debug logging statements to log configuration path and JSON-serialized config during Gixor initialization
lib/src/gitbridge/git2.rs Fixed bug: changed from opening git repository using boilerplate file path to using repository root path
Justfile Refactored docker and docker_buildx recipes to build multiple Docker images with different feature flags; added command to gen_complete recipe
Dockerfile Added FEATURES and APT_OPTIONAL build arguments; fixed base-path to use absolute path; added apt-get installation for optional packages; added chown for nonroot user

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

Comment thread Dockerfile
&& mkdir -p /app /opt/gixor/boilerplates
&& mkdir -p /app /opt/gixor/boilerplates \
&& apt-get update \
&& apt-get install --no-install-recommends -y $APT_OPTIONAL ca-certificates \

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

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

The ARG APT_OPTIONAL is defined in the builder stage but is used here in the runtime stage. In Docker, ARG values don't carry over between stages unless redeclared. Add "ARG APT_OPTIONAL" in the runtime stage (after line 26 or before line 33) to make the build argument available in this stage.

Copilot uses AI. Check for mistakes.
Comment thread lib/src/lib.rs
impl Gixor {
fn new(config: Config, load_from: PathBuf) -> Self {
log::debug!("config path: {load_from:?}");
log::debug!("config: {}", serde_json::to_string_pretty(&config).unwrap());

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

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

Using unwrap() in a logging statement can cause a panic if the config fails to serialize to JSON (e.g., if it contains non-serializable data). Consider using unwrap_or_else() or unwrap_or() to provide a fallback message instead of panicking during logging.

Suggested change
log::debug!("config: {}", serde_json::to_string_pretty(&config).unwrap());
log::debug!(
"config: {}",
serde_json::to_string_pretty(&config)
.unwrap_or_else(|e| format!("(failed to serialize config: {e})"))
);

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile
@@ -28,9 +31,16 @@ LABEL org.opencontainers.image.source=https://github.com/tamada/gixor \
org.opencontainers.image.description="Git Ignore Managenemnt System for Multiple Repositories."

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

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

Spelling error: "Managenemnt" should be "Management".

Suggested change
org.opencontainers.image.description="Git Ignore Managenemnt System for Multiple Repositories."
org.opencontainers.image.description="Git Ignore Management System for Multiple Repositories."

Copilot uses AI. Check for mistakes.
@tamada tamada deleted the issues/#37_docker_image_of_each_features branch January 13, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants