Skip to content

chore: add MIT LICENSE file#62

Closed
spboyer wants to merge 2 commits into
mainfrom
squad/1-add-license
Closed

chore: add MIT LICENSE file#62
spboyer wants to merge 2 commits into
mainfrom
squad/1-add-license

Conversation

@spboyer

@spboyer spboyer commented Mar 4, 2026

Copy link
Copy Markdown
Member

Closes #1

This PR adds the standard MIT License file to the repository as referenced in the README.

Using MIT License with Microsoft Corporation as the copyright holder (2026), which is the standard license used by Microsoft open source projects.

spboyer and others added 2 commits March 4, 2026 17:28
Closes #48

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 4, 2026 22:31
@github-actions github-actions Bot enabled auto-merge (squash) March 4, 2026 22:32

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 adds an MIT LICENSE file and introduces a shared scaffolding FileWriter to centralize “create-if-missing” file creation logic, refactoring waza init and waza new to use it.

Changes:

  • Add repository LICENSE (MIT).
  • Add internal/scaffold FileWriter + unit tests to safely create missing files and report outcomes.
  • Refactor cmd/waza init/new scaffolding to use FileWriter and print outcomes.

Reviewed changes

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

Show a summary per file
File Description
LICENSE Adds the MIT License text.
internal/scaffold/writer.go New helper to write files idempotently (create missing, skip existing) and return an inventory.
internal/scaffold/writer_test.go Unit tests for FileWriter behavior (create, skip, inventory, mkdir parents).
cmd/waza/cmd_new.go Refactors skill scaffolding write loop to use FileWriter, with special handling for overwrite cases.
cmd/waza/cmd_init.go Refactors project initialization file creation to use FileWriter and adjusts summary logic.

Comment thread cmd/waza/cmd_new.go
Comment on lines +343 to +348
var overwriteFiles []fileEntry

for _, f := range files {
if f.overwrite {
overwriteFiles = append(overwriteFiles, f)
} else {

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

overwriteFiles is collected but never used. In Go this causes a compile error (unused variable) and will fail the build/tests. Remove it or use it (e.g., process overwrite entries separately without keeping a second slice).

Suggested change
var overwriteFiles []fileEntry
for _, f := range files {
if f.overwrite {
overwriteFiles = append(overwriteFiles, f)
} else {
for _, f := range files {
if !f.overwrite {

Copilot uses AI. Check for mistakes.
Comment thread cmd/waza/cmd_new.go
Comment on lines +383 to +392
if f.overwrite {
// Handle overwrite files (malformed SKILL.md repair)
if _, statErr := os.Stat(f.path); statErr == nil {
if err := os.WriteFile(f.path, []byte(f.content), 0o644); err != nil {
return fmt.Errorf("failed to write %s: %w", f.path, err)
}
fmt.Fprintf(cmd.OutOrStdout(), " %s %-40s %s (updated)\n", yellowPlus, relPath, f.label) //nolint:errcheck
created++
continue
}
fmt.Fprintf(cmd.OutOrStdout(), " %s %-40s %s\n", greenCheck, relPath, f.label) //nolint:errcheck
continue
}

if err := os.WriteFile(f.path, []byte(f.content), 0o644); err != nil {
return fmt.Errorf("failed to write %s: %w", f.path, err)
} else {

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

The new overwrite handling only writes when the target file already exists. Previously, overwrite entries were still created when missing; now a missing file with overwrite=true will be silently skipped (no write and no output), which changes scaffolding behavior and can leave required files absent. Update the logic to create the file when it doesn't exist (and only overwrite when it does).

See below for a potential fix:

			existed := true
			if _, statErr := os.Stat(f.path); statErr != nil {
				if os.IsNotExist(statErr) {
					existed = false
				} else {
					return fmt.Errorf("failed to stat %s: %w", f.path, statErr)
				}
			}

			if err := os.WriteFile(f.path, []byte(f.content), 0o644); err != nil {
				return fmt.Errorf("failed to write %s: %w", f.path, err)
			}

			if existed {
				fmt.Fprintf(cmd.OutOrStdout(), "  %s %-40s %s (updated)\n", yellowPlus, relPath, f.label) //nolint:errcheck
			} else {
				fmt.Fprintf(cmd.OutOrStdout(), "  %s %-40s %s (created)\n", yellowPlus, relPath, f.label) //nolint:errcheck
			}
			created++

Copilot uses AI. Check for mistakes.
func (w *FileWriter) writeFile(entry FileEntry) (FileOutcome, error) {
// Check if file exists
if _, err := os.Stat(entry.Path); err == nil {
return FileSkipped, nil

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

writeFile treats any os.Stat error as "file missing" and proceeds to create/write. This can mask permission/I/O errors and may write in cases where the path exists but can't be stated. Only skip/create when the error is os.ErrNotExist; for other errors, return a wrapped error.

Suggested change
return FileSkipped, nil
return FileSkipped, nil
} else if !os.IsNotExist(err) {
return "", fmt.Errorf("failed to stat %s: %w", entry.Path, err)

Copilot uses AI. Check for mistakes.
Comment thread cmd/waza/cmd_init.go
Comment on lines 515 to 568
@@ -549,11 +563,19 @@ func initCommandE(cmd *cobra.Command, args []string, noSkill bool, flagSkillsDir
relPath += string(filepath.Separator)
}

if existed {
if item.isDir {
// Directories always show as existing (we created them if needed above)
indicator = "{exist}"

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

Directory items are always displayed as existing () even when they were just created by the MkdirAll pass. This makes the inventory output inaccurate and can confuse the "created" summary. Consider checking whether the directory existed before creating it (e.g., os.Stat / errors.Is(err, os.ErrNotExist)) and set the indicator accordingly.

Copilot uses AI. Check for mistakes.
Comment thread LICENSE
Comment on lines +1 to +3
MIT License

Copyright (c) 2026 Microsoft Corporation

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

PR metadata says this change only adds an MIT LICENSE file, but this PR also introduces a new internal/scaffold FileWriter and refactors waza init/new file-writing logic. Please update the PR title/description (or split into separate PRs) so reviewers understand the full scope and risk of the changes.

Copilot uses AI. Check for mistakes.
@spboyer

spboyer commented Mar 4, 2026

Copy link
Copy Markdown
Member Author

Closing — branch got crossed with FileWriter scaffold changes during concurrent agent execution. Will re-create with LICENSE file only.

@spboyer spboyer closed this Mar 4, 2026
auto-merge was automatically disabled March 4, 2026 23:18

Pull request was closed

@spboyer spboyer deleted the squad/1-add-license branch March 4, 2026 23:19
chlowell pushed a commit to chlowell/waza that referenced this pull request Mar 5, 2026
Packages waza as an azd extension, allowing users to run waza commands
via azd waza <command>.
Contributes to microsoft#62

## What's New

- extension.yaml — Extension manifest defining microsoft.azd.waza with
commands: init, generate, run, compare,
  tokens
- build.ps1 / build.sh — Cross-platform build scripts for creating
extension binaries (Windows, macOS, Linux across
   amd64/arm64)
- registry.json — Extension registry metadata for distribution (for
testing only)
   - version.txt — Version tracking file

##  Usage
  
  ### Install the custom extension source used while testing
```
azd ext source add -n waza -t url -l "https://raw.githubusercontent.com/wbreza/waza/refs/heads/azd-extension/registry.json"
```
### Install the extension
```
azd extension install microsoft.azd.waza
```

### Run waza commands through azd
```
azd waza run examples/code-explainer/eval.yaml -v
azd waza init my-eval --interactive
```
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.

This repo is missing a LICENSE file

2 participants