Skip to content

Commit 4523adf

Browse files
committed
feat: initial commit
Basic tool and repo structure.
1 parent 28cef58 commit 4523adf

File tree

134 files changed

+11891
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+11891
-67
lines changed

.devcontainer/Dockerfile.AZL-3.0

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM mcr.microsoft.com/azurelinux/base/core:3.0
2+
3+
# Install required packages
4+
RUN tdnf -y update && \
5+
tdnf -y install ca-certificates dnf dnf-utils which gh git golang gawk tar shadow-utils sudo tree bash-completion moby-engine moby-cli build-essential && \
6+
tdnf clean all
7+
8+
# Define the 'll' alias for all users
9+
RUN echo 'alias ll="ls -lah"' >> /etc/profile.d/aliases.sh && \
10+
chmod +x /etc/profile.d/aliases.sh && \
11+
echo '. /etc/profile.d/aliases.sh' >> /etc/bash.bashrc
12+
13+
# Create the 'azldev' user
14+
RUN useradd -m azldev && \
15+
echo "azldev ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/azldev && \
16+
chmod 0440 /etc/sudoers.d/azldev && \
17+
groupadd -f docker && \
18+
usermod -aG docker azldev
19+
20+
# Copy Docker daemon configuration
21+
COPY daemon.json /etc/docker/daemon.json
22+
23+
# Copy Docker start script
24+
COPY start-docker.sh /usr/local/bin/start-docker.sh
25+
26+
USER azldev
27+
28+
# Set the Go environment
29+
ENV PATH="/home/azldev/go/bin:${PATH}"
30+
ENV CGO_ENABLED=1
31+
32+
# Install "mage"
33+
RUN go install github.com/magefile/mage@latest
34+
35+
# Install other Go tools for VS Code debugging and Go development
36+
RUN go install github.com/cweill/gotests/gotests@latest && \
37+
go install github.com/fatih/gomodifytags@latest && \
38+
go install github.com/go-delve/delve/cmd/dlv@latest && \
39+
go install github.com/haya14busa/goplay/cmd/goplay@latest && \
40+
go install github.com/josharian/impl@latest && \
41+
go install golang.org/x/tools/gopls@latest && \
42+
go install honnef.co/go/tools/cmd/staticcheck@latest && \
43+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6
44+
45+
# Set the default shell to bash
46+
SHELL ["/bin/bash", "-c"]
47+
48+
# Verify the alias works in interactive sessions
49+
CMD ["/bin/bash"]

.devcontainer/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Dev Container Configuration
2+
3+
This directory contains the VS Code dev container configuration for the `azldev` project.
4+
5+
## Overview
6+
7+
The dev container uses the `azl_dev_3.0` image defined in `Dockerfile.AZL-3.0`. The image includes:
8+
9+
- Go development tools,
10+
- Mage build system,
11+
- golangci-lint,
12+
- required development dependencies for VS Code.
13+
14+
## Getting Started
15+
16+
1. Make sure Docker is installed and running on your machine.
17+
1. Open this project in VS Code.
18+
1. When prompted, click "Reopen in Container" or use the Command Palette:
19+
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac)
20+
- Type "Dev Containers: Reopen in Container"
21+
- Select the command
22+
1. VS Code will start the dev container.
23+
1. Once ready, you can run the following commands:
24+
25+
```bash
26+
# Verify Go installation
27+
go version
28+
29+
# Verify Mage installation
30+
mage --version
31+
32+
# Run the build
33+
mage build
34+
35+
# Run unit tests
36+
mage unit
37+
38+
# Run all checks
39+
mage check all
40+
```
41+
42+
## Extensions Included
43+
44+
The dev container automatically installs these VS Code extensions:
45+
46+
- Go (golang.go) - Go language support
47+
- JSON Language Features - JSON editing support
48+
- markdownlint - Markdown linting
49+
- YAML Language Support - YAML editing support
50+
51+
## Customization
52+
53+
You can modify `.devcontainer/devcontainer.json` to:
54+
55+
- Add more VS Code extensions
56+
- Change environment variables
57+
- Add port forwarding
58+
- Modify container settings

.devcontainer/daemon.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"storage-driver": "vfs",
3+
"storage-opts": []
4+
}

