Skip to content

Configure as a Go CLI tool#1

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/configure-go-cli-tool
Closed

Configure as a Go CLI tool#1
Copilot wants to merge 2 commits into
mainfrom
copilot/configure-go-cli-tool

Conversation

Copilot AI commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Bootstraps the repository as a Go CLI tool with minimal boilerplate.

Changes

  • Go module: Initialized github.com/githubnext/gh-aw-mcpg with Go 1.24.10
  • CLI entry point: Created main.go with help/version commands using stdlib
  • Documentation: Updated README with build instructions and usage examples
  • Git ignore: Excluded built binary from version control

Usage

$ go build -o gh-aw-mcpg .
$ ./gh-aw-mcpg version
gh-aw-mcpg version 0.1.0

$ ./gh-aw-mcpg
gh-aw-mcpg - Github Agentic Workflows MCP Gateway

Usage:
  gh-aw-mcpg [command]

Available Commands:
  help       Display help information
  version    Display version information

The CLI structure is ready for extension with additional commands and functionality.

Original prompt

Configure as a Go CLI tool.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure project as a Go CLI tool Configure as a Go CLI tool Dec 10, 2025
Copilot AI requested a review from pelikhan December 10, 2025 21:53
@pelikhan pelikhan closed this Dec 20, 2025
@pelikhan pelikhan deleted the copilot/configure-go-cli-tool branch January 7, 2026 22:14
Copilot AI added a commit that referenced this pull request Jan 20, 2026
- Add ExtractSessionID function to internal/auth/header.go
- Update internal/server/auth.go to delegate to auth.ExtractSessionID
- Add comprehensive tests for ExtractSessionID
- Eliminates duplicate authorization parsing logic (Pattern #1 from issue #352)

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
lpcox added a commit that referenced this pull request Jun 1, 2026
…pan_helpers (#6853)

🤖 *This is a draft PR from Repo Assist, an automated AI assistant.*

Addresses recommendation **#1** from the Go Fan review in #6841.

## Summary

`span_helpers.go` and `span_helpers_test.go` imported `semconv/v1.27.0`
while every other file in `internal/tracing/` used `semconv/v1.34.0`.
This creates a mixed schema URL inconsistency in exported traces — spans
from `StartDIFCPipelineSpan` and `StartProxyForwardSpan` would carry the
v1.27.0 schema URL while all other spans use v1.34.0.

## Root Cause

The `span_helpers.go` file was created when the project was on semconv
v1.27.0, and wasn't updated when the rest of the tracing package was
upgraded to v1.34.0.

## Fix

Change the import alias in both files:
```go
// Before:
semconv "go.opentelemetry.io/otel/semconv/v1.27.0"
// After:
semconv "go.opentelemetry.io/otel/semconv/v1.34.0"
```

`URLPathKey` (`url.path`) is defined identically in both versions — this
is a **zero-risk** change.

No `go.mod` changes are needed: `semconv/v1.27.0` and `v1.34.0` are both
sub-packages within the existing `go.opentelemetry.io/otel v1.43.0`
module.

## Trade-offs

- Pure import path change; no API differences at the call sites
- Eliminates mixed schema URL in OTel traces (all spans now report
`SchemaURL: semconv.SchemaURL` consistently)
- `v1.27.0` sub-package becomes unused in the module and can be removed
with `go mod tidy` in a future pass

Related: #6841

## Test Status

⚠️ **Infrastructure limitation**: Network access to `proxy.golang.org`
is blocked in this CI environment, preventing `go build` and `go test`
from running. However:
- `gofmt` parses both files without error
- `URLPathKey` has been defined as `url.path` since semconv v1.20.0 and
the definition is unchanged in v1.34.0
- Both versions are sub-packages of the same Go module at the same
version, so no module resolution is needed
- All other `internal/tracing/` source files already use `v1.34.0`
successfully

> Generated by [Repo
Assist](https://github.com/github/gh-aw-mcpg/actions/runs/26761832881)




> [!WARNING]
> <details>
> <summary>Firewall blocked 1 domain</summary>
>
> The following domain was blocked by the firewall during workflow
execution:
>
> - `proxy.golang.org`
>> To allow these domains, add them to the `network.allowed` list in
your workflow frontmatter:
>
> ```yaml
> network:
>   allowed:
>     - defaults
>     - "proxy.golang.org"
> ```
>
> See [Network
Configuration](https://github.github.com/gh-aw/reference/network/) for
more information.
>
> </details>


> Generated by [Repo
Assist](https://github.com/github/gh-aw-mcpg/actions/runs/26761832881) ·
sonnet46 3.8M ·
[◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw-mcpg+%22gh-aw-workflow-id%3A+repo-assist%22&type=pullrequests)
>
<details>
<summary>Add this agentic workflows to your repo</summary>

To install this agentic workflow, run

```
gh aw add githubnext/agentics@851905c
```
</details>


<!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, version:
1.0.52, model: claude-sonnet-4.6, id: 26761832881, workflow_id:
repo-assist, run:
https://github.com/github/gh-aw-mcpg/actions/runs/26761832881 -->

<!-- gh-aw-workflow-id: repo-assist -->
lpcox added a commit that referenced this pull request Jun 9, 2026
…etOrLaunchForSession (#7268)

🤖 *This PR was created by [Repo
Assist](https://github.com/github/gh-aw-mcpg/actions/runs/27209796205),
an automated AI assistant.*

## Summary

When `GetOrLaunchForSession` handles an HTTP backend, it previously
called `getServerConfig` once (acquiring the read lock), then
immediately delegated to `GetOrLaunch` which called `getServerConfig` a
second time — acquiring the same read lock twice per HTTP request.

## Root Cause

`GetOrLaunchForSession` needed to know the backend type before routing.
For HTTP backends it called `GetOrLaunch`, which blindly re-fetched the
config:

```go
// Before: two lock acquisitions for HTTP
func GetOrLaunchForSession(...) {
    serverCfg, _ := l.getServerConfig(serverID) // lock #1
    if serverCfg.Type == "http" {
        return GetOrLaunch(l, serverID)          // lock #2 inside
    }
}
```

## Fix

Extract the inner logic of `GetOrLaunch` into a private
`getOrLaunchWithConfig` helper that accepts a pre-fetched
`*config.ServerConfig`. Both public functions now call this helper after
their single config lookup:

```go
// After: one lock acquisition per request
func GetOrLaunchForSession(...) {
    serverCfg, _ := l.getServerConfig(serverID)  // lock #1 only
    if serverCfg.Type == "http" {
        return getOrLaunchWithConfig(l, serverID, serverCfg) // no extra lock
    }
}
```

## Trade-offs

- **No public API changes** — `GetOrLaunch` and `GetOrLaunchForSession`
signatures are unchanged.
- **No behaviour change** — The new `getOrLaunchWithConfig` is a
verbatim extraction of the existing `syncutil.GetOrCreate` call body.
- **Minor lock contention reduction** — For HTTP backends routed through
`GetOrLaunchForSession`, the `getServerConfig` RLock is acquired once
instead of twice.

Addresses: #7254

## Test Status

⚠️ **Infrastructure failure**: `go build` and `go test` require
downloading modules from `proxy.golang.org`, which is blocked by the
network firewall in this environment. The code change is a
straightforward extraction with no behavioural changes — the
`getOrLaunchWithConfig` body is an exact verbatim copy of the original
`syncutil.GetOrCreate` closure in `GetOrLaunch`. All existing tests for
`GetOrLaunchForSession_HTTPBackend`, `GetOrLaunch_*`, and related
launchers remain valid and unchanged.

- ✅ `gofmt` — no formatting changes
- ⚠️ `go build` — blocked (proxy.golang.org unreachable in CI sandbox)
- ⚠️ `go test` — blocked (same reason)




> [!WARNING]
> <details>
> <summary>Firewall blocked 1 domain</summary>
>
> The following domain was blocked by the firewall during workflow
execution:
>
> - `proxy.golang.org`
>> To allow these domains, add them to the `network.allowed` list in
your workflow frontmatter:
>
> ```yaml
> network:
>   allowed:
>     - defaults
>     - "proxy.golang.org"
> ```
>
> See [Network
Configuration](https://github.github.com/gh-aw/reference/network/) for
more information.
>
> </details>


> Generated by [Repo
Assist](https://github.com/github/gh-aw-mcpg/actions/runs/27209796205) ·
sonnet46 5.2M ·
[◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw-mcpg+%22gh-aw-workflow-id%3A+repo-assist%22&type=pullrequests)
>
<details>
<summary>Add this agentic workflows to your repo</summary>

To install this agentic workflow, run

```
gh aw add githubnext/agentics@851905c
```
</details>


<!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, version:
1.0.52, model: claude-sonnet-4.6, id: 27209796205, workflow_id:
repo-assist, run:
https://github.com/github/gh-aw-mcpg/actions/runs/27209796205 -->

<!-- gh-aw-workflow-id: repo-assist -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants