920 Commits

Author SHA1 Message Date
gabrie30
4d35539b0e
trigger ci 2025-12-16 11:39:24 -08:00
gabrie30
707e1a533e
trigger ci 2025-12-16 11:35:50 -08:00
Blair Hamilton
20f95aa25e
feat: Add --sync-default-branch CLI flag and refactor logging
- Add --sync-default-branch flag to clone command for enabling sync feature via CLI
- Add syncDefaultBranch variable and flag handler in cmd package
- Refactor git/sync.go to use colorlog consistently throughout
  - Convert all fmt.Printf debug statements to colorlog.PrintInfo/PrintSuccess/PrintError
  - Remove all GHORG_DEBUG environment variable checks
  - Return formatted errors with context using fmt.Errorf for better error messages
- Add comprehensive tests for sync-default-branch flag
  - Test default value is false
  - Test flag sets environment variable correctly
- All existing tests continue to pass
2025-12-15 14:36:14 -05:00
Blair Hamilton
70f9fb45b8
Add sync feature with comprehensive testing and documentation
- Implement SyncDefaultBranch function with 4 safety checks
- Add 8 git helper functions (GetRemoteURL, HasLocalChanges, etc.)
- Add 640 lines of unit tests for git helpers (git_test.go)
- Add 2074 lines of sync tests with 45+ scenarios (sync_test.go)
- Integrate GHORG_SYNC_DEFAULT_BRANCH environment variable
- Add 8 testing targets to Makefile
- Update README.md with comprehensive sync feature documentation
- Update sample-conf.yaml with detailed configuration comments
- Add test coverage verification document

Safety checks implemented:
- Skips sync if uncommitted local changes
- Skips sync if unpushed commits
- Skips sync if commits not on default branch
- Skips sync if default branch diverged from HEAD

