Commit graph

57 commits

Author SHA1 Message Date
26e2880dde
Add Codecov upload step to GitHub Actions
Added step to upload coverage reports to Codecov.
2025-11-02 22:00:01 +00:00
Snider
adff8e9c07 Merge remote-tracking branch 'origin/main' 2025-11-02 17:56:29 +00:00
28438e1e96 Merge pull request #10 from Snider/feature-non-interactive-quotes
feat: Implement non-interactive quote display
2025-11-02 17:56:13 +00:00
c265e8cc3d
Merge pull request #10 from Snider/feature-non-interactive-quotes
feat: Implement non-interactive quote display
2025-11-02 17:22:22 +00:00
google-labs-jules[bot]
b5daedd735 feat: Implement non-interactive quote display
This commit introduces a non-interactive mode for the `collect` commands. When running in a non-interactive session, the progress bar is replaced with a series of thematic Borg quotes, printed in matrix-green text.

The quotes are sourced from a `quotes.json` file, which is embedded into the binary using Go's `embed` package. The `pkg/ui` package now contains a `NonInteractivePrompter` that detects the session type and displays the quotes accordingly. The `collect` commands have been updated to use this new prompter, and the underlying `vcs` and `website` packages have been made more robust to handle cases where a progress bar is not provided.

This commit also addresses feedback from the code review:
- Fixes a formatting inconsistency in `data/quotes.json`.
- Updates the `go-colorable` dependency to `v0.1.14`.
- Adds a nil-check to the `Write` method in `pkg/ui/progress_writer.go` to prevent panics.
- Implements caching for the quotes using `sync.Once` and adds checks for empty quote slices to prevent panics in `pkg/ui/quote.go`.
- Refactors the `NonInteractivePrompter` in `pkg/ui/non_interactive_prompter.go` to be more robust and efficient.
2025-11-02 16:48:50 +00:00
google-labs-jules[bot]
edc0d6a18c feat: Implement non-interactive quote display
This commit introduces a non-interactive mode for the `collect` commands. When running in a non-interactive session, the progress bar is replaced with a series of thematic Borg quotes, printed in matrix-green text.

The quotes are sourced from a `quotes.json` file, which is embedded into the binary using Go's `embed` package. The `pkg/ui` package now contains a `NonInteractivePrompter` that detects the session type and displays the quotes accordingly. The `collect` commands have been updated to use this new prompter, and the underlying `vcs` and `website` packages have been made more robust to handle cases where a progress bar is not provided.
2025-11-02 16:34:45 +00:00
13b971da7f
Merge pull request #9 from Snider/feat-mkdocs-site
Feat mkdocs site
2025-11-02 16:02:50 +00:00
b51f746f86
Merge branch 'main' into feat-mkdocs-site 2025-11-02 16:02:03 +00:00
google-labs-jules[bot]
f27bb14d95 feat: Add MkDocs site, new CLI command, and documentation
This commit consolidates several features into a single, cohesive change set.

Key features:
- **MkDocs Website:** Introduces a new documentation website built with MkDocs and the Material theme. The source is located in the `docs/` directory.
- **GitHub Pages Deployment:** Adds a GitHub Actions workflow (`.github/workflows/mkdocs.yml`) to automatically build and deploy the website to GitHub Pages on every push to the `main` branch.
- **New CLI Command:** Implements the `collect github repos` command, which allows users to fetch all public repositories for a given user or organization.
- **Documentation Updates:** The `docs/index.md` file has been updated to include documentation for the new `collect github repos` command, as well as the existing `collect github release` command.
2025-11-02 15:59:24 +00:00
google-labs-jules[bot]
92ffddbc0a feat: Add collect github repos command and update docs
This commit introduces a new `collect github repos` command to the CLI. This command allows users to fetch all public repositories for a given user or organization.

Key changes:
- Added a new command file `cmd/collect_github_repos.go`.
- Updated the documentation in `docs/index.md` to include the new command and the `collect github release` command.
2025-11-02 15:42:05 +00:00
92e3538170
Merge pull request #8 from Snider/feat-mkdocs-site
fix(ci): Update GitHub Actions versions and add permissions
2025-11-02 15:19:27 +00:00
038ede4e99
Merge branch 'main' into feat-mkdocs-site 2025-11-02 15:19:12 +00:00
google-labs-jules[bot]
23c1f13ae2 fix(ci): Update GitHub Actions versions and add permissions
This commit updates the `.github/workflows/mkdocs.yml` file to use the latest versions of the `actions/checkout` and `actions/setup-python` actions.

