[Bug][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
backend/plugins/tempo/tasks/worklog_convertor.go から始めて、worklog のドメイン ID をどのように構築しているかを調べ、それを TempoWorklog の主キーおよび issue で説明されている他の接続スコープの ID と比較してください。2 つの接続から同一の worklog ID が来るケースを網羅するユニットテストを追加してください。各接続で個別の issue_worklogs 行が生成され、テストが成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Search before asking
- I had searched in the issues and found no similar issues.
What happened
The Tempo convert_worklogs subtask (backend/plugins/tempo/tasks/worklog_convertor.go) builds the issue_worklogs id from the Tempo worklog id alone:
domainWorklogId := fmt.Sprintf("tempo:TempoWorklog:%d", tempoWorklog.TempoWorklogId)
The tool layer keys worklogs by (connection_id, tempo_worklog_id) (models.TempoWorklog), and the other ids of the same row (jira:JiraIssue:<conn>:<id>, jira:JiraAccount:<conn>:<id>) carry the connection id. Domain ids that didgen generates for other plugins carry it too. The worklog id doesn't.
So when two Tempo connections have a worklog with the same tempoWorklogId (two connections to the same Tempo instance, or two instances whose worklog ids overlap), both convert to the same issue_worklogs primary key. The connection converted last overwrites the other connection's row (its issue_id, author_id and _raw_data_params), so one of the two worklogs disappears from the domain layer.
Example: connection 1 and connection 2 both have worklog 12345. After converting connection 1 and then connection 2, issue_worklogs has one row, tempo:TempoWorklog:12345, which points to jira:JiraIssue:2:.... Connection 1's worklog is gone. Re-running connection 1 brings it back and drops connection 2's.
What do you expect to happen
Each connection's worklog gets its own domain row: tempo:TempoWorklog:<connectionId>:<tempoWorklogId>, the id didgen would generate from the TempoWorklog primary key.
How to reproduce
- Create two Tempo connections (ids 1 and 2) that both return a worklog with the same
tempoWorklogId. - Collect, extract and convert worklogs for a team scope of each connection.
SELECT id, issue_id, _raw_data_params FROM issue_worklogs WHERE id LIKE 'tempo:%'shows one row for that worklog instead of two.
Anything else
Proposed fix (I have a PR ready): add the connection id to the domain worklog id and add a unit test. No migration is needed: the converter is a full-sync DataConverter, so its first batch deletes the scope's old rows (same _raw_data_table / _raw_data_params) before it saves the rows with the new ids.
Version
main
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要言語
- Go
- スター
- 3.2k
- フォーク
- 832
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 78
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/devlake のほかの issue
-
[Bug][Testmo] Runs, milestones and automation runs: only the first 100 are collected対応中かも @ShivamSharma43 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)対応中かも @VictorColomb が 4 日前に担当しました。 オープンtype/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/devlake#9283 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
メンテナーはふだん 2 日以内に返信
-
type/bug
難易度 4/5 3〜5日 初心者へのやさしさ 51/100
メンテナーはふだん 2 日以内に返信
-
[Bug][JIRA Service API TOKEN] Jira API Gateway: saved service-account token truncated by varchar(255), causing Base64 errors and HTTP 500対応中かも @RyoKusnadi が今日担当しました。 オープンtype/bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
apache/devlake#9328 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
stacklok/toolhive-catalog#1890 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
integrations/terraform-provider-github#3719 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Wayfinder sample agents don't reach the Data Plane on the quickstart pack対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンType/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
thunder-id/thunderid#6402 ·
メンテナーはふだん 1 日以内に返信
-
GoStratumEngineオープンaddition
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
awesome-selfhosted/awesome-selfhosted-data#3290 ·
メンテナーはふだん 1 日以内に返信
-
log4j2.xml from orchestration.extraConfiguration is rendered twice, and the install fails when orchestration.log4j2 is also set対応中かも @irisfield が今日担当しました。 オープンplatform/local
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
camunda/camunda-platform-helm#7854 ·
メンテナーはふだん 1 日以内に返信