Skip to content

Show human readable information in queue info#5516

Merged
6543 merged 16 commits into
mainfrom
queue-info
Sep 23, 2025
Merged

Show human readable information in queue info#5516
6543 merged 16 commits into
mainfrom
queue-info

Conversation

@xoxys

@xoxys xoxys commented Sep 15, 2025

Copy link
Copy Markdown
Member

Fixes: #2948, #5469

Bildschirmfoto 2025-09-15 um 15 18 46

Changes to https://github.com/woodpecker-ci/woodpecker/pull/5516/files#diff-fa3f3d2bbef57c87a86886007de51bf6efd76e6820b8cf279dcb398017a3293f were a drive-by fix as I was wondering why the metadata labels are shown as long as a task is pending but disappear after the task started.

@xoxys xoxys requested a review from a team September 15, 2025 17:20
@qwerty287 qwerty287 added ui frontend related enhancement improve existing features labels Sep 15, 2025
@codecov

codecov Bot commented Sep 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.31915% with 89 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.34%. Comparing base (92ebabe) to head (32a7084).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/api/hook.go 0.00% 82 Missing ⚠️
server/pipeline/queue.go 0.00% 6 Missing ⚠️
server/grpc/filter.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5516      +/-   ##
==========================================
- Coverage   26.40%   26.34%   -0.07%     
==========================================
  Files         405      405              
  Lines       28942    29028      +86     
==========================================
+ Hits         7643     7646       +3     
- Misses      20600    20683      +83     
  Partials      699      699              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread server/store/datastore/migration/026_add_task_fields.go Outdated
Comment thread server/pipeline/queue.go
Comment thread server/queue/fifo.go Outdated
Comment thread server/queue/fifo.go Outdated
Comment thread web/src/views/admin/AdminQueue.vue Outdated
@xoxys xoxys requested a review from a team September 16, 2025 12:20
@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

@anbraten @6543 Can I get another review? 👼

Comment thread server/model/task.go Outdated
@qwerty287

Copy link
Copy Markdown
Contributor

I don't have time for a proper review right now, but I was wondering: What happens if you change the name of an agent? Is this reflected on the queue page?

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

No with the current way this does not update the name for already running tasks.

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

To get the agent name updated immediately, we would need to look up the agent name by ID on every queue info call. There are multiple methods to do it:

  1. Using the store as done with 9d406f9#diff-2d7687e7cf4d8db83805f8950671e37eb0af7d3cf0f470b5ae0b78ad93985401
  2. Using an http call to GET /agents/{agent_id} If we want to use the http call instead of the store call, which base URL should be used? Making an external call to the public URL is IMO.

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

OK I think I found a better way. The agent name lookup is now done on the API level within the GetQueueInfo method. It still uses a store call instead of http call, however I guess on this level its acceptable. This also reflects agent name changes immediatly.

@xoxys xoxys requested review from 6543 and anbraten September 17, 2025 08:57
@woodpecker-bot

woodpecker-bot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Surge PR preview deployment was removed

@qwerty287

Copy link
Copy Markdown
Contributor

Thanks, could we do that on sql level with join?

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

No, at least I dont see a way how this could work (easily).

@qwerty287

Copy link
Copy Markdown
Contributor

Ah you're right, the queue info is not loaded from db, sorry.
But at least some kind of cache for the agents would be good I think? So we don't query the DB multiple times for the same agent. So with a map[int]*model.Agent

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

I had this already but this end up with a lot more code. But I can push it again.

@anbraten

Copy link
Copy Markdown
Member

I had this already but this end up with a lot more code. But I can push it again.

As this introduces such new issues and to keep the api clean, I would still suggest querying the /agents list from the UI for now. We can still add an api property later on, but removing one would be a breaking change again.

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

Ok here we go :D added some helper functions to declutter the enrichment while using the cache map approach.

@xoxys

xoxys commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

As this introduces such new issues and to keep the api clean, I would still suggest querying the /agents list from the UI for now. We can still add an api property later on, but removing one would be a breaking change again.

Why? IMO the latest change is a good one and I dont see any benefit to add it to the UI instead.

@qwerty287

Copy link
Copy Markdown
Contributor

I agree to @xoxys. Querying the agents list should not working as well because of pagination (of course you could work around this by just loading all pages).

@6543 6543 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backend code ack - thanks :)

@anbraten

anbraten commented Sep 17, 2025

Copy link
Copy Markdown
Member

Why? IMO the latest change is a good one and I dont see any benefit to add it to the UI instead.

Adding a property as agent_name to the model while having agent_id already is a mix of models IMO as this property adds no new information that was not queryable before and is rather adjusting the model to match our UI views than providing REST models. Feels more like the graphql approach to me. We also need to keep in mind that those properties are send to the agent via grpc (should not be to crazy for a string yet) and api property removals are considered breaking if we change plans. Won't block if the rest is fine with it.

@6543

6543 commented Sep 17, 2025

Copy link
Copy Markdown
Member

well the problem is that either we have models reused or we have type definition for each interface that marks a border to another component of or software to make things more modulare and have cleare seperation of concerns ...

... as there was already the complaint why we have so many "similar" type definitions and the server component is kind of tangled anyway right now i dont care much ... about that concern

about that I'd love to have modules more clear destinct but at the end of the day it still is a single pice of software that we get by cobine our components ...

this here dont save agent_name to database so only if we wana change the json consumers are affected ...

most probably offtopic but the reason why i'm fine with that mix (through if someone works on better cristalizing out components ... i would welcome that)

@qwerty287 qwerty287 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Frontend seems good now as well, but I didn't test it (but if you did go on with merging)

@xoxys xoxys force-pushed the queue-info branch 2 times, most recently from 3d61482 to 0d441ef Compare September 23, 2025 07:12
@6543 6543 merged commit 7707e84 into main Sep 23, 2025
7 of 9 checks passed
@6543 6543 deleted the queue-info branch September 23, 2025 07:35
@6543 6543 added the highlight label Sep 23, 2025
@woodpecker-bot woodpecker-bot mentioned this pull request Sep 23, 2025
1 task
@xoxys xoxys linked an issue Sep 23, 2025 that may be closed by this pull request
3 tasks
@anbraten

anbraten commented Sep 23, 2025

Copy link
Copy Markdown
Member

Tasks that have not been picked by an agent point to a not existing pipeline: https://ci.woodpecker-ci.org/repos/3780/pipeline/0/4 (works as soon as an agent picks the task)

The border could be using some darker color in dark-mode:
image

FYI @xoxys

@xoxys

xoxys commented Sep 23, 2025

Copy link
Copy Markdown
Member Author

Thx for the feedback, will take care 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve existing features highlight ui frontend related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the queue list, use the agent name rather than the agent id for the badge. Link queue entries to pipeline

5 participants