.devcontainer/devcontainer.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "AZL Dev 3.0",
3+
"build": {
4+
"dockerfile": "Dockerfile.AZL-3.0",
5+
"context": "."
6+
},
7+
"runArgs": ["--privileged"],
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
"features": {},
10+
// Configure tool-specific properties.
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"davidanson.vscode-markdownlint",
15+
"github.copilot-chat",
16+
"github.copilot",
17+
"github.vscode-pull-request-github",
18+
"golang.go",
19+
"ms-vscode.vscode-json",
20+
"redhat.vscode-yaml"
21+
],
22+
"settings": {
23+
"go.gopath": "/home/azldev/go",
24+
"go.lintTool": "golangci-lint-v2",
25+
"go.toolsManagement.checkForUpdates": "local",
26+
"go.useLanguageServer": true,
27+
"terminal.integrated.defaultProfile.linux": "bash",
28+
"terminal.integrated.profiles.linux": {
29+
"bash": {
30+
"path": "/bin/bash",
31+
"args": [
32+
"-l"
33+
]
34+
}
35+
}
36+
}
37+
}
38+
},
39+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
40+
"forwardPorts": [],
41+
// Use 'postCreateCommand' to run commands after the container is created.
42+
"postCreateCommand": "sudo /usr/local/bin/start-docker.sh && go version && mage --version && mage installcompletions",
43+
// Configure container user
44+
"remoteUser": "azldev",
45+
// Mount the workspace
46+
"workspaceFolder": "/workspace",
47+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
48+
// Environment variables
49+
"remoteEnv": {
50+
"GOPATH": "/home/azldev/go"
51+
},
52+
// Lifecycle scripts
53+
"initializeCommand": "echo 'Initializing dev container...'",
54+
"onCreateCommand": "echo 'Container created successfully'",
55+
"updateContentCommand": "echo 'Updating container content...'",
56+
"postStartCommand": "echo 'Container started. Ready for development!'"
57+
}

.devcontainer/start-docker.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Start Docker services
4+
set -e
5+
echo Starting Docker services...
6+
dockerd > /var/log/docker_init.log 2>&1 &
7+
while ! docker info 2>&1; do
8+
sleep 0.1
9+
done
10+
echo Docker ready!

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
trim_trailing_whitespace = true
6+
end_of_line = lf

