Skip to content

Fix Docker build#51

Merged
chlowell merged 4 commits into
microsoft:mainfrom
chlowell:dockerfile
Mar 4, 2026
Merged

Fix Docker build#51
chlowell merged 4 commits into
microsoft:mainfrom
chlowell:dockerfile

Conversation

@chlowell

@chlowell chlowell commented Mar 4, 2026

Copy link
Copy Markdown
Member

The image didn't build because .dockerignore ignored 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.

Copilot AI review requested due to automatic review settings March 4, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 .dockerignore denylist 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.

Comment thread .dockerignore
Comment thread .github/workflows/docker-ci.yml Outdated
@codecov-commenter

codecov-commenter commented Mar 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@fbbc8bd). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #51   +/-   ##
=======================================
  Coverage        ?   72.36%           
=======================================
  Files           ?      127           
  Lines           ?    14233           
  Branches        ?        0           
=======================================
  Hits            ?    10299           
  Misses          ?     3178           
  Partials        ?      756           
Flag Coverage Δ
go-implementation 72.36% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chlowell chlowell marked this pull request as ready for review March 4, 2026 19:15
Copilot AI review requested due to automatic review settings March 4, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI review requested due to automatic review settings March 4, 2026 20:03
chlowell and others added 4 commits March 4, 2026 12:03
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .dockerignore
@chlowell chlowell enabled auto-merge (squash) March 4, 2026 20:12
@chlowell chlowell merged commit 952c783 into microsoft:main Mar 4, 2026
6 checks passed
@chlowell chlowell deleted the dockerfile branch March 4, 2026 20:14
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
```
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.

4 participants