Key changes:
- Upgraded `actions/checkout` from `v2` to `v4`.
- Upgraded `actions/setup-python` from `v2` to `v5`.
- Pinned the Python version to `'3.11'`.
- Added `permissions: contents: write` to the `deploy` job to ensure the workflow has the necessary permissions to publish to GitHub Pages.
2025-11-02 15:17:48 +00:00
f074f6fe2c
Merge pull request #7 from Snider/feat-mkdocs-site
feat: Add MkDocs site and deployment workflow
2025-11-02 15:12:58 +00:00
google-labs-jules[bot]
74de15af8a feat: Add MkDocs site and deployment workflow
This commit introduces a documentation website built with MkDocs and the Material theme.

Key changes:
- Added a `mkdocs.yml` configuration file.
- Renamed `docs/README.md` to `docs/index.md` to serve as the site's homepage.
- Created a GitHub Actions workflow (`.github/workflows/mkdocs.yml`) to automatically build and deploy the site to GitHub Pages on pushes to the `main` branch.
2025-11-02 15:08:34 +00:00
ff29cac315
Delete .task/checksum directory 2025-11-02 15:04:36 +00:00
8df48aed4a
Add .task to .gitignore 2025-11-02 15:04:24 +00:00
86585a6907
Merge pull request #6 from Snider/add-docs-and-examples
Add docs and examples
2025-11-02 14:22:51 +00:00
google-labs-jules[bot]
5a864a9059 feat: Add optional compression to collect commands
This change introduces optional compression to the `collect` commands. Users can now specify `--compression` with `gz` or `xz` to compress the output. The `serve` command has also been enhanced to transparently decompress and serve these files.
2025-11-02 13:27:04 +00:00
google-labs-jules[bot]
92843876cd feat: Enhance serve command to support Matrix files
This change enhances the 'serve' command to support serving files directly from a Terminal Isolation Matrix. It introduces a new 'pkg/tarfs' package that provides an http.FileSystem implementation for tar archives, allowing for a "passthrough" server that serves files directly from the Matrix bundle.
2025-11-02 13:03:48 +00:00
google-labs-jules[bot]
4e5257ce4a feat: Add Terminal Isolation Matrix feature
This change introduces the "Terminal Isolation Matrix", a new output format that creates a runc-compatible container bundle. This allows for the collected files to be run in an isolated environment. A --format flag has been added to all collect commands to support this new format.
2025-11-02 12:39:46 +00:00
google-labs-jules[bot]
4ae69ae74c feat: Add documentation and examples
This change adds a 'docs/README.md' file with command-line documentation and an 'examples' directory containing scripts to demonstrate the tool's usage. It also includes a Go program to inspect the contents of a DataNode.
2025-11-02 12:23:25 +00:00
Snider
a1b29043fc
Merge pull request #5 from Snider/feature-github-release-downloader
fix: Resolve broken build and improve testing
2025-11-02 03:20:17 +00:00
google-labs-jules[bot]
43f3904072 refactor: Improve code quality, testability, and CI
This commit addresses several issues identified in a code review to improve the overall quality and robustness of the application.

Key changes include:
- Added safe type assertions with `nil` checks when retrieving the logger from the context to prevent panics.
- Moved the `bar.Finish()` call to be inside the loop in the `all` command, so each progress bar finishes after its corresponding repository is cloned.
- Added a check for context cancellation at the start of the pagination loop in the GitHub client to prevent unnecessary API calls.
- Ensured the authenticated client is used consistently, even when falling back to the organization endpoint.
- Added `nil` checks for the progress bar parameter in the `website` and `pwa` packages to prevent panics.
- Updated the `golang.org/x/oauth2` dependency to a patched release to address a reported vulnerability.
2025-11-02 01:54:23 +00:00
google-labs-jules[bot]
88502deb41 feat: Add progress bars to long-running operations
This commit improves the user experience of the application by adding progress bars to long-running operations.

The following commands now display a progress bar:
- `collect github repo`
- `collect website`
- `collect pwa`

The underlying packages (`pkg/vcs`, `pkg/website`, and `pkg/pwa`) have been updated to support progress reporting.
2025-11-02 01:26:52 +00:00
google-labs-jules[bot]
beaeb04f03 feat: Add authenticated GitHub access and structured logging
This commit introduces two key improvements to the application:

