Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get specific project from forge? #62

Open
theherk opened this issue Jul 13, 2023 · 2 comments
Open

Get specific project from forge? #62

theherk opened this issue Jul 13, 2023 · 2 comments

Comments

@theherk
Copy link

theherk commented Jul 13, 2023

Say I have a working configuration like:

provider = "gitlab"
api_url = "https://gitlab.private"
token_command = "security find-generic-password -w -s gitlab.private -a theherk"
root = "."

[filters]
owner = true
groups = [
  "foo",
]

This gets all the projects from group foo, but what if I want to get a specific project from bar? For example, this doesn't work:

provider = "gitlab"
api_url = "https://gitlab.private"
token_command = "security find-generic-password -w -s gitlab.private -a theherk"
root = "."

[filters]
owner = true
groups = [
  "foo",
]

[[trees]]
root = "./bar"

[[trees.repos]]
name = "bar"
worktree_setup = false

[[trees.repos.remotes]]
name = "origin"
url = "ssh://[email protected]/bar/baz.git"
type = "ssh"

It yields expected struct ConfigProvider.

@hakoerber
Copy link
Owner

Yeah, you currently cannot use both a tree configuration (which specifies the repos explicitly) and a forge integration at the same time.

To understand your use case: You want to get all projects from group foo, but only the project baz from the group bar, correct?

This is currently not possible with the forge integration. Take a look at the available filters here. There is simply no filter to look for a single project. I guess that if you know that there is a certain project in the forge, it's simpler to use an explicit tree configuration (as you did).

I think that the proper way to handle that would be to allow both a forge and a tree config in the same configuration file (the way you did). I'm sure there are going to be a few edge cases regarding conflicts that need to be handled, but I don't see why it should not be possible.

I will leave this issue open as a tracking issue for allowing both trees and forges in the same config, but I will not get around to implementing this in the near future. If you want, feel free to give it a shot. We can also discuss the implementation & approach beforehand in this issue.

@theherk
Copy link
Author

theherk commented Aug 9, 2023

Makes sense, and sounds good. You have my use case understood. If the time arises, I may take a swing at it, but time is hard to come by. Thank you for the response. Will follow up when the time comes if guidance is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants