Skip to content

Windows: YouTrack integration (self-hosted, follows a saved search) - #82

Open
AlbertMcAvoy wants to merge 6 commits into
Louis-CFM:mainfrom
AlbertMcAvoy:feature/youtrack-integration
Open

AlbertMcAvoy wants to merge 6 commits into
Louis-CFM:mainfrom
AlbertMcAvoy:feature/youtrack-integration

Conversation

@AlbertMcAvoy

Copy link
Copy Markdown

Stacked on #59 (GitLab): it reuses the news card and the scrolling list that #59 brings. Until #59 is merged, the diff here also shows #59's commits; the YouTrack part is the last commit.

What it does

Adds a YouTrack pill to the Windows island, for a self-hosted instance. It follows one saved search that you pick in the settings, and notifies you when an issue of that search is:

  • created by someone else: "Created by Ada: APP-12 Login page loops";
  • updated by someone else (a field, a comment, a link…): "Updated by Ada: APP-12 Login page loops".

Your own changes don't notify you: they already happened in front of you.

Everything new in the same minute arrives as one notification, like GitLab's: one sound, one badge, "N YouTrack updates" with the list, and the same news card as GitLab's, with a pink Mochi.

The card lists the search's issues, five rows on screen and the rest a scroll away:

  1. the last half hour's news, highlighted;
  2. then the search's issues, most recently updated first. Resolved ones are grey.

Every row opens its issue. "N issues" opens the search in YouTrack, and ↗ / "Open YouTrack" open the instance. The overview grows to 210 px while this card is shown, as it does for GitLab's.

Read-only: Coucou never changes an issue.

Setup

Settings → Integrations → YouTrack:

  • Instance URL: https://host or https://host/youtrack. Only http(s):// is accepted.
  • Permanent token: created in YouTrack under Profile → Account Security → Tokens.
  • Saved search: a list loaded from the instance once the URL and the token are saved, with your own searches first, then those shared with you. It reloads when either changes, and has a Reload button.

The three values live in the Windows Credential Manager, like GitLab's. Nothing is polled until the token exists and the pill is switched on, and Pause stops it like the others. Picking a search refreshes the pill right away, only if it is switched on.

How

  • poll_youtrack in integrations.rs runs every 60 s and makes 3 requests:
    • users/me (checks the URL and the token, and gives your login);
    • savedQueries/{id}, the followed search's text;
    • issues?query=…, its 50 most recently updated issues.
  • The search is run without its own sort by: clause, and sorted by updated desc instead. Otherwise a search sorted by priority would decide which 50 issues are read, and recent changes could fall outside them.
  • What's new is a pure function, youtrack_fresh, with tests.
    • It remembers the latest updated it saw. An issue above it is news: "Created" if its created is above it too, "Updated" otherwise.
    • Who did it is the reporter or the updater. If that's you, it isn't news.
    • The first answer primes it, so launching Coucou says nothing. Picking another saved search starts afresh, silently.
  • The saved search id goes into a URL path, so only [A-Za-z0-9._-] is accepted.
  • Errors show on the card: invalid token (401), no access (403), not a YouTrack address (404 on users/me), saved search gone (404), a search YouTrack can't run (400), no connection. As for GitLab, the connection error is printed without the URL.
  • Shared with GitLab: the news card (buildNews), Mochi taking the integration's colour on it (NEWS_VIEWS), and the half-hour news bookkeeping (recent_news, news_event). GitLab's behaviour is unchanged, and its tests still pass.
  • No Cargo change.

Testing

Windows 11 (build 26200).

  • cargo test -p coucou passes with no new warnings, and tsc is clean. New tests cover:
    • the first answer is silent, then an issue created by someone else and one updated by someone else are told, but not the user's own change, nor an older issue that only entered the list;
    • picking another saved search starts afresh, and drops the old search's news;
    • the search loses its own sort by: / order by: clause, and non-ASCII text survives the cut.
  • The request shapes were checked against a public YouTrack instance: the issue fields, savedQueries, and the 404 of a deleted saved search.
  • The card was rendered with sample data: five rows on screen, the rest scrolling, news on top.
  • Checked against a live self-hosted YouTrack: the saved search list, the card, scrolling, and your own change not notifying
  • Checked against a live self-hosted YouTrack: an issue created and one updated by someone else each notify once

