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

Implement org/user agents #3539

Merged
merged 64 commits into from
Sep 30, 2024
Merged

Conversation

6543
Copy link
Member

@6543 6543 commented Mar 23, 2024

close #267
close #1816

TODOs:

  • api to register agent for orgs/users
  • secure all rpc endpoints
  • secure set of labels for non-admins
  • WebUI

@6543 6543 added server feature add new functionality labels Mar 23, 2024
@anbraten
Copy link
Member

Nice.

One step would be to add orgId: <orgId>, repoId: <repoId> labels, so we can later on filter by that context, so an agent could be registered for a repo, org or the whole instance.

@6543

This comment was marked as outdated.

anbraten
anbraten previously approved these changes Mar 26, 2024
server/model/agent.go Outdated Show resolved Hide resolved
cmd/agent/core/agent.go Outdated Show resolved Hide resolved
@anbraten anbraten dismissed their stale review March 26, 2024 10:51

by accident

@anbraten anbraten marked this pull request as draft March 28, 2024 07:46
@anbraten
Copy link
Member

anbraten commented Apr 17, 2024

@6543 I've added a commit with the enforced labels and checks I had in mind. What do you think about that approach?

server/grpc/rpc.go Outdated Show resolved Hide resolved
server/model/agent.go Outdated Show resolved Hide resolved
server/model/agent.go Outdated Show resolved Hide resolved
server/pipeline/queue.go Outdated Show resolved Hide resolved
server/queue/queue.go Outdated Show resolved Hide resolved
@6543 6543 force-pushed the server-side-agent-filters branch from ed2e699 to 3e2368f Compare September 13, 2024 13:08
@woodpecker-bot
Copy link
Contributor

woodpecker-bot commented Sep 13, 2024

server/grpc/auth_server.go Outdated Show resolved Hide resolved
@6543 6543 force-pushed the server-side-agent-filters branch from 3ae22e6 to de615ed Compare September 13, 2024 19:00
server/grpc/rpc.go Outdated Show resolved Hide resolved
@6543 6543 changed the title Implement org and repo agents Implement org/user agents Sep 30, 2024
@6543 6543 requested a review from anbraten September 30, 2024 09:08
@anbraten
Copy link
Member

@6543 Could you extract repo agents for now, so we can test org agents for the beginning.

@6543
Copy link
Member Author

6543 commented Sep 30, 2024

I'm realy against it but i want to get this feature done :(

@6543
Copy link
Member Author

6543 commented Sep 30, 2024

@anbraten now the repo stuff is ripped out

@anbraten
Copy link
Member

@6543 One last question. I had a quick look in the code, couldn't we use OrgID = -1 (or OrgID = -1 && RepoID = -1) as check for system agents and drop OwnerID.

We only check for ownerid / system agents here (which could be done by using OrgID = -1 as well):
https://github.com/6543-forks/woodpecker/blob/dc67296cdee9b63f69442775e2cbe03c1badacf3/server/grpc/rpc.go#L472

@6543
Copy link
Member Author

6543 commented Sep 30, 2024

@anbraten my first patch did used this but I removed it because it was just a cause of lot of bugs poping up

& then you can not know who created it

@6543 6543 merged commit febb8c5 into woodpecker-ci:main Sep 30, 2024
5 of 7 checks passed
@6543 6543 deleted the server-side-agent-filters branch September 30, 2024 11:33
@woodpecker-bot woodpecker-bot mentioned this pull request Sep 30, 2024
1 task
@qwerty287
Copy link
Contributor

Do you plan to also support repo agents?

@6543 6543 mentioned this pull request Sep 30, 2024
@6543
Copy link
Member Author

6543 commented Oct 6, 2024

as mentioned the priority agent selection by the queue: #4201

@6543
Copy link
Member Author

6543 commented Oct 7, 2024

if admins want to disable it for hardening porpuses: #4206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build_pr_images If set, the CI will build images for this PR and push to Dockerhub feature add new functionality highlight server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add scopes for agents (-> user agents) Allow users to register own agents
4 participants