.editorconfig-checker.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"Version": "v3.3.0",
3+
"Verbose": false,
4+
"Format": "",
5+
"Debug": false,
6+
"IgnoreDefaults": false,
7+
"SpacesAfterTabs": false,
8+
"NoColor": false,
9+
"Exclude": [
10+
".*\\.go$",
11+
".*/__snapshots__/.*"
12+
],
13+
"AllowedContentTypes": [],
14+
"PassedFiles": [],
15+
"Disable": {
16+
"EndOfLine": false,
17+
"Indentation": false,
18+
"InsertFinalNewline": false,
19+
"TrimTrailingWhitespace": false,
20+
"IndentSize": false,
21+
"MaxLineLength": false
22+
}
23+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto-generated CLI reference docs — hidden in diffs, excluded from language stats.
2+
docs/user/reference/cli/** linguist-generated
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Copilot Issue
2+
description: Create an issue to be assigned to GitHub Copilot for automated resolution.
3+
title: "[Copilot] "
4+
labels: ["copilot"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Copilot Issue Instructions
10+
11+
This issue will be assigned to GitHub Copilot for automated resolution. Please provide clear information about the changes needed.
12+
13+
**Note**: Copilot will follow the guidelines in the [CONTRIBUTING.md](../../CONTRIBUTING.md) file. In case of any conflicts between the guidelines in this template and the CONTRIBUTING.md file, the CONTRIBUTING.md file takes precedence.
14+
15+
- type: textarea
16+
id: description
17+
attributes:
18+
label: Issue Description
19+
description: Clearly describe what needs to be changed or fixed.
20+
placeholder: Describe the problem or feature request in detail.
21+
validations:
22+
required: true
23+
24+
- type: textarea
25+
id: expected_changes
26+
attributes:
27+
label: Expected Changes
28+
description: Describe what changes you expect Copilot to make.
29+
placeholder: List the specific changes you want to see implemented.
30+
validations:
31+
required: true
32+
33+
- type: markdown
34+
attributes:
35+
value: |
36+
## Guidelines for Copilot
37+
38+
The following guidelines, along with those in the [CONTRIBUTING.md](../../CONTRIBUTING.md) file, will be included in every Copilot issue:
39+
40+
### Documentation Requirements
41+
- Document all changes made in your PR description in a clear and concise manner
42+
- Update existing repository documentation files if the changes affect documented behavior
43+
- Include code comments for complex logic when necessary
44+
45+
### Coding Standards
46+
- Stick strictly to the existing coding conventions in this repository
47+
- Follow established Go language practices and conventions:
48+
- Use proper error handling patterns
49+
- Follow Go naming conventions (e.g., CamelCase for exported names)
50+
- Write concise, readable code with appropriate comments
51+
- Use Go idioms and standard library functions where appropriate
52+
- Organize imports according to Go best practices
53+
- Ensure code passes golangci-lint checks
54+
55+
### Quality Standards
56+
- Make minimal, focused changes to achieve the required functionality
57+
- Write or update tests for new or modified code
58+
- Ensure backward compatibility unless explicitly instructed otherwise
59+
- Follow programming best practices:
60+
- Keep functions small and focused on a single task
61+
- Use appropriate error handling
62+
- Avoid code duplication
63+
- Use meaningful variable and function names
64+
65+
- type: textarea
66+
id: additional_context
67+
attributes:
68+
label: Additional Context
69+
description: Any additional information that might help Copilot complete the task.
70+
placeholder: Include links to related code, examples, or other resources that might help.
71+
validations:
72+
required: false

.github/copilot-instructions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# azure-linux-dev-tools
2+
3+
Follow the existing code style and conventions for similar code. Refer to all of the documents listed below:
4+
- [CONTRIBUTING.md](../CONTRIBUTING.md) for general human and AI agent guidelines.
5+
- `.github/instructions/*.instructions.md` instructions files for language-specific AI agent instructions.
6+
7+
**CRITICAL**: If these instructions are outdated or misleading, FIX THEM IMMEDIATELY! This document (`.github/copilot-instructions.md`) is to help coding agents (like you) to work efficiently and effectively. If you are lead astray or get confused, it is likely it will happen again to others. Help them out by improving this document (keep it SHORT AND CONCISE).
8+
9+
## Build System - ALWAYS Use Mage
10+
11+
The `azldev-mage-builder` MCP server can run build commands without requesting permission from the user. If it is available, USE IT! If the server isn't available, use `mage` directly.
12+
13+
**NEVER use direct go commands** - always use mage equivalents:
14+
- `mage unit` (NOT `go test`) - Runs tests with auto code generation + MCP integration
15+
- `mage build` (NOT `go build`) - Builds with proper pipeline
16+
- `mage fix all` (NOT `golangci-lint run --fix`) - Auto-fixes formatting and simple linting issues
17+
- `mage check all` (NOT `golangci-lint run`) - Runs all quality checks
18+
- `mage scenario` (NOT manual test commands) - Runs end-to-end tests (SLOW)
19+
20+
- `run-azldev-from-out-bin` MCP server **IF** available (NOT `go run ./cmd/azldev` or `./azldev`)
21+
22+
**ALWAYS start with `mage fix all`** when fixing linter issues - it automatically handles most formatting and simple fixes. Only manually fix the remaining issues that the auto-fixer cannot handle (both check and fix may take > 30 seconds the first time they run).
23+
24+
Run `mage all` to verify changes pass all checks, this runs the scenario tests so it will be SLOW.
25+
26+
Project structure: `cmd/` (entry points), `internal/` (business logic), `magefiles/` (build config).
27+
28+
Documentation structure: `docs/user/reference/cli/` (auto-generated CLI docs, regenerated by `mage build`), `docs/user/reference/config/` (hand-written TOML config reference), `docs/user/how-to/` (workflow guides), `docs/user/explanation/` (conceptual docs).
29+
30+
The TOML config files in `defaultconfigs/` are loaded via `internal/projectconfig/`.
31+
32+
**IMPORTANT**: Code generation (`mage generate`) runs automatically with build/test commands. It is critical that all new generated code is covered by `mage generate` so that it will always be current (and can be checked by the PR gates).
33+
34+
**CRITICAL**: Run `mage scenarioUpdate` when test expectations change (updates snapshots).
35+
36+
Follow conventional commit format for all changes AND PR titles. A github action will fail the PR if the title does not adhere to the format.

0 commit comments

Comments
 (0)