[PR #282] [MERGED] feature: use the repo path instead of name in GetLatestCommit #4445

Closed
opened 2026-04-19 14:06:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/moghtech/komodo/pull/282
Author: @unsync
Created: 1/31/2025
Status: Merged
Merged: 2/7/2025
Merged by: @mbecker20

Base: 1.17.0Head: bug/GetLatestCommit


📝 Commits (5)

  • 325a477 Update repo path handling in commit fetching
  • a23361e feat: use optional name and path in GetLatestCommit
  • c5ada3f review: don't use optional for name
  • 9518a86 review: use helper
  • bbefca8 review: remove redundant to_string()

📊 Changes

4 files changed (+11 additions, -3 deletions)

View changed files

📝 .gitignore (+2 -1)
📝 bin/core/src/monitor/mod.rs (+2 -0)
📝 bin/periphery/src/api/git.rs (+6 -2)
📝 client/periphery/rs/src/api/git.rs (+1 -0)

📄 Description

I had these annoying warning in my logs :

periphery-1  | 2025-01-31T09:19:01.181038Z  WARN periphery::router: request 9cfd7951-de61-4394-8bda-6c37c3b391a7 | type: GetLatestCommit | error: Repo path is not directory. is it cloned?
periphery-1  | 2025-01-31T09:19:16.026513Z  WARN periphery::router: request 3658378e-5e1a-49de-b7d1-234c78d6dc14 | type: GetLatestCommit | error: Repo path is not directory. is it cloned?

I did some digging, forked the repo, added the repo_path to the error log and i think i found the issue.

The GetLatestCommit command takes the repo name as set in the UI, but since we can override the clone path we can end up is a different path than this :

    let repo_path = periphery_config().repo_dir.join(self.name);

So the fix, imho, should be to use the repo path instead of the name, since even if we don't override the clone path, there is always a value set :

.request(GetLatestCommit {
        path: repo.config.path.clone(),
      })

I'm not sure what is the contributions guidelines in terms of testing, but on my end what i did was to build the docker images, pulled it on my servers and saw i didn't get the warnings anymore.

Feedback welcomed 🙏

PS: i based this PR on the 1.17 branch, but i have a branch ready with the same change for 1.16


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/282 **Author:** [@unsync](https://github.com/unsync) **Created:** 1/31/2025 **Status:** ✅ Merged **Merged:** 2/7/2025 **Merged by:** [@mbecker20](https://github.com/mbecker20) **Base:** `1.17.0` ← **Head:** `bug/GetLatestCommit` --- ### 📝 Commits (5) - [`325a477`](https://github.com/moghtech/komodo/commit/325a4775fc97591090b4a197380efca3088907f1) Update repo path handling in commit fetching - [`a23361e`](https://github.com/moghtech/komodo/commit/a23361e5cba4672c82a4b6ccc0c8f508934b1574) feat: use optional name and path in GetLatestCommit - [`c5ada3f`](https://github.com/moghtech/komodo/commit/c5ada3fc6fe7756942f0d99f078ab4b8e671e997) review: don't use optional for name - [`9518a86`](https://github.com/moghtech/komodo/commit/9518a8623d8b685844e6a0e5210d9ecfa2a9d1b1) review: use helper - [`bbefca8`](https://github.com/moghtech/komodo/commit/bbefca8c58946f95c6194d1a8e8dce341cfb3193) review: remove redundant to_string() ### 📊 Changes **4 files changed** (+11 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -1) 📝 `bin/core/src/monitor/mod.rs` (+2 -0) 📝 `bin/periphery/src/api/git.rs` (+6 -2) 📝 `client/periphery/rs/src/api/git.rs` (+1 -0) </details> ### 📄 Description I had these annoying warning in my logs : ``` periphery-1 | 2025-01-31T09:19:01.181038Z WARN periphery::router: request 9cfd7951-de61-4394-8bda-6c37c3b391a7 | type: GetLatestCommit | error: Repo path is not directory. is it cloned? periphery-1 | 2025-01-31T09:19:16.026513Z WARN periphery::router: request 3658378e-5e1a-49de-b7d1-234c78d6dc14 | type: GetLatestCommit | error: Repo path is not directory. is it cloned? ``` I did some digging, forked the repo, added the `repo_path` to the error log and i think i found the issue. The `GetLatestCommit` command takes the repo name as set in the UI, but since we can override the clone path we can end up is a different path than this : ``` let repo_path = periphery_config().repo_dir.join(self.name); ``` So the fix, imho, should be to use the repo `path` instead of the name, since even if we don't override the clone path, there is always a value set : ``` .request(GetLatestCommit { path: repo.config.path.clone(), }) ``` I'm not sure what is the contributions guidelines in terms of testing, but on my end what i did was to build the docker images, pulled it on my servers and saw i didn't get the warnings anymore. Feedback welcomed 🙏 PS: i based this PR on the 1.17 branch, but i have a branch ready with the same change for 1.16 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 14:06:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#4445