1.  **Authenticated GitHub API Access:** The GitHub client now uses a personal access token (PAT) from the `GITHUB_TOKEN` environment variable if it is available. This increases the rate limit for GitHub API requests, making the tool more robust for users who need to collect a large number of repositories.

2.  **Structured Logging:** The application now uses the standard library's `slog` package for structured logging. A `--verbose` flag has been added to the root command to control the log level, allowing for more detailed output when needed. This makes the application's output more consistent and easier to parse.
2025-11-02 00:59:46 +00:00
Snider
4fc86ee175
Update cmd/main_test.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-02 00:43:33 +00:00
google-labs-jules[bot]
19f6a95964 refactor: Improve code quality, testability, and CI
This commit addresses several issues identified in a code review to improve the overall quality and robustness of the application.

Key changes include:
- Refactored `cmd.Execute()` to return an error instead of calling `os.Exit`, making the application more testable.
- Fixed critical issues in `cmd/main_test.go`, including renaming `TestMain` to avoid conflicts and removing the brittle E2E test.
- Improved the GitHub API client in `pkg/github/github.go` by:
  - Fixing a resource leak where an HTTP response body was not being closed.
  - Restoring a parameterized function to improve testability.
  - Adding support for `context.Context` and API pagination for robustness.
- Updated the `.github/workflows/go.yml` CI workflow to use the `Taskfile.yml` for building and testing, ensuring consistency.
- Added a `test` task to `Taskfile.yml`.
- Ran `go mod tidy` and fixed several unused import errors.
2025-11-02 00:31:15 +00:00
Snider
199acad1bf adds Task to github runner 2025-11-02 00:05:03 +00:00
google-labs-jules[bot]
8eab762f5e fix: Make end-to-end test portable
This commit fixes a failing end-to-end test (`TestE2E`) by implementing a more robust method for locating the `task` executable.

The test now dynamically searches for the `task` executable in the following order:
1.  The system's `PATH`
2.  The user's Go binary directory (`$HOME/go/bin`)

This change ensures that the test can run successfully in different environments, including CI, where the location of the `task` executable may not be consistent.
2025-11-02 00:02:34 +00:00
google-labs-jules[bot]
aaa8ab3966 fix: Resolve broken build and improve testing
This commit fixes a critical build issue where the application was being compiled as an archive instead of an executable. This was caused by the absence of a `main` package.

The following changes have been made to resolve this and improve the development process:

- A `main.go` file has been added to the root of the project to serve as the application's entry point.
- A `Taskfile.yml` has been introduced to standardize the build, run, and testing processes.
- The build process has been corrected to produce a runnable binary.
- An end-to-end test (`TestE2E`) has been added to the test suite. This test builds the application and runs it with the `--help` flag to ensure the binary is always executable, preventing similar build regressions in the future.
2025-11-01 23:55:14 +00:00
Snider
c96f8cfcfa
Merge pull request #4 from Snider/feature-github-release-downloader
feat: Add ability to download from GitHub releases
2025-11-01 23:47:42 +00:00
Snider
da5a8f3a44 broken @jules 2025-11-01 23:36:04 +00:00
Snider
e02162d67a Merge remote-tracking branch 'origin/main' into feature-github-release-downloader
# Conflicts:
#	cmd/all.go
#	cmd/collect_github_repo.go
#	go.mod
#	go.sum
2025-11-01 23:34:39 +00:00
Snider
23589ccf99 feat: Add .idea to .gitignore and create go.work.sum for dependency management 2025-11-01 23:30:52 +00:00
google-labs-jules[bot]
ed8189e35c feat: Resolve merge conflict, fix tests, and add github release command
This commit resolves a merge conflict by restructuring the `collect` command and its subcommands. The `collect git` and `collect github-release` commands have been consolidated under the new `collect github` command to provide a more organized and user-friendly command structure.

This commit also fixes a failing test in the `vcs` package by adding the necessary git config to the test setup.

Finally, this commit introduces the `collect github release` command, which allows downloading assets from the latest GitHub release of a repository. The command supports version checking, specific file downloads, and packing all assets into a DataNode.
2025-11-01 23:28:32 +00:00
google-labs-jules[bot]
4c6827d21b feat: Update collect pwa command to use flags and update documentation
This commit updates the `collect pwa` command to use the `--uri` and `--output` flags instead of positional arguments. This makes the command's usage more consistent with the other `collect` subcommands.