Test coverage: 51.6% overall, 76-100% on new functions
2025-12-08 11:14:28 -05:00
Blair Hamilton
9015afb0f1
fix: update vulnerable dependencies to address security issues (#598)
Updates two dependencies with known security vulnerabilities:

1. github.com/gomarkdown/markdown
   - Updated from v0.0.0-20191123064959-2c17d62f5098 (Nov 2019)
   - Updated to v0.0.0-20250810172220-2e2c11897d1a (Aug 2025)   - Fixes 2 HIGH severity vulnerabilities reported by OSV scanner2. github.com/disintegration/imaging   - Updated from v1.6.2   - Updated to v1.6.3-0.20201218193011-d40f48ce0f09 (master branch)
   - Fixes 1 MEDIUM severity vulnerability
   - Note: Using master branch as no new tagged release available since 2019

Both packages are indirect dependencies pulled in through
github.com/MichaelMure/go-term-markdown.

Changes:
- go get github.com/gomarkdown/markdown@latest
- go get github.com/disintegration/imaging@master
- go mod tidy
- go mod vendor

All tests pass and build successful.
2025-12-07 14:00:12 -08:00
gabrie30
4d87d97b59
Bump version to v1.11.8 and update changelog
Prepared for the next release by updating the version constant to v1.11.8 in cmd/version.go and adding a new unreleased section to CHANGELOG.md.
2025-12-06 08:01:17 -08:00
gabrie30
79c2ca9af5
Update CHANGELOG.md v1.11.7 2025-12-06 07:59:18 -08:00
gabrie30
0bf4cb1694
Update CHANGELOG.md 2025-11-29 09:23:18 -08:00
gabrie30
adf25948f5
Add parallel pagination for SCM repo fetching (#597) 2025-11-29 09:22:41 -08:00
dependabot[bot]
515232a549
Bump golang.org/x/crypto in /scripts/local-gitea/seeder (#595)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.39.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.39.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-11-19 21:09:34 -08:00
dependabot[bot]
18ed8b2baa
Bump golang.org/x/crypto from 0.39.0 to 0.45.0 (#596)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.39.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.39.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 21:09:11 -08:00
gabrie30
eceb10f6d4
Add GHORG_FETCH_ALL check to no-clean mode processing (#594)
The handleNoCleanMode function now only performs fetch-all operations if GHORG_FETCH_ALL is set to true, improving control over repository processing. Added tests to verify behavior when fetch-all is enabled and disabled.
2025-11-08 07:36:03 -08:00
gabrie30
f05578e580
Bump version to v1.11.7 and update changelog
Updated the version constant in cmd/version.go to v1.11.7 and added an unreleased section for 1.11.7 in CHANGELOG.md to prepare for the next release.
2025-11-06 07:53:42 -08:00
gabrie30
43647d3fd3
Strip tilde from Sourcehut usernames in output dir v1.11.6 2025-11-06 07:51:17 -08:00
gabrie30
5c1d87b69d
updates 2025-11-03 21:58:34 -08:00
dependabot[bot]
2ac2813222
Bump gitlab.com/gitlab-org/api/client-go from 0.150.0 to 0.157.1 (#592)
Bumps [gitlab.com/gitlab-org/api/client-go](https://gitlab.com/gitlab-org/api/client-go) from 0.150.0 to 0.157.1.
- [Release notes](https://gitlab.com/gitlab-org/api/client-go/tags)
- [Changelog](https://gitlab.com/gitlab-org/api/client-go/blob/main/CHANGELOG.md)
- [Commits](https://gitlab.com/gitlab-org/api/client-go/compare/v0.150.0...v0.157.1)

---
updated-dependencies:
- dependency-name: gitlab.com/gitlab-org/api/client-go
  dependency-version: 0.157.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-02 12:24:28 -08:00
dependabot[bot]
2157b6b986
Bump code.gitea.io/sdk/gitea from 0.22.0 to 0.22.1 (#591)
Bumps code.gitea.io/sdk/gitea from 0.22.0 to 0.22.1.

---
updated-dependencies:
- dependency-name: code.gitea.io/sdk/gitea
  dependency-version: 0.22.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-11-02 12:23:33 -08:00
dependabot[bot]
b227dc66be
Bump golang.org/x/oauth2 from 0.31.0 to 0.32.0 (#590)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.31.0 to 0.32.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-11-02 12:22:56 -08:00
gabrie30
8ff9410049
Add Sourcehut SCM support and integration tests (#593) 2025-11-02 12:22:29 -08:00
Blake Williams
a838fb0afe
Sourcehut support (#589) 2025-11-02 08:10:41 -08:00
gabrie30
939b74f081
Bump version to v1.11.6 and update changelog 2025-10-30 22:15:10 -07:00
gabrie30
2fbe4942ce
Update CHANGELOG.md v1.11.5 2025-10-30 22:13:08 -07:00
gabrie30
a318b87e79
Update CHANGELOG.md 2025-10-30 22:10:53 -07:00
gabrie30
d7f973c87b
Update github_cloud_integration_tests.sh (#588) 2025-10-30 07:47:18 -07:00
gabrie30
02472ab062
Document ghorgonly file support in changelog and README
Added details about the new `ghorgonly` file feature, which allows cloning only repositories matching specified substring patterns. Updated the CHANGELOG and README to describe usage, configuration, and CSV output changes related to this filter.
2025-10-30 07:04:25 -07:00
François Gouteroux
849491d3bf
feat: add ghorgonly file to clone only targets repo matching lines substring (#587) 2025-10-30 00:04:01 -07:00
dependabot[bot]
170209b254
Bump gitlab.com/gitlab-org/api/client-go from 0.142.0 to 0.148.1 (#583)
Bumps [gitlab.com/gitlab-org/api/client-go](https://gitlab.com/gitlab-org/api/client-go) from 0.142.0 to 0.148.1.
- [Release notes](https://gitlab.com/gitlab-org/api/client-go/tags)
- [Changelog](https://gitlab.com/gitlab-org/api/client-go/blob/main/CHANGELOG.md)
- [Commits](https://gitlab.com/gitlab-org/api/client-go/compare/v0.142.0...v0.148.1)

---
updated-dependencies:
- dependency-name: gitlab.com/gitlab-org/api/client-go
  dependency-version: 0.148.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-03 08:48:49 -07:00
dependabot[bot]
c0f176a389
Bump github.com/spf13/cobra from 1.9.1 to 1.10.1 (#582)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.9.1 to 1.10.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.9.1...v1.10.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-version: 1.10.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-10-03 08:27:03 -07:00
dependabot[bot]
10cd4d3fe8
Bump code.gitea.io/sdk/gitea from 0.21.0 to 0.22.0 (#584)
Bumps code.gitea.io/sdk/gitea from 0.21.0 to 0.22.0.

---
updated-dependencies:
- dependency-name: code.gitea.io/sdk/gitea
  dependency-version: 0.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-10-03 08:26:11 -07:00
dependabot[bot]
5b45af108b
Bump github.com/ktrysmt/go-bitbucket from 0.9.86 to 0.9.87 (#585)
Bumps [github.com/ktrysmt/go-bitbucket](https://github.com/ktrysmt/go-bitbucket) from 0.9.86 to 0.9.87.
- [Release notes](https://github.com/ktrysmt/go-bitbucket/releases)
- [Commits](https://github.com/ktrysmt/go-bitbucket/compare/v0.9.86...v0.9.87)

---
updated-dependencies:
- dependency-name: github.com/ktrysmt/go-bitbucket
  dependency-version: 0.9.87
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-03 08:25:47 -07:00
dependabot[bot]
47268e2da6
Bump github.com/bradleyfalzon/ghinstallation/v2 from 2.16.0 to 2.17.0 (#581)
Bumps [github.com/bradleyfalzon/ghinstallation/v2](https://github.com/bradleyfalzon/ghinstallation) from 2.16.0 to 2.17.0.
- [Release notes](https://github.com/bradleyfalzon/ghinstallation/releases)
- [Commits](https://github.com/bradleyfalzon/ghinstallation/compare/v2.16.0...v2.17.0)

---
updated-dependencies:
- dependency-name: github.com/bradleyfalzon/ghinstallation/v2
  dependency-version: 2.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-10-03 08:25:12 -07:00
dependabot[bot]
247a6a7a2a
Bump golang.org/x/oauth2 from 0.30.0 to 0.31.0 (#580)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.30.0 to 0.31.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-10-03 08:24:48 -07:00
dependabot[bot]
400391d3f1
Bump github.com/spf13/viper from 1.20.1 to 1.21.0 (#579)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.20.1 to 1.21.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.20.1...v1.21.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-03 08:24:24 -07:00
dependabot[bot]
05119032f6
Bump rexml from 3.3.9 to 3.4.2 in /site (#577)
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.9 to 3.4.2.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.3.9...v3.4.2)

---
updated-dependencies:
- dependency-name: rexml
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-17 22:24:15 -07:00
gabrie30
12bc4eb487
Refactor to use 'any' instead of 'interface{}' (#574) 2025-09-08 07:46:19 -07:00
gabrie30
9886bb0526
Sanitize token read from file and add tests (#573)
Improved GetTokenFromFile to remove BOM, whitespace, and control characters, ensuring only valid printable ASCII characters are returned. Added comprehensive tests for various token file formats and updated the changelog.
2025-09-06 22:37:20 -07:00
dependabot[bot]
9a24dabe97
Bump golang.org/x/net in /scripts/local-bitbucket/seeder (#571)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 06:44:34 -07:00
dependabot[bot]
30000e8d2a
Bump golang.org/x/oauth2 in /scripts/local-bitbucket/seeder (#570)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.8.0 to 0.27.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.8.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.27.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 06:40:09 -07:00
gabrie30
19713cf8df
Update README.md 2025-08-31 22:36:11 -07:00
gabrie30
b702d503e7
Add Bitbucket Server support and integration tests (#569) 2025-08-31 22:33:45 -07:00
gabrie30
ccd0fc8651
Update version.go 2025-08-30 08:34:24 -07:00
gabrie30
fc57b26c33
Update .goreleaser.yml 2025-08-29 07:57:47 -07:00
gabrie30
bc32fdf3c2
Update CHANGELOG.md v1.11.4 2025-08-29 07:43:07 -07:00
gabrie30
ca50b7e98a
Update Go version to 1.24.6 and refresh dependencies (#568)
Bump Go version to 1.24.6 across workflows and go.mod files for consistency and latest features. Update dependencies in scripts/local-gitea/seeder/go.mod and go.sum, including code.gitea.io/sdk/gitea and indirect packages, to their latest versions.
2025-08-28 22:24:51 -07:00
gabrie30
799f3e1c0f
Update CHANGELOG.md 2025-08-28 17:36:55 -07:00
gabrie30
fd26d5e698
Add clone delay option with auto concurrency adjustment (#567)
* Add clone delay option with auto concurrency adjustment

Introduces GHORG_CLONE_DELAY_SECONDS to control delay between cloning repositories for rate limiting. When set to a value greater than 0, concurrency is automatically set to 1 for predictable behavior. Updates CLI flags, environment variable defaults, config printing, and sample config documentation. Applies delay before cloning or pulling repositories.

* Refactor clone delay logic and add helper functions

Introduced helper functions for parsing and applying clone delay configuration, improving code reuse and readability. Centralized delay logic in repository processing and removed duplicate environment variable checks. Now, clone delay is consistently applied and concurrency is auto-adjusted when necessary.
2025-08-28 17:35:40 -07:00
Alexandre Fedossov
6b66283745
Unmarshal custom properties for the repo (#566)
Fixed by upgrading go-github from v62 to v72

1. Updated go.mod to require github.com/google/go-github/v72@latest
2. Updated import statements in scm/github.go and scm/github_test.go
3. Updated vendor directory with go mod vendor

The custom_properties field now properly handles GitHub's API response format where it can be an array, thanks to the map[string]interface{} type in v72.
2025-08-28 11:35:57 -07:00
dependabot[bot]
3d8f08a8c5
Bump golang.org/x/crypto in /scripts/local-gitea/test-runner (#565)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.17.0 to 0.35.0.
- [Commits](https://github.com/golang/crypto/compare/v0.17.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
2025-08-27 21:59:34 -07:00
gabrie30
5c345e276f
Fix gitea (#564) 2025-08-27 20:17:32 -07:00
gabrie30
331380417e
Add Gitea integration test system (#563)
Introduce scripts, configs, and Go tools for local Gitea integration testing. Includes workflow for GitHub Actions, seeding and test scenario configuration, runner and seeder binaries, and supporting shell scripts. Updates .gitignore to exclude Gitea test binaries.
2025-08-27 19:54:21 -07:00