From 666c2b23b123b3a4662c90fdf515d8a95cfaea2d Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Wed, 31 Jul 2024 00:23:19 +0000 Subject: [PATCH 01/18] [skip ci] Updated translations via Crowdin --- options/locale/locale_fr-FR.ini | 5 +++++ options/locale/locale_pt-PT.ini | 1 + 2 files changed, 6 insertions(+) diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index d17db1fcb4..52273ac3ac 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -1764,6 +1764,7 @@ compare.compare_head=comparer pulls.desc=Active les demandes d’ajouts et l’évaluation du code. pulls.new=Nouvelle demande d'ajout pulls.new.blocked_user=Impossible de créer une demande d’ajout car vous êtes bloqué par le propriétaire du dépôt. +pulls.new.must_collaborator=Vous devez être un collaborateur pour créer une demande d’ajout. pulls.edit.already_changed=Impossible d’enregistrer la demande d’ajout. Il semble que le contenu ait été modifié par un autre utilisateur. Veuillez rafraîchir la page et réessayer afin d’éviter d’écraser leurs modifications. pulls.view=Voir la demande d'ajout pulls.compare_changes=Nouvelle demande d’ajout @@ -2981,6 +2982,10 @@ emails.not_updated=Impossible de mettre à jour l’adresse courriel demandée : emails.duplicate_active=Cette adresse courriel est déjà active pour un autre utilisateur. emails.change_email_header=Mettre à jour les propriétés du courriel emails.change_email_text=Êtes-vous sûr de vouloir mettre à jour cette adresse courriel ? +emails.delete=Supprimer l’e-mail +emails.delete_desc=Êtes-vous sûr de vouloir supprimer cette adresse e-mail ? +emails.deletion_success=L’adresse e-mail a été supprimée. +emails.delete_primary_email_error=Vous ne pouvez pas supprimer l’e-mail principal. orgs.org_manage_panel=Gestion des organisations orgs.name=Nom diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 550fbcdaf8..7572906fa9 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -1764,6 +1764,7 @@ compare.compare_head=comparar pulls.desc=Habilitar pedidos de integração e revisão de código. pulls.new=Novo pedido de integração pulls.new.blocked_user=Não pode criar o pedido de integração porque foi bloqueado/a pelo/a proprietário/a do repositório. +pulls.new.must_collaborator=Tem de ser um/a colaborador/a para criar um pedido de integração. pulls.edit.already_changed=Não foi possível guardar as modificações do pedido de integração. O conteúdo parece ter sido modificado por outro utilizador, entretanto. Refresque a página e tente editar de novo para evitar sobrepor as modificações dele. pulls.view=Ver pedido de integração pulls.compare_changes=Novo pedido de integração From 9ac57c957f9dc88b1394008d6efb79f29a4c3396 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 31 Jul 2024 11:03:30 +0800 Subject: [PATCH 02/18] Improve names of cron jobs for Actions (#31736) Before: image After: image --- options/locale/locale_en-US.ini | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ca7b42fa0a..e488c50edd 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2870,7 +2870,7 @@ dashboard.reinit_missing_repos = Reinitialize all missing Git repositories for w dashboard.sync_external_users = Synchronize external user data dashboard.cleanup_hook_task_table = Cleanup hook_task table dashboard.cleanup_packages = Cleanup expired packages -dashboard.cleanup_actions = Cleanup actions expired logs and artifacts +dashboard.cleanup_actions = Cleanup expired actions resources dashboard.server_uptime = Server Uptime dashboard.current_goroutine = Current Goroutines dashboard.current_memory_usage = Current Memory Usage @@ -2900,15 +2900,15 @@ dashboard.total_gc_time = Total GC Pause dashboard.total_gc_pause = Total GC Pause dashboard.last_gc_pause = Last GC Pause dashboard.gc_times = GC Times -dashboard.delete_old_actions = Delete all old actions from database -dashboard.delete_old_actions.started = Delete all old actions from database started. +dashboard.delete_old_actions = Delete all old activities from database +dashboard.delete_old_actions.started = Delete all old activities from database started. dashboard.update_checker = Update checker dashboard.delete_old_system_notices = Delete all old system notices from database dashboard.gc_lfs = Garbage collect LFS meta objects -dashboard.stop_zombie_tasks = Stop zombie tasks -dashboard.stop_endless_tasks = Stop endless tasks -dashboard.cancel_abandoned_jobs = Cancel abandoned jobs -dashboard.start_schedule_tasks = Start schedule tasks +dashboard.stop_zombie_tasks = Stop actions zombie tasks +dashboard.stop_endless_tasks = Stop actions endless tasks +dashboard.cancel_abandoned_jobs = Cancel actions abandoned jobs +dashboard.start_schedule_tasks = Start actions schedule tasks dashboard.sync_branch.started = Branches Sync started dashboard.sync_tag.started = Tags Sync started dashboard.rebuild_issue_indexer = Rebuild issue indexer From 09b56fc0690317891829906d45c1d645794c63d5 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 31 Jul 2024 18:29:48 +0800 Subject: [PATCH 03/18] Distinguish LFS object errors to ignore missing objects during migration (#31702) Fix #31137. Replace #31623 #31697. When migrating LFS objects, if there's any object that failed (like some objects are losted, which is not really critical), Gitea will stop migrating LFS immediately but treat the migration as successful. This PR checks the error according to the [LFS api doc](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses). > LFS object error codes should match HTTP status codes where possible: > > - 404 - The object does not exist on the server. > - 409 - The specified hash algorithm disagrees with the server's acceptable options. > - 410 - The object was removed by the owner. > - 422 - Validation error. If the error is `404`, it's safe to ignore it and continue migration. Otherwise, stop the migration and mark it as failed to ensure data integrity of LFS objects. And maybe we should also ignore others errors (maybe `410`? I'm not sure what's the difference between "does not exist" and "removed by the owner".), we can add it later when some users report that they have failed to migrate LFS because of an error which should be ignored. --- modules/lfs/http_client.go | 7 +++---- modules/lfs/shared.go | 37 ++++++++++++++++++++++++++++++++++ modules/repository/repo.go | 5 +++++ services/repository/migrate.go | 1 + 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/modules/lfs/http_client.go b/modules/lfs/http_client.go index 7ee2449b0e..4859fe61e1 100644 --- a/modules/lfs/http_client.go +++ b/modules/lfs/http_client.go @@ -136,14 +136,13 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc for _, object := range result.Objects { if object.Error != nil { - objectError := errors.New(object.Error.Message) - log.Trace("Error on object %v: %v", object.Pointer, objectError) + log.Trace("Error on object %v: %v", object.Pointer, object.Error) if uc != nil { - if _, err := uc(object.Pointer, objectError); err != nil { + if _, err := uc(object.Pointer, object.Error); err != nil { return err } } else { - if err := dc(object.Pointer, nil, objectError); err != nil { + if err := dc(object.Pointer, nil, object.Error); err != nil { return err } } diff --git a/modules/lfs/shared.go b/modules/lfs/shared.go index 675d2328b7..a4326b57b2 100644 --- a/modules/lfs/shared.go +++ b/modules/lfs/shared.go @@ -4,7 +4,11 @@ package lfs import ( + "errors" + "fmt" "time" + + "code.gitea.io/gitea/modules/util" ) const ( @@ -64,6 +68,39 @@ type ObjectError struct { Message string `json:"message"` } +var ( + // See https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses + // LFS object error codes should match HTTP status codes where possible: + // 404 - The object does not exist on the server. + // 409 - The specified hash algorithm disagrees with the server's acceptable options. + // 410 - The object was removed by the owner. + // 422 - Validation error. + + ErrObjectNotExist = util.ErrNotExist // the object does not exist on the server + ErrObjectHashMismatch = errors.New("the specified hash algorithm disagrees with the server's acceptable options") + ErrObjectRemoved = errors.New("the object was removed by the owner") + ErrObjectValidation = errors.New("validation error") +) + +func (e *ObjectError) Error() string { + return fmt.Sprintf("[%d] %s", e.Code, e.Message) +} + +func (e *ObjectError) Unwrap() error { + switch e.Code { + case 404: + return ErrObjectNotExist + case 409: + return ErrObjectHashMismatch + case 410: + return ErrObjectRemoved + case 422: + return ErrObjectValidation + default: + return errors.New(e.Message) + } +} + // PointerBlob associates a Git blob with a Pointer. type PointerBlob struct { Hash string diff --git a/modules/repository/repo.go b/modules/repository/repo.go index cb926084ba..3d1899b2fe 100644 --- a/modules/repository/repo.go +++ b/modules/repository/repo.go @@ -5,6 +5,7 @@ package repository import ( "context" + "errors" "fmt" "io" "strings" @@ -181,6 +182,10 @@ func StoreMissingLfsObjectsInRepository(ctx context.Context, repo *repo_model.Re downloadObjects := func(pointers []lfs.Pointer) error { err := lfsClient.Download(ctx, pointers, func(p lfs.Pointer, content io.ReadCloser, objectError error) error { if objectError != nil { + if errors.Is(objectError, lfs.ErrObjectNotExist) { + log.Warn("Repo[%-v]: Ignore missing LFS object %-v: %v", repo, p, objectError) + return nil + } return objectError } diff --git a/services/repository/migrate.go b/services/repository/migrate.go index df5cc67ae1..2e901791b4 100644 --- a/services/repository/migrate.go +++ b/services/repository/migrate.go @@ -169,6 +169,7 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User, lfsClient := lfs.NewClient(endpoint, httpTransport) if err = repo_module.StoreMissingLfsObjectsInRepository(ctx, repo, gitRepo, lfsClient); err != nil { log.Error("Failed to store missing LFS objects for repository: %v", err) + return repo, fmt.Errorf("StoreMissingLfsObjectsInRepository: %w", err) } } } From 7674eafe317db80c86f85f4d3f2aa446021332f9 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Thu, 1 Aug 2024 00:31:07 +0000 Subject: [PATCH 04/18] [skip ci] Updated translations via Crowdin --- options/locale/locale_cs-CZ.ini | 7 ------- options/locale/locale_de-DE.ini | 7 ------- options/locale/locale_el-GR.ini | 7 ------- options/locale/locale_es-ES.ini | 7 ------- options/locale/locale_fa-IR.ini | 2 -- options/locale/locale_fr-FR.ini | 7 ------- options/locale/locale_it-IT.ini | 2 -- options/locale/locale_ja-JP.ini | 7 ------- options/locale/locale_lv-LV.ini | 7 ------- options/locale/locale_pl-PL.ini | 2 -- options/locale/locale_pt-BR.ini | 5 ----- options/locale/locale_pt-PT.ini | 8 +------- options/locale/locale_ru-RU.ini | 6 ------ options/locale/locale_si-LK.ini | 2 -- options/locale/locale_tr-TR.ini | 7 ------- options/locale/locale_uk-UA.ini | 2 -- options/locale/locale_zh-CN.ini | 7 ------- options/locale/locale_zh-TW.ini | 5 ----- 18 files changed, 1 insertion(+), 96 deletions(-) diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index 49c6fdc84d..a4cecc542c 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -2836,7 +2836,6 @@ dashboard.reinit_missing_repos=Znovu inicializovat všechny chybějící repozit dashboard.sync_external_users=Synchronizovat externí uživatelská data dashboard.cleanup_hook_task_table=Vyčistit tabulku hook_task dashboard.cleanup_packages=Vyčistit prošlé balíčky -dashboard.cleanup_actions=Vyčištění prošlých záznamů a artefaktů z akcí dashboard.server_uptime=Doba provozu serveru dashboard.current_goroutine=Aktuální Goroutines dashboard.current_memory_usage=Aktuální využití paměti @@ -2866,15 +2865,9 @@ dashboard.total_gc_time=Celková pauza GC dashboard.total_gc_pause=Celková pauza GC dashboard.last_gc_pause=Poslední pauza GC dashboard.gc_times=Časy GC -dashboard.delete_old_actions=Odstranit všechny staré akce z databáze -dashboard.delete_old_actions.started=Začalo odstraňování všech starých akcí z databáze. dashboard.update_checker=Kontrola aktualizací dashboard.delete_old_system_notices=Odstranit všechna stará systémová upozornění z databáze dashboard.gc_lfs=Úklid LFS meta objektů -dashboard.stop_zombie_tasks=Zastavit zombie úlohy -dashboard.stop_endless_tasks=Zastavit nekonečné úlohy -dashboard.cancel_abandoned_jobs=Zrušit opuštěné úlohy -dashboard.start_schedule_tasks=Spustit naplánované úlohy dashboard.sync_branch.started=Synchronizace větví byla spuštěna dashboard.sync_tag.started=Synchronizace značek spuštěna dashboard.rebuild_issue_indexer=Znovu sestavit index úkolů diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index d8bc62711b..79ddd47201 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -2814,7 +2814,6 @@ dashboard.reinit_missing_repos=Alle Git-Repositories neu einlesen, für die Eint dashboard.sync_external_users=Externe Benutzerdaten synchronisieren dashboard.cleanup_hook_task_table=Hook-Task-Tabelle bereinigen dashboard.cleanup_packages=Veraltete Pakete löschen -dashboard.cleanup_actions=Abgelaufene Logs und Artefakte von Actions bereinigen dashboard.server_uptime=Server-Uptime dashboard.current_goroutine=Aktuelle Goroutinen dashboard.current_memory_usage=Aktuelle Speichernutzung @@ -2844,15 +2843,9 @@ dashboard.total_gc_time=Gesamte GC-Pause dashboard.total_gc_pause=Gesamte GC-Pause dashboard.last_gc_pause=Letzte GC-Pause dashboard.gc_times=Anzahl GC -dashboard.delete_old_actions=Alle alten Aktionen aus der Datenbank löschen -dashboard.delete_old_actions.started=Löschen aller alten Aktionen in der Datenbank gestartet. dashboard.update_checker=Update-Checker dashboard.delete_old_system_notices=Alle alten Systemmeldungen aus der Datenbank löschen dashboard.gc_lfs=Garbage-Collection für LFS Meta-Objekte ausführen -dashboard.stop_zombie_tasks=Zombie-Aufgaben stoppen -dashboard.stop_endless_tasks=Endlose Aufgaben stoppen -dashboard.cancel_abandoned_jobs=Aufgegebene Jobs abbrechen -dashboard.start_schedule_tasks=Terminierte Aufgaben starten dashboard.sync_branch.started=Synchronisierung der Branches gestartet dashboard.sync_tag.started=Tag-Synchronisierung gestartet dashboard.rebuild_issue_indexer=Issue-Indexer neu bauen diff --git a/options/locale/locale_el-GR.ini b/options/locale/locale_el-GR.ini index 1c5c9227ce..79bdd66058 100644 --- a/options/locale/locale_el-GR.ini +++ b/options/locale/locale_el-GR.ini @@ -2704,7 +2704,6 @@ dashboard.reinit_missing_repos=Επανεκκινήστε όλα τα αποθε dashboard.sync_external_users=Συγχρονισμός δεδομένων εξωτερικών χρηστών dashboard.cleanup_hook_task_table=Εκκαθάριση πίνακα hook_task dashboard.cleanup_packages=Εκκαθάριση ληγμένων πακέτων -dashboard.cleanup_actions=Οι ενέργειες καθαρισμού καταγραφές και αντικείμενα dashboard.server_uptime=Διάρκεια Διακομιστή dashboard.current_goroutine=Τρέχουσες Goroutines dashboard.current_memory_usage=Τρέχουσα Χρήση Μνήμης @@ -2734,15 +2733,9 @@ dashboard.total_gc_time=Σύνολο Παύσης GC dashboard.total_gc_pause=Σύνολο Παύσης GC dashboard.last_gc_pause=Τελευταία Παύση GC dashboard.gc_times=Πλήθος GC -dashboard.delete_old_actions=Διαγραφή όλων των παλαιών ενεργειών από τη βάση δεδομένων -dashboard.delete_old_actions.started=Η διαγραφή όλων των παλιών ενεργειών από τη βάση δεδομένων ξεκίνησε. dashboard.update_checker=Ελεγκτής ενημερώσεων dashboard.delete_old_system_notices=Διαγραφή όλων των παλιών ειδοποιήσεων συστήματος από τη βάση δεδομένων dashboard.gc_lfs=Συλλογή απορριμάτων στα μετα-αντικείμενα LFS -dashboard.stop_zombie_tasks=Διακοπή εργασιών ζόμπι -dashboard.stop_endless_tasks=Διακοπή ατελείωτων εργασιών -dashboard.cancel_abandoned_jobs=Ακύρωση εγκαταλελειμμένων εργασιών -dashboard.start_schedule_tasks=Έναρξη προγραμματισμένων εργασιών dashboard.sync_branch.started=Ο Συγχρονισμός των Κλάδων ξεκίνησε dashboard.rebuild_issue_indexer=Αναδόμηση ευρετηρίου ζητημάτων diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index 18fd2c17f2..4b31116b3e 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -2689,7 +2689,6 @@ dashboard.reinit_missing_repos=Reiniciar todos los repositorios Git faltantes de dashboard.sync_external_users=Sincronizar datos de usuario externo dashboard.cleanup_hook_task_table=Limpiar tabla hook_task dashboard.cleanup_packages=Limpieza de paquetes caducados -dashboard.cleanup_actions=Acciones de limpieza expiradas de registros y artefactos dashboard.server_uptime=Tiempo de actividad del servidor dashboard.current_goroutine=Gorutinas actuales dashboard.current_memory_usage=Uso de memoria actual @@ -2719,15 +2718,9 @@ dashboard.total_gc_time=Pausa Total por GC dashboard.total_gc_pause=Pausa Total por GC dashboard.last_gc_pause=Última Pausa por GC dashboard.gc_times=Ejecuciones GC -dashboard.delete_old_actions=Eliminar todas las acciones antiguas de la base de datos -dashboard.delete_old_actions.started=Eliminar todas las acciones antiguas de la base de datos inicializada. dashboard.update_checker=Buscador de actualizaciones dashboard.delete_old_system_notices=Borrar todos los avisos antiguos del sistema de la base de datos dashboard.gc_lfs=Recoger basura meta-objetos LFS -dashboard.stop_zombie_tasks=Detener tareas zombie -dashboard.stop_endless_tasks=Detener tareas interminables -dashboard.cancel_abandoned_jobs=Cancelar trabajos abandonados -dashboard.start_schedule_tasks=Iniciar tareas programadas dashboard.sync_branch.started=Sincronización de ramas iniciada dashboard.rebuild_issue_indexer=Reconstruir indexador de incidencias diff --git a/options/locale/locale_fa-IR.ini b/options/locale/locale_fa-IR.ini index 9c35d99a8b..5b64b77ba6 100644 --- a/options/locale/locale_fa-IR.ini +++ b/options/locale/locale_fa-IR.ini @@ -2107,8 +2107,6 @@ dashboard.total_gc_time=کل زمان مکث GC dashboard.total_gc_pause=کل زمان مکث GC dashboard.last_gc_pause=واپسین مکث در GC dashboard.gc_times=زمان های GC -dashboard.delete_old_actions=تمام اقدامات قدیمی را از پایگاه داده حذف کنید -dashboard.delete_old_actions.started=حذف تمام اقدامات قدیمی از پایگاه داده شروع شده است. users.user_manage_panel=مدیریت حساب کاربری users.new_account=ایجاد حساب کاربری diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index 52273ac3ac..2125552c26 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -2869,7 +2869,6 @@ dashboard.reinit_missing_repos=Réinitialiser tous les dépôts Git manquants po dashboard.sync_external_users=Synchroniser les données de l’utilisateur externe dashboard.cleanup_hook_task_table=Nettoyer la table hook_task dashboard.cleanup_packages=Nettoyer des paquets expirés -dashboard.cleanup_actions=Nettoyer les journaux et les artefacts des actions obsolètes dashboard.server_uptime=Uptime du serveur dashboard.current_goroutine=Goroutines actuelles dashboard.current_memory_usage=Utilisation Mémoire actuelle @@ -2899,15 +2898,9 @@ dashboard.total_gc_time=Pause GC dashboard.total_gc_pause=Pause GC dashboard.last_gc_pause=Dernière Pause GC dashboard.gc_times=Nombres de GC -dashboard.delete_old_actions=Supprimer toutes les anciennes actions de la base de données -dashboard.delete_old_actions.started=Suppression de toutes les anciennes actions de la base de données démarrée. dashboard.update_checker=Vérificateur de mise à jour dashboard.delete_old_system_notices=Supprimer toutes les anciennes observations de la base de données dashboard.gc_lfs=Épousseter les métaobjets LFS -dashboard.stop_zombie_tasks=Arrêter les tâches zombies -dashboard.stop_endless_tasks=Arrêter les tâches sans fin -dashboard.cancel_abandoned_jobs=Annuler les jobs abandonnés -dashboard.start_schedule_tasks=Démarrer les tâches planifiées dashboard.sync_branch.started=Début de la synchronisation des branches dashboard.sync_tag.started=Synchronisation des étiquettes dashboard.rebuild_issue_indexer=Reconstruire l’indexeur des tickets diff --git a/options/locale/locale_it-IT.ini b/options/locale/locale_it-IT.ini index d9acd9f44a..45998bb805 100644 --- a/options/locale/locale_it-IT.ini +++ b/options/locale/locale_it-IT.ini @@ -2277,8 +2277,6 @@ dashboard.total_gc_time=Pausa Totale della GC dashboard.total_gc_pause=Pausa Totale della GC dashboard.last_gc_pause=Ultima pausa della GC dashboard.gc_times=Esecuzioni GC -dashboard.delete_old_actions=Elimina tutte le vecchie azioni dal database -dashboard.delete_old_actions.started=Elimina tutte le vecchie azioni dal database iniziate. dashboard.update_checker=Controllore dell'aggiornamento dashboard.delete_old_system_notices=Elimina tutte le vecchie notifiche di sistema dal database diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index 7d552ad84c..e4348d3024 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -2868,7 +2868,6 @@ dashboard.reinit_missing_repos=レコードが存在するが見当たらない dashboard.sync_external_users=外部ユーザーデータの同期 dashboard.cleanup_hook_task_table=hook_taskテーブルのクリーンアップ dashboard.cleanup_packages=期限切れパッケージのクリーンアップ -dashboard.cleanup_actions=Actionsの期限切れのログとアーティファクトのクリーンアップ dashboard.server_uptime=サーバーの稼働時間 dashboard.current_goroutine=現在のGoroutine数 dashboard.current_memory_usage=現在のメモリ使用量 @@ -2898,15 +2897,9 @@ dashboard.total_gc_time=GC停止時間の合計 dashboard.total_gc_pause=GC停止時間の合計 dashboard.last_gc_pause=前回のGC停止時間 dashboard.gc_times=GC実行回数 -dashboard.delete_old_actions=データベースから古い操作履歴をすべて削除 -dashboard.delete_old_actions.started=データベースからの古い操作履歴の削除を開始しました。 dashboard.update_checker=更新チェック dashboard.delete_old_system_notices=データベースから古いシステム通知をすべて削除 dashboard.gc_lfs=LFSメタオブジェクトのガベージコレクション -dashboard.stop_zombie_tasks=ゾンビタスクを停止 -dashboard.stop_endless_tasks=終わらないタスクを停止 -dashboard.cancel_abandoned_jobs=放置されたままのジョブをキャンセル -dashboard.start_schedule_tasks=スケジュールタスクを開始 dashboard.sync_branch.started=ブランチの同期を開始しました dashboard.sync_tag.started=タグの同期を開始しました dashboard.rebuild_issue_indexer=イシューインデクサーの再構築 diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini index a862835ba8..035b0008e3 100644 --- a/options/locale/locale_lv-LV.ini +++ b/options/locale/locale_lv-LV.ini @@ -2711,7 +2711,6 @@ dashboard.reinit_missing_repos=Atkārtoti inicializēt visus pazaudētos Git rep dashboard.sync_external_users=Sinhronizēt ārējo lietotāju datus dashboard.cleanup_hook_task_table=Iztīrīt tīmekļa āķu vēsturi dashboard.cleanup_packages=Notīrīt novecojušās pakotnes -dashboard.cleanup_actions=Notīrīt darbību izbeigušos žurnālus un artefaktus dashboard.server_uptime=Servera darbības laiks dashboard.current_goroutine=Izmantotās Gorutīnas dashboard.current_memory_usage=Pašreiz izmantotā atmiņa @@ -2741,15 +2740,9 @@ dashboard.total_gc_time=Kopējais GC izpildes laiks dashboard.total_gc_pause=Kopējais GC izpildes laiks dashboard.last_gc_pause=Pedējās GC izpildes laiks dashboard.gc_times=GC reizes -dashboard.delete_old_actions=Dzēst visas darbības no datu bāzes -dashboard.delete_old_actions.started=Uzsākta visu novecojušo darbību dzēšana no datu bāzes. dashboard.update_checker=Atjauninājumu pārbaudītājs dashboard.delete_old_system_notices=Dzēst vecos sistēmas paziņojumus no datubāzes dashboard.gc_lfs=Veikt atkritumu uzkopšanas darbus LFS meta objektiem -dashboard.stop_zombie_tasks=Apturēt zombija uzdevumus -dashboard.stop_endless_tasks=Apturēt nepārtrauktus uzdevumus -dashboard.cancel_abandoned_jobs=Atcelt pamestus darbus -dashboard.start_schedule_tasks=Sākt plānotos uzdevumus dashboard.sync_branch.started=Sākta atzaru sinhronizācija dashboard.rebuild_issue_indexer=Pārbūvēt problēmu indeksu diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini index e6bd9ecf2a..699ee641d4 100644 --- a/options/locale/locale_pl-PL.ini +++ b/options/locale/locale_pl-PL.ini @@ -2053,8 +2053,6 @@ dashboard.total_gc_time=Sumaryczny czas wstrzymania przez GC dashboard.total_gc_pause=Sumaryczny czas wstrzymania przez GC dashboard.last_gc_pause=Ostatnie wstrzymanie przez GC dashboard.gc_times=Ilość wywołań GC -dashboard.delete_old_actions=Usuń wszystkie stare akcje z bazy danych -dashboard.delete_old_actions.started=Usuwanie wszystkich starych akcji z bazy danych rozpoczęte. users.user_manage_panel=Zarządzanie kontami użytkowników users.new_account=Nowy użytkownik diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini index a1b0849870..10f8f4c2b1 100644 --- a/options/locale/locale_pt-BR.ini +++ b/options/locale/locale_pt-BR.ini @@ -2691,14 +2691,9 @@ dashboard.total_gc_time=Pausa total do GC dashboard.total_gc_pause=Pausa total do GC dashboard.last_gc_pause=Última pausa do GC dashboard.gc_times=Nº de execuções do GC -dashboard.delete_old_actions=Excluir todas as ações antigas do banco de dados -dashboard.delete_old_actions.started=A exclusão de todas as ações antigas do banco de dados foi iniciada. dashboard.update_checker=Verificador de atualização dashboard.delete_old_system_notices=Excluir todos os avisos de sistema antigos do banco de dados dashboard.gc_lfs=Coletar lixos dos meta-objetos LFS -dashboard.stop_zombie_tasks=Parar tarefas zumbi -dashboard.stop_endless_tasks=Parar tarefas infinitas -dashboard.cancel_abandoned_jobs=Cancelar trabalhos abandonados users.user_manage_panel=Gerenciamento de conta de usuário users.new_account=Criar conta de usuário diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 7572906fa9..098b07cd79 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -2869,7 +2869,6 @@ dashboard.reinit_missing_repos=Reinicializar todos os repositórios Git em falta dashboard.sync_external_users=Sincronizar dados externos do utilizador dashboard.cleanup_hook_task_table=Limpar tabela hook_task dashboard.cleanup_packages=Limpar pacotes expirados -dashboard.cleanup_actions=Limpar registos e artefactos expirados das operações dashboard.server_uptime=Tempo em funcionamento contínuo do servidor dashboard.current_goroutine=Goroutines em execução dashboard.current_memory_usage=Utilização de memória corrente @@ -2899,15 +2898,9 @@ dashboard.total_gc_time=Pausa total da recolha de lixo dashboard.total_gc_pause=Pausa total da recolha de lixo dashboard.last_gc_pause=Última pausa da recolha de lixo dashboard.gc_times=N.º de recolhas de lixo -dashboard.delete_old_actions=Eliminar todas as operações antigas da base de dados -dashboard.delete_old_actions.started=Foi iniciado o processo de eliminação de todas as operações antigas da base de dados. dashboard.update_checker=Verificador de novas versões dashboard.delete_old_system_notices=Eliminar todas as notificações do sistema antigas da base de dados dashboard.gc_lfs=Recolher lixo dos meta-elementos LFS -dashboard.stop_zombie_tasks=Parar tarefas zombies -dashboard.stop_endless_tasks=Parar tarefas intermináveis -dashboard.cancel_abandoned_jobs=Cancelar trabalhos abandonados -dashboard.start_schedule_tasks=Iniciar tarefas de agendamento dashboard.sync_branch.started=Sincronização de ramos iniciada dashboard.sync_tag.started=Sincronização de etiquetas iniciada dashboard.rebuild_issue_indexer=Reconstruir indexador de questões @@ -3704,6 +3697,7 @@ variables.update.failed=Falha ao editar a variável. variables.update.success=A variável foi editada. [projects] +deleted.display_name=Planeamento eliminado type-1.display_name=Planeamento individual type-2.display_name=Planeamento do repositório type-3.display_name=Planeamento da organização diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index 9c443f7d77..b9c35331d0 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -2679,15 +2679,9 @@ dashboard.total_gc_time=Итоговая задержка GC dashboard.total_gc_pause=Итоговая задержка GC dashboard.last_gc_pause=Последняя пауза сборщика мусора dashboard.gc_times=Количество сборок мусора -dashboard.delete_old_actions=Удалите все старые действия из базы данных -dashboard.delete_old_actions.started=Удалите все старые действия из запущенной базы данных. dashboard.update_checker=Проверка обновлений dashboard.delete_old_system_notices=Удалить все старые системные уведомления из базы данных dashboard.gc_lfs=Выполнить сборку мусора метаобъектов LFS -dashboard.stop_zombie_tasks=Остановить задания-зомби -dashboard.stop_endless_tasks=Остановить бесконечные задания -dashboard.cancel_abandoned_jobs=Отменить брошенные задания -dashboard.start_schedule_tasks=Запустить запланированные задания users.user_manage_panel=Панель управления пользователями users.new_account=Создать новый аккаунт diff --git a/options/locale/locale_si-LK.ini b/options/locale/locale_si-LK.ini index 8d664be3e0..a6e1ae20cc 100644 --- a/options/locale/locale_si-LK.ini +++ b/options/locale/locale_si-LK.ini @@ -2067,8 +2067,6 @@ dashboard.total_gc_time=මුළු GC විරාමය dashboard.total_gc_pause=මුළු GC විරාමය dashboard.last_gc_pause=අවසන් GC විරාමය dashboard.gc_times=GC ටයිම්ස් -dashboard.delete_old_actions=සියලු පැරණි ක්රියා දත්ත සමුදායෙන් මකන්න -dashboard.delete_old_actions.started=දත්ත සමුදාය ආරම්භ සිට සියලු පැරණි ක්රියා මකන්න. users.user_manage_panel=පරිශීලක ගිණුම් කළමනාකරණය users.new_account=පරිශීලක ගිණුමක් සාදන්න diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini index f30b49683a..6642b5663a 100644 --- a/options/locale/locale_tr-TR.ini +++ b/options/locale/locale_tr-TR.ini @@ -2830,7 +2830,6 @@ dashboard.reinit_missing_repos=Kayıtları bulunanlar için tüm eksik Git depol dashboard.sync_external_users=Harici kullanıcı verisini senkronize et dashboard.cleanup_hook_task_table=Hook_task tablosunu temizleme dashboard.cleanup_packages=Süresi dolmuş paketleri temizleme -dashboard.cleanup_actions=Eylemlerin süresi geçmiş günlük ve yapılarını temizle dashboard.server_uptime=Sunucunun Ayakta Kalma Süresi dashboard.current_goroutine=Güncel Goroutine'ler dashboard.current_memory_usage=Güncel Bellek Kullanımı @@ -2860,15 +2859,9 @@ dashboard.total_gc_time=Toplam GC Durması dashboard.total_gc_pause=Toplam GC Durması dashboard.last_gc_pause=Son GC Durması dashboard.gc_times=GC Zamanları -dashboard.delete_old_actions=Veritabanından tüm eski eylemleri sil -dashboard.delete_old_actions.started=Veritabanından başlatılan tüm eski eylemleri silin. dashboard.update_checker=Denetleyiciyi güncelle dashboard.delete_old_system_notices=Veritabanından tüm eski sistem bildirimlerini sil dashboard.gc_lfs=LFS üst nesnelerin atıklarını temizle -dashboard.stop_zombie_tasks=Zombi görevleri durdur -dashboard.stop_endless_tasks=Daimi görevleri durdur -dashboard.cancel_abandoned_jobs=Terkedilmiş görevleri iptal et -dashboard.start_schedule_tasks=Zamanlanmış görevleri başlat dashboard.sync_branch.started=Dal Eşzamanlaması başladı dashboard.sync_tag.started=Etiket eşitlemesi başladı dashboard.rebuild_issue_indexer=Konu indeksini yeniden oluştur diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index 00a1fd552e..cb3c140c5c 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -2117,8 +2117,6 @@ dashboard.total_gc_time=Загальна пауза збирача сміття dashboard.total_gc_pause=Загальна пауза збирача сміття (GC) dashboard.last_gc_pause=Остання пауза збирача сміття (GC) dashboard.gc_times=Кількість запусків збирача сміття (GC) -dashboard.delete_old_actions=Видалити всі старі дії з бази даних -dashboard.delete_old_actions.started=Видалення всіх старі дії з бази даних розпочато. users.user_manage_panel=Керування обліковими записами користувачів users.new_account=Створити обліковий запис diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 0e8c6677e6..6b3056951a 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -2833,7 +2833,6 @@ dashboard.reinit_missing_repos=重新初始化所有丢失的 Git 仓库存在 dashboard.sync_external_users=同步外部用户数据 dashboard.cleanup_hook_task_table=清理 hook_task 表 dashboard.cleanup_packages=清理过期的软件包 -dashboard.cleanup_actions=清理过期的Actions日志和制品 dashboard.server_uptime=服务运行时间 dashboard.current_goroutine=当前 Goroutines 数量 dashboard.current_memory_usage=当前内存使用量 @@ -2863,15 +2862,9 @@ dashboard.total_gc_time=GC 暂停时间总量 dashboard.total_gc_pause=GC 暂停时间总量 dashboard.last_gc_pause=上次 GC 暂停时间 dashboard.gc_times=GC 执行次数 -dashboard.delete_old_actions=从数据库中删除所有旧操作记录 -dashboard.delete_old_actions.started=已开始从数据库中删除所有旧操作记录。 dashboard.update_checker=更新检查器 dashboard.delete_old_system_notices=从数据库中删除所有旧系统通知 dashboard.gc_lfs=垃圾回收 LFS 元数据 -dashboard.stop_zombie_tasks=停止僵尸任务 -dashboard.stop_endless_tasks=停止永不停止的任务 -dashboard.cancel_abandoned_jobs=取消丢弃的任务 -dashboard.start_schedule_tasks=开始调度任务 dashboard.sync_branch.started=分支同步已开始 dashboard.sync_tag.started=标签同步已开始 dashboard.rebuild_issue_indexer=重建工单索引 diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index 071cc76f68..a2e0d9298b 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -2483,14 +2483,9 @@ dashboard.total_gc_time=總 GC 暫停時間 dashboard.total_gc_pause=總 GC 暫停時間 dashboard.last_gc_pause=上次 GC 暫停時間 dashboard.gc_times=GC 執行次數 -dashboard.delete_old_actions=從資料庫刪除所有舊行為 -dashboard.delete_old_actions.started=從資料庫刪除所有舊行為的任務已啟動。 dashboard.update_checker=更新檢查器 dashboard.delete_old_system_notices=從資料庫刪除所有舊系統提示 dashboard.gc_lfs=對 LFS meta objects 進行垃圾回收 -dashboard.stop_zombie_tasks=停止殭屍任務 -dashboard.stop_endless_tasks=停止永不停止的任務 -dashboard.cancel_abandoned_jobs=取消已放棄的工作 users.user_manage_panel=使用者帳戶管理 users.new_account=建立使用者帳戶 From 9e31b229bd9976874e84060db3479d15c1d4d387 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 1 Aug 2024 15:21:28 +0800 Subject: [PATCH 05/18] Exclude protected branches from recently pushed (#31748) Resolve #31566. Updates to protected branches often come from PR merges, and they are unlikely to be used to create new PRs. image image image --- models/git/branch.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/models/git/branch.go b/models/git/branch.go index c315d921ff..dd7e32dd03 100644 --- a/models/git/branch.go +++ b/models/git/branch.go @@ -427,7 +427,8 @@ type RecentlyPushedNewBranch struct { // FindRecentlyPushedNewBranches return at most 2 new branches pushed by the user in 2 hours which has no opened PRs created // if opts.CommitAfterUnix is 0, we will find the branches that were committed to in the last 2 hours -// if opts.ListOptions is not set, we will only display top 2 latest branch +// if opts.ListOptions is not set, we will only display top 2 latest branches. +// Protected branches will be skipped since they are unlikely to be used to create new PRs. func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, opts *FindRecentlyPushedNewBranchesOptions) ([]*RecentlyPushedNewBranch, error) { if doer == nil { return []*RecentlyPushedNewBranch{}, nil @@ -486,6 +487,18 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o opts.MaxCount = 2 } for _, branch := range branches { + // whether the branch is protected + protected, err := IsBranchProtected(ctx, branch.RepoID, branch.Name) + if err != nil { + return nil, fmt.Errorf("IsBranchProtected: %v", err) + } + if protected { + // Skip protected branches, + // since updates to protected branches often come from PR merges, + // and they are unlikely to be used to create new PRs. + continue + } + // whether branch have already created PR count, err := db.GetEngine(ctx).Table("pull_request"). // we should not only use branch name here, because if there are branches with same name in other repos, From a33e74d40d356e8f628ac06a131cb203a3609dec Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 1 Aug 2024 17:04:04 +0800 Subject: [PATCH 06/18] Clarify Actions resources ownership (#31724) Fix #31707. Also related to #31715. Some Actions resources could has different types of ownership. It could be: - global: all repos and orgs/users can use it. - org/user level: only the org/user can use it. - repo level: only the repo can use it. There are two ways to distinguish org/user level from repo level: 1. `{owner_id: 1, repo_id: 2}` for repo level, and `{owner_id: 1, repo_id: 0}` for org level. 2. `{owner_id: 0, repo_id: 2}` for repo level, and `{owner_id: 1, repo_id: 0}` for org level. The first way seems more reasonable, but it may not be true. The point is that although a resource, like a runner, belongs to a repo (it can be used by the repo), the runner doesn't belong to the repo's org (other repos in the same org cannot use the runner). So, the second method makes more sense. And the first way is not user-friendly to query, we must set the repo id to zero to avoid wrong results. So, #31715 should be right. And the most simple way to fix #31707 is just: ```diff - shared.GetRegistrationToken(ctx, ctx.Repo.Repository.OwnerID, ctx.Repo.Repository.ID) + shared.GetRegistrationToken(ctx, 0, ctx.Repo.Repository.ID) ``` However, it is quite intuitive to set both owner id and repo id since the repo belongs to the owner. So I prefer to be compatible with it. If we get both owner id and repo id not zero when creating or finding, it's very clear that the caller want one with repo level, but set owner id accidentally. So it's OK to accept it but fix the owner id to zero. --- models/actions/runner.go | 25 ++++++++--- models/actions/runner_token.go | 28 +++++++++++- models/actions/variable.go | 38 ++++++++++------ models/secret/secret.go | 46 +++++++++++++------- tests/integration/api_user_variables_test.go | 4 +- 5 files changed, 103 insertions(+), 38 deletions(-) diff --git a/models/actions/runner.go b/models/actions/runner.go index 9192925d5a..2023ba4f99 100644 --- a/models/actions/runner.go +++ b/models/actions/runner.go @@ -23,14 +23,25 @@ import ( ) // ActionRunner represents runner machines +// +// It can be: +// 1. global runner, OwnerID is 0 and RepoID is 0 +// 2. org/user level runner, OwnerID is org/user ID and RepoID is 0 +// 3. repo level runner, OwnerID is 0 and RepoID is repo ID +// +// Please note that it's not acceptable to have both OwnerID and RepoID to be non-zero, +// or it will be complicated to find runners belonging to a specific owner. +// For example, conditions like `OwnerID = 1` will also return runner {OwnerID: 1, RepoID: 1}, +// but it's a repo level runner, not an org/user level runner. +// To avoid this, make it clear with {OwnerID: 0, RepoID: 1} for repo level runners. type ActionRunner struct { ID int64 UUID string `xorm:"CHAR(36) UNIQUE"` Name string `xorm:"VARCHAR(255)"` Version string `xorm:"VARCHAR(64)"` - OwnerID int64 `xorm:"index"` // org level runner, 0 means system + OwnerID int64 `xorm:"index"` Owner *user_model.User `xorm:"-"` - RepoID int64 `xorm:"index"` // repo level runner, if OwnerID also is zero, then it's a global + RepoID int64 `xorm:"index"` Repo *repo_model.Repository `xorm:"-"` Description string `xorm:"TEXT"` Base int // 0 native 1 docker 2 virtual machine @@ -157,7 +168,7 @@ func init() { type FindRunnerOptions struct { db.ListOptions RepoID int64 - OwnerID int64 + OwnerID int64 // it will be ignored if RepoID is set Sort string Filter string IsOnline optional.Option[bool] @@ -174,8 +185,7 @@ func (opts FindRunnerOptions) ToConds() builder.Cond { c = c.Or(builder.Eq{"repo_id": 0, "owner_id": 0}) } cond = cond.And(c) - } - if opts.OwnerID > 0 { + } else if opts.OwnerID > 0 { // OwnerID is ignored if RepoID is set c := builder.NewCond().And(builder.Eq{"owner_id": opts.OwnerID}) if opts.WithAvailable { c = c.Or(builder.Eq{"repo_id": 0, "owner_id": 0}) @@ -263,6 +273,11 @@ func DeleteRunner(ctx context.Context, id int64) error { // CreateRunner creates new runner. func CreateRunner(ctx context.Context, t *ActionRunner) error { + if t.OwnerID != 0 && t.RepoID != 0 { + // It's trying to create a runner that belongs to a repository, but OwnerID has been set accidentally. + // Remove OwnerID to avoid confusion; it's not worth returning an error here. + t.OwnerID = 0 + } return db.Insert(ctx, t) } diff --git a/models/actions/runner_token.go b/models/actions/runner_token.go index ccd9bbccb3..fd6ba7ecad 100644 --- a/models/actions/runner_token.go +++ b/models/actions/runner_token.go @@ -15,12 +15,23 @@ import ( ) // ActionRunnerToken represents runner tokens +// +// It can be: +// 1. global token, OwnerID is 0 and RepoID is 0 +// 2. org/user level token, OwnerID is org/user ID and RepoID is 0 +// 3. repo level token, OwnerID is 0 and RepoID is repo ID +// +// Please note that it's not acceptable to have both OwnerID and RepoID to be non-zero, +// or it will be complicated to find tokens belonging to a specific owner. +// For example, conditions like `OwnerID = 1` will also return token {OwnerID: 1, RepoID: 1}, +// but it's a repo level token, not an org/user level token. +// To avoid this, make it clear with {OwnerID: 0, RepoID: 1} for repo level tokens. type ActionRunnerToken struct { ID int64 Token string `xorm:"UNIQUE"` - OwnerID int64 `xorm:"index"` // org level runner, 0 means system + OwnerID int64 `xorm:"index"` Owner *user_model.User `xorm:"-"` - RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global + RepoID int64 `xorm:"index"` Repo *repo_model.Repository `xorm:"-"` IsActive bool // true means it can be used @@ -58,7 +69,14 @@ func UpdateRunnerToken(ctx context.Context, r *ActionRunnerToken, cols ...string } // NewRunnerToken creates a new active runner token and invalidate all old tokens +// ownerID will be ignored and treated as 0 if repoID is non-zero. func NewRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerToken, error) { + if ownerID != 0 && repoID != 0 { + // It's trying to create a runner token that belongs to a repository, but OwnerID has been set accidentally. + // Remove OwnerID to avoid confusion; it's not worth returning an error here. + ownerID = 0 + } + token, err := util.CryptoRandomString(40) if err != nil { return nil, err @@ -84,6 +102,12 @@ func NewRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerTo // GetLatestRunnerToken returns the latest runner token func GetLatestRunnerToken(ctx context.Context, ownerID, repoID int64) (*ActionRunnerToken, error) { + if ownerID != 0 && repoID != 0 { + // It's trying to get a runner token that belongs to a repository, but OwnerID has been set accidentally. + // Remove OwnerID to avoid confusion; it's not worth returning an error here. + ownerID = 0 + } + var runnerToken ActionRunnerToken has, err := db.GetEngine(ctx).Where("owner_id=? AND repo_id=?", ownerID, repoID). OrderBy("id DESC").Get(&runnerToken) diff --git a/models/actions/variable.go b/models/actions/variable.go index 8aff844659..d0f917d923 100644 --- a/models/actions/variable.go +++ b/models/actions/variable.go @@ -5,7 +5,6 @@ package actions import ( "context" - "errors" "strings" "code.gitea.io/gitea/models/db" @@ -15,6 +14,18 @@ import ( "xorm.io/builder" ) +// ActionVariable represents a variable that can be used in actions +// +// It can be: +// 1. global variable, OwnerID is 0 and RepoID is 0 +// 2. org/user level variable, OwnerID is org/user ID and RepoID is 0 +// 3. repo level variable, OwnerID is 0 and RepoID is repo ID +// +// Please note that it's not acceptable to have both OwnerID and RepoID to be non-zero, +// or it will be complicated to find variables belonging to a specific owner. +// For example, conditions like `OwnerID = 1` will also return variable {OwnerID: 1, RepoID: 1}, +// but it's a repo level variable, not an org/user level variable. +// To avoid this, make it clear with {OwnerID: 0, RepoID: 1} for repo level variables. type ActionVariable struct { ID int64 `xorm:"pk autoincr"` OwnerID int64 `xorm:"UNIQUE(owner_repo_name)"` @@ -29,30 +40,26 @@ func init() { db.RegisterModel(new(ActionVariable)) } -func (v *ActionVariable) Validate() error { - if v.OwnerID != 0 && v.RepoID != 0 { - return errors.New("a variable should not be bound to an owner and a repository at the same time") - } - return nil -} - func InsertVariable(ctx context.Context, ownerID, repoID int64, name, data string) (*ActionVariable, error) { + if ownerID != 0 && repoID != 0 { + // It's trying to create a variable that belongs to a repository, but OwnerID has been set accidentally. + // Remove OwnerID to avoid confusion; it's not worth returning an error here. + ownerID = 0 + } + variable := &ActionVariable{ OwnerID: ownerID, RepoID: repoID, Name: strings.ToUpper(name), Data: data, } - if err := variable.Validate(); err != nil { - return variable, err - } return variable, db.Insert(ctx, variable) } type FindVariablesOpts struct { db.ListOptions - OwnerID int64 RepoID int64 + OwnerID int64 // it will be ignored if RepoID is set Name string } @@ -60,8 +67,13 @@ func (opts FindVariablesOpts) ToConds() builder.Cond { cond := builder.NewCond() // Since we now support instance-level variables, // there is no need to check for null values for `owner_id` and `repo_id` - cond = cond.And(builder.Eq{"owner_id": opts.OwnerID}) cond = cond.And(builder.Eq{"repo_id": opts.RepoID}) + if opts.RepoID != 0 { // if RepoID is set + // ignore OwnerID and treat it as 0 + cond = cond.And(builder.Eq{"owner_id": 0}) + } else { + cond = cond.And(builder.Eq{"owner_id": opts.OwnerID}) + } if opts.Name != "" { cond = cond.And(builder.Eq{"name": strings.ToUpper(opts.Name)}) diff --git a/models/secret/secret.go b/models/secret/secret.go index 35bed500b9..ce0ad65a79 100644 --- a/models/secret/secret.go +++ b/models/secret/secret.go @@ -5,7 +5,6 @@ package secret import ( "context" - "errors" "fmt" "strings" @@ -22,6 +21,19 @@ import ( ) // Secret represents a secret +// +// It can be: +// 1. org/user level secret, OwnerID is org/user ID and RepoID is 0 +// 2. repo level secret, OwnerID is 0 and RepoID is repo ID +// +// Please note that it's not acceptable to have both OwnerID and RepoID to be non-zero, +// or it will be complicated to find secrets belonging to a specific owner. +// For example, conditions like `OwnerID = 1` will also return secret {OwnerID: 1, RepoID: 1}, +// but it's a repo level secret, not an org/user level secret. +// To avoid this, make it clear with {OwnerID: 0, RepoID: 1} for repo level secrets. +// +// Please note that it's not acceptable to have both OwnerID and RepoID to zero, global secrets are not supported. +// It's for security reasons, admin may be not aware of that the secrets could be stolen by any user when setting them as global. type Secret struct { ID int64 OwnerID int64 `xorm:"INDEX UNIQUE(owner_repo_name) NOT NULL"` @@ -46,6 +58,15 @@ func (err ErrSecretNotFound) Unwrap() error { // InsertEncryptedSecret Creates, encrypts, and validates a new secret with yet unencrypted data and insert into database func InsertEncryptedSecret(ctx context.Context, ownerID, repoID int64, name, data string) (*Secret, error) { + if ownerID != 0 && repoID != 0 { + // It's trying to create a secret that belongs to a repository, but OwnerID has been set accidentally. + // Remove OwnerID to avoid confusion; it's not worth returning an error here. + ownerID = 0 + } + if ownerID == 0 && repoID == 0 { + return nil, fmt.Errorf("%w: ownerID and repoID cannot be both zero, global secrets are not supported", util.ErrInvalidArgument) + } + encrypted, err := secret_module.EncryptSecret(setting.SecretKey, data) if err != nil { return nil, err @@ -56,9 +77,6 @@ func InsertEncryptedSecret(ctx context.Context, ownerID, repoID int64, name, dat Name: strings.ToUpper(name), Data: encrypted, } - if err := secret.Validate(); err != nil { - return secret, err - } return secret, db.Insert(ctx, secret) } @@ -66,29 +84,25 @@ func init() { db.RegisterModel(new(Secret)) } -func (s *Secret) Validate() error { - if s.OwnerID == 0 && s.RepoID == 0 { - return errors.New("the secret is not bound to any scope") - } - return nil -} - type FindSecretsOptions struct { db.ListOptions - OwnerID int64 RepoID int64 + OwnerID int64 // it will be ignored if RepoID is set SecretID int64 Name string } func (opts FindSecretsOptions) ToConds() builder.Cond { cond := builder.NewCond() - if opts.OwnerID > 0 { + + cond = cond.And(builder.Eq{"repo_id": opts.RepoID}) + if opts.RepoID != 0 { // if RepoID is set + // ignore OwnerID and treat it as 0 + cond = cond.And(builder.Eq{"owner_id": 0}) + } else { cond = cond.And(builder.Eq{"owner_id": opts.OwnerID}) } - if opts.RepoID > 0 { - cond = cond.And(builder.Eq{"repo_id": opts.RepoID}) - } + if opts.SecretID != 0 { cond = cond.And(builder.Eq{"id": opts.SecretID}) } diff --git a/tests/integration/api_user_variables_test.go b/tests/integration/api_user_variables_test.go index dd5501f0b9..9fd84ddf81 100644 --- a/tests/integration/api_user_variables_test.go +++ b/tests/integration/api_user_variables_test.go @@ -19,7 +19,7 @@ func TestAPIUserVariables(t *testing.T) { session := loginUser(t, "user1") token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteUser) - t.Run("CreateRepoVariable", func(t *testing.T) { + t.Run("CreateUserVariable", func(t *testing.T) { cases := []struct { Name string ExpectedStatus int @@ -70,7 +70,7 @@ func TestAPIUserVariables(t *testing.T) { } }) - t.Run("UpdateRepoVariable", func(t *testing.T) { + t.Run("UpdateUserVariable", func(t *testing.T) { variableName := "test_update_var" url := fmt.Sprintf("/api/v1/user/actions/variables/%s", variableName) req := NewRequestWithJSON(t, "POST", url, api.CreateVariableOption{ From 333c9ed8cab961b6dd58b04edc47a57dc4d6dbab Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 1 Aug 2024 17:33:40 +0800 Subject: [PATCH 07/18] Add permission description for API to add repo collaborator (#31744) Fix #31552. --- modules/structs/repo_collaborator.go | 1 + templates/swagger/v1_json.tmpl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/modules/structs/repo_collaborator.go b/modules/structs/repo_collaborator.go index 946a6ec7e7..7d39b5a798 100644 --- a/modules/structs/repo_collaborator.go +++ b/modules/structs/repo_collaborator.go @@ -5,6 +5,7 @@ package structs // AddCollaboratorOption options when adding a user as a collaborator of a repository type AddCollaboratorOption struct { + // enum: read,write,admin Permission *string `json:"permission"` } diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 18b9cdab3a..bfaa86428c 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -18484,6 +18484,11 @@ "properties": { "permission": { "type": "string", + "enum": [ + "read", + "write", + "admin" + ], "x-go-name": "Permission" } }, From 21a73ae642b15982a911837775c9583deb47220c Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 1 Aug 2024 18:02:46 +0800 Subject: [PATCH 08/18] Use UTC as default timezone when schedule Actions cron tasks (#31742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #31657. According to the [doc](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onschedule) of GitHub Actions, The timezone for cron should be UTC, not the local timezone. And Gitea Actions doesn't have any reasons to change this, so I think it's a bug. However, Gitea Actions has extended the syntax, as it supports descriptors like `@weekly` and `@every 5m`, and supports specifying the timezone like `TZ=UTC 0 10 * * *`. So we can make it use UTC only when the timezone is not specified, to be compatible with GitHub Actions, and also respect the user's specified. It does break the feature because the times to run tasks would be changed, and it may confuse users. So I don't think we should backport this. ## ⚠️ BREAKING ⚠️ If the server's local time zone is not UTC, a scheduled task would run at a different time after upgrading Gitea to this version. --- models/actions/schedule.go | 20 ++++---- models/actions/schedule_spec.go | 25 +++++++++- models/actions/schedule_spec_test.go | 71 ++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 models/actions/schedule_spec_test.go diff --git a/models/actions/schedule.go b/models/actions/schedule.go index 3646a046a0..c751ef51ca 100644 --- a/models/actions/schedule.go +++ b/models/actions/schedule.go @@ -13,8 +13,6 @@ import ( user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/timeutil" webhook_module "code.gitea.io/gitea/modules/webhook" - - "github.com/robfig/cron/v3" ) // ActionSchedule represents a schedule of a workflow file @@ -53,8 +51,6 @@ func GetReposMapByIDs(ctx context.Context, ids []int64) (map[int64]*repo_model.R return repos, db.GetEngine(ctx).In("id", ids).Find(&repos) } -var cronParser = cron.NewParser(cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor) - // CreateScheduleTask creates new schedule task. func CreateScheduleTask(ctx context.Context, rows []*ActionSchedule) error { // Return early if there are no rows to insert @@ -80,19 +76,21 @@ func CreateScheduleTask(ctx context.Context, rows []*ActionSchedule) error { now := time.Now() for _, spec := range row.Specs { + specRow := &ActionScheduleSpec{ + RepoID: row.RepoID, + ScheduleID: row.ID, + Spec: spec, + } // Parse the spec and check for errors - schedule, err := cronParser.Parse(spec) + schedule, err := specRow.Parse() if err != nil { continue // skip to the next spec if there's an error } + specRow.Next = timeutil.TimeStamp(schedule.Next(now).Unix()) + // Insert the new schedule spec row - if err = db.Insert(ctx, &ActionScheduleSpec{ - RepoID: row.RepoID, - ScheduleID: row.ID, - Spec: spec, - Next: timeutil.TimeStamp(schedule.Next(now).Unix()), - }); err != nil { + if err = db.Insert(ctx, specRow); err != nil { return err } } diff --git a/models/actions/schedule_spec.go b/models/actions/schedule_spec.go index 91240459a0..923e5f7807 100644 --- a/models/actions/schedule_spec.go +++ b/models/actions/schedule_spec.go @@ -5,6 +5,8 @@ package actions import ( "context" + "strings" + "time" "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" @@ -32,8 +34,29 @@ type ActionScheduleSpec struct { Updated timeutil.TimeStamp `xorm:"updated"` } +// Parse parses the spec and returns a cron.Schedule +// Unlike the default cron parser, Parse uses UTC timezone as the default if none is specified. func (s *ActionScheduleSpec) Parse() (cron.Schedule, error) { - return cronParser.Parse(s.Spec) + parser := cron.NewParser(cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor) + schedule, err := parser.Parse(s.Spec) + if err != nil { + return nil, err + } + + // If the spec has specified a timezone, use it + if strings.HasPrefix(s.Spec, "TZ=") || strings.HasPrefix(s.Spec, "CRON_TZ=") { + return schedule, nil + } + + specSchedule, ok := schedule.(*cron.SpecSchedule) + // If it's not a spec schedule, like "@every 5m", timezone is not relevant + if !ok { + return schedule, nil + } + + // Set the timezone to UTC + specSchedule.Location = time.UTC + return specSchedule, nil } func init() { diff --git a/models/actions/schedule_spec_test.go b/models/actions/schedule_spec_test.go new file mode 100644 index 0000000000..0c26fce4b2 --- /dev/null +++ b/models/actions/schedule_spec_test.go @@ -0,0 +1,71 @@ +// Copyright 2024 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package actions + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestActionScheduleSpec_Parse(t *testing.T) { + // Mock the local timezone is not UTC + local := time.Local + tz, err := time.LoadLocation("Asia/Shanghai") + require.NoError(t, err) + defer func() { + time.Local = local + }() + time.Local = tz + + now, err := time.Parse(time.RFC3339, "2024-07-31T15:47:55+08:00") + require.NoError(t, err) + + tests := []struct { + name string + spec string + want string + wantErr assert.ErrorAssertionFunc + }{ + { + name: "regular", + spec: "0 10 * * *", + want: "2024-07-31T10:00:00Z", + wantErr: assert.NoError, + }, + { + name: "invalid", + spec: "0 10 * *", + want: "", + wantErr: assert.Error, + }, + { + name: "with timezone", + spec: "TZ=America/New_York 0 10 * * *", + want: "2024-07-31T14:00:00Z", + wantErr: assert.NoError, + }, + { + name: "timezone irrelevant", + spec: "@every 5m", + want: "2024-07-31T07:52:55Z", + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + s := &ActionScheduleSpec{ + Spec: tt.spec, + } + got, err := s.Parse() + tt.wantErr(t, err) + + if err == nil { + assert.Equal(t, tt.want, got.Next(now).UTC().Format(time.RFC3339)) + } + }) + } +} From d1283524b1ce5106b263949377e5bb3d392d7257 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Thu, 1 Aug 2024 13:42:51 -0400 Subject: [PATCH 09/18] bump vue-bar-graph (#31705) --- package-lock.json | 137 ++++++++++++++++-- package.json | 2 +- .../js/components/RepoActivityTopAuthors.vue | 2 +- 3 files changed, 126 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6b0131a1c..3c1fbfe7cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,7 @@ "uint8-to-base64": "0.2.0", "vanilla-colorful": "0.7.2", "vue": "3.4.31", - "vue-bar-graph": "2.0.0", + "vue-bar-graph": "2.1.0", "vue-chartjs": "5.3.1", "vue-loader": "17.4.2", "webpack": "5.92.1", @@ -7071,12 +7071,6 @@ "dev": true, "license": "MIT" }, - "node_modules/gsap": { - "version": "3.12.5", - "resolved": "https://registry.npmjs.org/gsap/-/gsap-3.12.5.tgz", - "integrity": "sha512-srBfnk4n+Oe/ZnMIOXt3gT605BX9x5+rh/prT2F1SsNJsU1XuMiP0E2aptW481OnonOGACZWBqseH5Z7csHxhQ==", - "license": "Standard 'no charge' license: https://gsap.com/standard-license. Club GSAP members get more: https://gsap.com/licensing/. Why GreenSock doesn't employ an MIT license: https://gsap.com/why-license/" - }, "node_modules/hammerjs": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", @@ -12322,13 +12316,130 @@ } }, "node_modules/vue-bar-graph": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vue-bar-graph/-/vue-bar-graph-2.0.0.tgz", - "integrity": "sha512-IoYP+r5Ggjys6QdUNYFPh7qD41wi/uDOJj9nMawvDgvV6niOz3Dw8O2/98ZnUgjTpcgcGFDaaAaK6qa9x1jgpw==", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vue-bar-graph/-/vue-bar-graph-2.1.0.tgz", + "integrity": "sha512-KcRHEgX2+wt0j9bpglmJKqMox14EMrJwWUuavAl1KdFw4Rvhlpn+/hZeOMFGscJ8W8VLRzX3NO1tGXQmHXSySQ==", "dependencies": { - "gsap": "^3.10.4", - "vue": "^3.2.37" + "vue": "^3.4.33" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/compiler-core": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.34.tgz", + "integrity": "sha512-Z0izUf32+wAnQewjHu+pQf1yw00EGOmevl1kE+ljjjMe7oEfpQ+BI3/JNK7yMB4IrUsqLDmPecUrpj3mCP+yJQ==", + "dependencies": { + "@babel/parser": "^7.24.7", + "@vue/shared": "3.4.34", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/compiler-dom": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.34.tgz", + "integrity": "sha512-3PUOTS1h5cskdOJMExCu2TInXuM0j60DRPpSCJDqOCupCfUZCJoyQmKtRmA8EgDNZ5kcEE7vketamRZfrEuVDw==", + "dependencies": { + "@vue/compiler-core": "3.4.34", + "@vue/shared": "3.4.34" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/compiler-sfc": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.34.tgz", + "integrity": "sha512-x6lm0UrM03jjDXTPZgD9Ad8bIVD1ifWNit2EaWQIZB5CULr46+FbLQ5RpK7AXtDHGjx9rmvC7QRCTjsiGkAwRw==", + "dependencies": { + "@babel/parser": "^7.24.7", + "@vue/compiler-core": "3.4.34", + "@vue/compiler-dom": "3.4.34", + "@vue/compiler-ssr": "3.4.34", + "@vue/shared": "3.4.34", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.10", + "postcss": "^8.4.39", + "source-map-js": "^1.2.0" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/compiler-ssr": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.34.tgz", + "integrity": "sha512-8TDBcLaTrFm5rnF+Qm4BlliaopJgqJ28Nsrc80qazynm5aJO+Emu7y0RWw34L8dNnTRdcVBpWzJxhGYzsoVu4g==", + "dependencies": { + "@vue/compiler-dom": "3.4.34", + "@vue/shared": "3.4.34" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/reactivity": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.34.tgz", + "integrity": "sha512-ua+Lo+wBRlBEX9TtgPOShE2JwIO7p6BTZ7t1KZVPoaBRfqbC7N3c8Mpzicx173fXxx5VXeU6ykiHo7WgLzJQDA==", + "dependencies": { + "@vue/shared": "3.4.34" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/runtime-core": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.34.tgz", + "integrity": "sha512-PXhkiRPwcPGJ1BnyBZFI96GfInCVskd0HPNIAZn7i3YOmLbtbTZpB7/kDTwC1W7IqdGPkTVC63IS7J2nZs4Ebg==", + "dependencies": { + "@vue/reactivity": "3.4.34", + "@vue/shared": "3.4.34" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/runtime-dom": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.34.tgz", + "integrity": "sha512-dXqIe+RqFAK2Euak4UsvbIupalrhc67OuQKpD7HJ3W2fv8jlqvI7szfBCsAEcE8o/wyNpkloxB6J8viuF/E3gw==", + "dependencies": { + "@vue/reactivity": "3.4.34", + "@vue/runtime-core": "3.4.34", + "@vue/shared": "3.4.34", + "csstype": "^3.1.3" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/server-renderer": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.34.tgz", + "integrity": "sha512-GeyEUfMVRZMD/mZcNONEqg7MiU10QQ1DB3O/Qr6+8uXpbwdlmVgQ5Qs1/ZUAFX1X2UUtqMoGrDRbxdWfOJFT7Q==", + "dependencies": { + "@vue/compiler-ssr": "3.4.34", + "@vue/shared": "3.4.34" + }, + "peerDependencies": { + "vue": "3.4.34" + } + }, + "node_modules/vue-bar-graph/node_modules/@vue/shared": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.34.tgz", + "integrity": "sha512-x5LmiRLpRsd9KTjAB8MPKf0CDPMcuItjP0gbNqFCIgL1I8iYp4zglhj9w9FPCdIbHG2M91RVeIbArFfFTz9I3A==" + }, + "node_modules/vue-bar-graph/node_modules/magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/vue-bar-graph/node_modules/vue": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.34.tgz", + "integrity": "sha512-VZze05HWlA3ItreQ/ka7Sx7PoD0/3St8FEiSlSTVgb6l4hL+RjtP2/8g5WQBzZgyf8WG2f+g1bXzC7zggLhAJA==", + "dependencies": { + "@vue/compiler-dom": "3.4.34", + "@vue/compiler-sfc": "3.4.34", + "@vue/runtime-dom": "3.4.34", + "@vue/server-renderer": "3.4.34", + "@vue/shared": "3.4.34" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/vue-chartjs": { diff --git a/package.json b/package.json index 1f60cd611e..55c93ed2d0 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "uint8-to-base64": "0.2.0", "vanilla-colorful": "0.7.2", "vue": "3.4.31", - "vue-bar-graph": "2.0.0", + "vue-bar-graph": "2.1.0", "vue-chartjs": "5.3.1", "vue-loader": "17.4.2", "webpack": "5.92.1", diff --git a/web_src/js/components/RepoActivityTopAuthors.vue b/web_src/js/components/RepoActivityTopAuthors.vue index 9d24310b16..c03795abba 100644 --- a/web_src/js/components/RepoActivityTopAuthors.vue +++ b/web_src/js/components/RepoActivityTopAuthors.vue @@ -1,5 +1,5 @@