The documentation for the `collect pwa` command has also been updated to reflect the new flags and their usage.
2025-11-01 23:20:46 +00:00
Snider
e3c9d0fc17
Revise README content for clarity and accuracy
Updated README.md for improved clarity and corrected terminology.
2025-11-01 22:50:02 +00:00
Snider
661617f7a8
Revise README for Borg Data Collector
Updated README to clarify purpose and features of Borg Data Collector.
2025-11-01 22:47:07 +00:00
google-labs-jules[bot]
07db4443af feat: Add collect github command and resolve merge conflict
This commit introduces a new `collect github` command with two subcommands:
- `repo`: Clones a GitHub repository. This functionality was previously under the `collect git` command.
- `release`: Downloads assets from the latest GitHub release of a repository.

The `release` subcommand supports the following features:
- Version checking against a provided version string using the `--version` flag.
- Downloading a specific file from the release using the `--file` flag.
- Downloading all assets from the release and packing them into a DataNode using the `--pack` flag.
- Specifying an output directory for the downloaded files using the `--output` flag.

This commit also resolves a merge conflict by restructuring the `collect` command and its subcommands. The `collect git` and `collect github-release` commands have been consolidated under the new `collect github` command to provide a more organized and user-friendly command structure.
2025-11-01 22:22:32 +00:00
Snider
1658ad9e92
#3 from Snider/repo-maintenance
Repo maintenance
2025-11-01 21:55:08 +00:00
google-labs-jules[bot]
52a07f46be feat: Add ability to download from GitHub releases
This commit introduces a new command `collect github-release` that allows downloading assets from the latest GitHub release of a repository.

The command supports the following features:
- Downloading a specific file from the release using the `--file` flag.
- Downloading all assets from the release and packing them into a DataNode using the `--pack` flag.
- Specifying an output directory for the downloaded files using the `--output` flag.

This commit also includes a project-wide refactoring of the Go module path to `github.com/Snider/Borg` to align with Go's module system best practices.
2025-11-01 19:03:04 +00:00
google-labs-jules[bot]
dc114b21bb feat: Add --user flag to collect all user repos
This commit adds a `--user` flag to the `collect git` command, allowing it to fetch all public repositories for a given GitHub user or organization.

- The `collect git` command was modified to accept a `--user` flag.
- The previous `all` command's functionality has been integrated into the `collect git` command.
- The documentation and examples have been updated to reflect the new flag.
2025-10-31 22:54:50 +00:00
Snider
575b862fd0
Enhance Go CI workflow with coverage reporting
Updated Go workflow to use go-version-file and added coverage report upload.
2025-10-31 22:19:01 +00:00
google-labs-jules[bot]
c68626985e feat: Add go.work, update module path, and add examples
This commit introduces several maintenance improvements to the repository.

- A `go.work` file has been added to define the workspace and make the project easier to work with.
- The module path in `go.mod` has been updated to use a GitHub URL, and all import paths have been updated accordingly.
- `examples` and `docs` directories have been created.
- The `examples` directory contains scripts that demonstrate the tool's functionality.
- The `docs` directory contains documentation for the project.
- Tests have been added to the `pkg/github` package following the `_Good`, `_Bad`, `_Ugly` convention.
- The missing `pkg/borg` package has been added to resolve a build error.
2025-10-31 22:15:05 +00:00
Snider
73b814f1de
#2 from Snider/feature-pwa-downloader
Add PWA Download and Serve Commands
2025-10-31 21:37:31 +00:00
google-labs-jules[bot]
8e82bada06 feat: Add recursive website downloader and progress bar
This commit introduces a new `collect website` command that recursively downloads a website to a specified depth.

- A new `pkg/website` package contains the logic for the recursive download.
- A new `pkg/ui` package provides a progress bar for long-running operations, which is used by the website downloader.
- The `collect pwa` subcommand has been restored to be PWA-specific.
2025-10-31 21:35:53 +00:00
Snider
adfa1d3d51
Downgrade Go version from 1.25 to 1.24 2025-10-31 21:31:23 +00:00
Snider
e9c4b53399
Update Go workflow to use version 1.25 2025-10-31 21:30:08 +00:00
Snider
457e572615
VCS and PWA processing statuses
Added detailed VCS and PWA processing steps to README.
2025-10-31 21:21:35 +00:00