Screenshot

image image

@AlbertMcAvoy
AlbertMcAvoy force-pushed the feature/youtrack-integration branch 3 times, most recently from 8b12feb to 4cd016d Compare October 7, 2026 15:33
@AlbertMcAvoy
AlbertMcAvoy force-pushed the feature/youtrack-integration branch 3 times, most recently from 7f66fa3 to 05d6a23 Compare October 16, 2026 07:19
@AlbertMcAvoy
AlbertMcAvoy force-pushed the feature/youtrack-integration branch from 05d6a23 to a8a0711 Compare October 20, 2026 07:18
mcg and others added 6 commits October 27, 2026 09:07
…card

The GitLab pill (Louis-CFM#831) shows GitHub's card: your merge requests and their
CI, the reviews asked of you, the default branch's CI, a year of activity.
This adds what happens on GitLab while you're elsewhere.

- The news, every minute: a new to-do (review requested, assigned,
  mentioned, a pipeline failing on your MR…), your MRs approved or merged,
  someone else commenting on or updating an MR you're involved in, and
  every pipeline you started finishing, in the projects of your week.
  Everything new in a minute is one notification, which opens its own
  card with an orange Mochi; its Details unfold what happened (the
  comment, the commits, who approved, what started a pipeline, how long
  it took, which jobs failed).
- An Inbox row under the card's three: the pending to-dos, and the last
  ten pieces of news, kept through a restart (news-gitlab.json, next to
  the log), each unfolding like the notification's.
- Settings → Integrations → GitLab → Projects → Choose…: the user's
  projects by group; ticked ones narrow the news, the merge requests and
  the default-branch CI to them. None ticked follows every project.
- One poller for the pill: the news every minute, the pulse inside it
  every five minutes (or after a minute when a list is opened, or at once
  for other followed projects). Every GitLab request goes through a
  client that never follows a redirect, so the token stays on the
  instance, and the instance URL no longer reaches the island.
- The forge card takes an optional fourth row (ForgeCardOptions.extra)
  and its detail; the overview grows to 180 px while it is shown.
- reqwest also trusts the system's certificate store: a self-hosted
  GitLab often sits behind a company CA.
- Every string in the twelve languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A self-hosted YouTrack, its URL and a permanent token in the Credential
Manager, and a saved search picked in the settings from the user's list.
Every minute the search's latest issues are read: one created or updated
by someone else since the last poll is news, and a minute's news is one
notification, opening the same card as GitLab's with a pink Mochi.

The pill lists five issues and scrolls through the rest; the overview
grows to 210 px for it. Its last ten pieces of news stay listed, through a
restart too, like GitLab's (news-youtrack.json, tied to the instance
and the search). Read-only. GitLab's news card, Mochi's colour on
it and the news bookkeeping are shared with YouTrack now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a poll has news, one more request reads YouTrack's activity stream
over the followed search since the last poll, and each piece of news
carries what someone else changed on its issue: a field's old and new
value ("State: In Progress → Fixed"), a comment's first words, the title
or description edited, an attachment, a link. Nothing more is asked when
nothing changed, and the news still goes out if that request fails.

It unfolds the way GitLab's does: the notification's Details, and a
click on a piece of news in the pill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spent time, an estimation and other duration fields come through the
activity stream as a number of minutes, and showed as bare integers. The
field's type is now asked for (`period`), falling back on the usual names
where an instance doesn't give it, and such values read "1h 30m". Hours,
not days: how long a day is is the instance's admin setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Everything YouTrack shows goes through the translation tables, in the
ten languages: the card, its count and tooltips, the settings field and
the saved-search picker, the errors, and the news the poller writes
(created, updated, and what changed: comments, title, description,
attachments, links, a field emptied).

Durations read like GitLab's now, "1 h 30 min" rather than "1h 30m",
so that both translate the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every string in every language: the YouTrack strings get German and
Turkish, informal like the rest of the app in them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlbertMcAvoy
AlbertMcAvoy force-pushed the feature/youtrack-integration branch from a8a0711 to 72418fe Compare October 27, 2026 08:34

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant