Fix Docker build#51
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix broken Docker image builds by changing the Docker build context filtering strategy and adding CI validation to ensure the image builds and can run --version.
Changes:
- Add a GitHub Actions workflow to build the Docker image and run a basic verification command.
- Replace the existing
.dockerignoredenylist with an allowlist approach to include only files needed for the Docker build.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/docker-ci.yml |
Adds a CI job to build the Docker image and run waza --version in the container. |
.dockerignore |
Switches to an allowlist-based build context intended to include only required build inputs. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=======================================
Coverage ? 72.36%
=======================================
Files ? 127
Lines ? 14233
Branches ? 0
=======================================
Hits ? 10299
Misses ? 3178
Partials ? 756
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Include .dockerignore, schemas/**, docs.go, docs/graders/**, and version.txt in path filters so changes to build context inputs reliably trigger the Docker build job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
spboyer
approved these changes
Mar 4, 2026
richardpark-msft
pushed a commit
to richardpark-msft/waza
that referenced
this pull request
Mar 4, 2026
Adds a new `tokens compare` subcommand that compares token counts in a directory between git refs, enabling users to track how token usage changes across commits or between committed and uncommitted work. Closes microsoft#51 ## Usage ```bash # Compare HEAD to working tree waza tokens compare # Compare a specific ref to working tree waza tokens compare HEAD~3 # Compare two refs waza tokens compare main feature-branch # JSON output waza tokens compare --format json # Include unchanged files waza tokens compare --show-unchanged ``` ## Changes ### New files | File | Description | | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | `cmd/waza/tokens/compare.go` | Command implementation: ref resolution, file diffing, token counting, table and JSON output | | `cmd/waza/tokens/compare_test.go` | Tests covering added/modified/removed files, multiple ref combinations, `--show-unchanged`, and JSON output | | `cmd/waza/tokens/internal/git/git.go` | Git helpers: `IsInRepo`, `GetFilesFromRef`, `GetFileFromRef`, `RefExists` | ## Design - **Ref handling:** With no args, compares `HEAD → WORKING` i.e., the working tree. One arg compares that ref to working tree. Two args compares first to second. - **File detection:** Uses `git ls-files` for the working tree and `git ls-tree` for committed refs, filtering to `.md`/`.mdx` files. - **Edge cases:** Handles empty repos (no HEAD), deleted working tree files, and files that exist in only one ref. - **Output formats:** Table (default) with emoji status indicators, or structured JSON with per-file and summary statistics. - **Per-file stats:** Token count, character count, line count, absolute diff, percent change, and status (`added`/`removed`/`modified`/`unchanged`). ## Example Output ``` 📊 Token Comparison: HEAD → WORKING File Before After Diff Status ------------------------------------------------------------------ README.md 11 14 +3 📈 references/spec.md 7 7 0 ➡️ unchanged.md 1 1 0 ➡️ ------------------------------------------------------------------ Total 19 22 +3 15.8% 📋 Summary: Added: 0, Removed: 0, Modified: 1 Increased: 1, Decreased: 0 ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The image didn't build because
.dockerignoreignored required files. To fix this and make it easy to maintain efficient builds, I inverted the ignore logic from a denylist to an allowlist that includes only what the build requires, and added a CI task to verify the image.