Skip to content

doc: improve dockerfile & dockerimage plugin documentation#7609

Merged
olblak merged 2 commits intoupdatecli:mainfrom
olblak:doc/dockerfile
Jan 23, 2026
Merged

doc: improve dockerfile & dockerimage plugin documentation#7609
olblak merged 2 commits intoupdatecli:mainfrom
olblak:doc/dockerfile

Conversation

@olblak
Copy link
Member

@olblak olblak commented Jan 23, 2026

Improve dockerfile and dockerimage documentation

@olblak olblak added documentation Improvements or additions to documentation resource-docker Resource of kind Docker Image labels Jan 23, 2026
@olblak olblak enabled auto-merge (squash) January 23, 2026 20:32
@olblak olblak requested a review from Copilot January 23, 2026 20:41
Copy link
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

This PR refines the inline documentation for the dockerfile and dockerdigest resource plugins, clarifying their configuration fields and adding schema metadata.

Changes:

  • Enriches dockerfile.Spec field comments with defaults, compatibility notes, and an example for Instruction.
  • Rewrites dockerdigest.Spec comments into structured // documentation, clarifies defaults and usage, and marks Image as JSON-schema required.
  • Keeps core behavior unchanged, focusing on improving generated docs and schema descriptions.

Reviewed changes

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

File Description
pkg/plugins/resources/dockerfile/main.go Adds detailed doc comments for Spec fields (File, Files, Instruction, Value), including defaults, compatibility, and an example YAML snippet.
pkg/plugins/resources/dockerdigest/main.go Converts block comments to structured line comments for Spec fields, documents defaults and compatibilities, and marks Image as required in JSON schema.

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

Comment on lines +17 to +21
// file specifies the dockerimage file path to use and is incompatible with Files
//
// default: ""
//
// compatible:
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The field comment starts with lower-case "file" while the exported field is named File. Other spec field comments in this codebase typically start with the exported identifier (e.g., Architecture specifies ... in pkg/plugins/resources/temurin/spec.go:36), so it would be clearer and more consistent to start this comment with File specifies ....

Copilot uses AI. Check for mistakes.
Comment on lines 58 to +65
// Value specifies the value for a specified Dockerfile instruction.
//
// compatible:
// * source
// * condition
// * target
//
// default: source output
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The documentation for Value says the default is "source output", but in practice spec.Value is only passed to MobyParser for conditions, and targets always use the source argument directly via ReplaceInstructions without consulting spec.Value. To avoid confusing users, consider updating this comment to clarify that Value is an explicit expected value for conditions (when using the Moby parser) rather than something that defaults to the source output, or adjust the implementation so that an omitted Value actually uses the source output by default where applicable.

Suggested change
// Value specifies the value for a specified Dockerfile instruction.
//
// compatible:
// * source
// * condition
// * target
//
// default: source output
// Value specifies an explicit value for a specified Dockerfile instruction.
//
// When used with conditions (for example with the Moby parser), this field
// represents the expected value to compare against. For targets, if this
// field is omitted, the value usually comes from the source or other context,
// not from this field.
//
// compatible:
// * source
// * condition
// * target
//
// default: ""

Copilot uses AI. Check for mistakes.
@olblak olblak merged commit 4afd34d into updatecli:main Jan 23, 2026
11 checks passed
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 resource-docker Resource of kind Docker Image

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants