Commit Graph

5644 Commits

Author SHA1 Message Date
Shengwen YU c2cb8ea4a0
fix: update go.mod (#20071)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-03-01 13:24:14 +08:00
Shengwen YU 7103af0264
feat: bump up golang-runtime from 1.20.7 to 1.21.7 (#20046)
* feat: bump up golang-runtime from 1.20.7 to 1.21.7

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>

* fix: update code to comply golangci-lint

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>

* fix: update the mocks per the change of source code

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>

---------

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-02-29 19:33:29 +08:00
stonezdj(Daojun Zhang) cc328163a6
[cherry-pick]Limit URL to local site (#20024)
Limit URL to local site

Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-02-26 09:21:28 +00:00
stonezdj(Daojun Zhang) c097e4c1a7
[cherry-pick] fix: increase beego max memory and upload size (#19578) (#19670)
fix: increase beego max memory and upload size (#19578)

1. Increase the default beego max memory and upload size from 32GB to
   128GB.
2. Support customize the two beego configs from env.




(cherry picked from commit 553c85eed0)

Signed-off-by: chlins <chenyuzh@vmware.com>
Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: Chlins Zhang <chenyuzh@vmware.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2023-12-06 08:39:52 +08:00
stonezdj(Daojun Zhang) 10286c7073
[cherry-pick] Allow POST method to request service/token in readonly mode (#19562)
Allow POST method to request service/token in readonly mode

  fixes #18243

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-11-13 10:50:25 +08:00
stonezdj(Daojun Zhang) dd959fb5b1
(cherry-pick) Remove job status track information from redis after stop the job in the queue (#19305)
Remove job status track information from redis after stop the job in the queue

  After stop in the queue:
  Remove key in {harbor_job_service_namespace}:job_track:inprogress
  Remove {harbor_job_service_namespace}:job_stats:<job_id>
  fixes #19211

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-09-05 12:09:17 +08:00
Shijun Sun 206c5b8dc1
[Cherry-pick]Add new uri path to ShouldNotReuseRoute array (#19219)
Add new uri path to ShouldNotReuseRoute array
1.Fixes #19216

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-08-21 18:54:58 +08:00
Chlins Zhang ad3e767d51
fix: support customize cache db for business (#19184)
Support to configure the customized redis db for cache layer and other
misc business for core, by default the behavior is same with
previous(stored in db 0).

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-15 17:24:47 +08:00
Chlins Zhang 3f1087269e
[cherry-pick] refactor: migrate the redis command keys to scan (#19147)
refactor: migrate the redis command keys to scan

Refine the cache interface, migrate the Keys to Scan, change the redis
underlying keys command to scan.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-15 10:14:49 +08:00
Chlins Zhang cd31bcbff1
[cherry-pick] fix: fix replication list projects with pure numberic name (#19092)
fix: fix replication list projects with pure numberic name

Quote the project name when listing projects in the replication, resolve
the issue of pure number name of project.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-07 14:24:37 +08:00
Shijun Sun dd5464689a
[Cherry-pick]Convert the string "0" to number 0 (#19081)
Convert the string "0" to number 0
1. Fixes #19046

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-08-03 14:35:12 +08:00
Wang Yan 8b2a7e901a
[cherry-pick]fix accessory import issue (#19058)
fix accessory import issue

fixes #19041

The issuse was introduced by https://github.com/goharbor/harbor/pull/17087.
To move the import to main since the anonymous imports only allowed at main in go-cilint.

Fixes it:
To add the anonymous imports at the jobservice main since the gc job needs to remove accessory when to delete an artifact

Signed-off-by: wang yan <wangyan@vmware.com>
2023-07-31 17:18:57 +08:00
Danny Kulchinsky f8282a56ea
[cherry-pick][2.8] fix: add retry on the caller of v2DeleteManifest instead within v2DeleteManifest (#18803)
fix: add retry on the caller of v2DeleteManifest instead within v2DeleteManifest

Signed-off-by: Danny Kulchinsky <dkulchinsky@fastly.com>
2023-06-12 16:33:20 +08:00
Viktor 0b55284ee3
Changed logic search projects in gitlab adapter for 2.8.0 (#18785)
* fix(gitlab): change logic search projects usage search_namespaces

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>

* tests(gitlab): remove old data and actualization test

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>

* refactor(gitlab): added debug log

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>
(cherry picked from commit 732806221b1c1633682fe1adad4cbcd3a4687d0b)

* lint(gitlab): fix import order

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>

---------

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>
2023-06-07 16:46:31 +08:00
MinerYang 450e7e7884
bump upp distribution to v2.8.2 on release-2.8.0 (#18769)
Signed-off-by: yminer <yminer@vmware.com>
2023-05-31 14:11:07 +08:00
stonezdj(Daojun Zhang) 40a0e37f6b
(cherry-pick) Return error when proxy cache get too many request error(429) (#18750)
Return error when proxy cache get too many request error(429)

  Add 429 too many request error in http error
  Fixes #18707

Signed-off-by: stonezdj <stonezdj@gmail.com>
2023-05-30 15:54:29 +08:00
Wang Yan 51dbbef71c
set tag pull time for proxy cache (#18741)
fixes #18708

to set the pull time of tag for the first time cache the artifact.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-05-29 09:37:12 +08:00
stonezdj(Daojun Zhang) 614683e92c
(cherry-pick) Use subtle.ConstantTimeCompare instead of compare directly (#18712)
Use subtle.ConstantTimeCompare instead of compare directly

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-05-23 21:02:52 +08:00
Chlins Zhang 4f6efeb3d1
[cherry-pick] fix: improve the performance of list artifacts (#18639)
fix: improve the performance of list artifacts

1. Change the query for listing tasks of scan which can use the db
   index.
2. Add the gin index for task.extra_attrs.report_uuids

Fixes: #18013

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-05-05 14:05:46 +08:00
Shijun Sun 3b1c3c168b
[Cherry-pick]Add missing i18n key-value for helm chart (#18579)
Add missing i18n key-value for helm chart
1.Fixes #18572

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-04-23 15:03:25 +08:00
MinerYang 35b81c819a
bump golang.org/x/net && helm.sh/helm/v3 on release-2.8.0 (#18546)
bump up golang.org/x/net to v0.9.0 on release-2.8.0

Signed-off-by: yminer <yminer@vmware.com>

bump helm.sh/helm/v3 v3.11.3
2023-04-18 19:18:25 +08:00
Chlins Zhang 89ef156d09
[cherry-pick] fix: update stopped execution status immediately instead of async update (#18528)
fix: update stopped execution status immediately instead of async update

Update the stopped execution status immediately becasue the user
experience is not good if wait long time when stop or reschedule a job.

Fixes: #18526

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-13 17:55:36 +08:00
Chlins Zhang 47f70cba86
[cherry-pick] fix: clean the redis if the execution is not found (#18519)
fix: clean the redis if the execution is not found

Delete the execution outdated status key in the redis when the execution
is not found.

Fixes: #18511

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-13 10:55:26 +08:00
Shijun Sun 9ea2d3cbd9
[Cherry-pick]Synchronize text modification of quota tooltip to all the i18n files (#18520) 2023-04-12 10:55:08 +03:00
Orlix 83662ee9cc
Reword quotas for 2.8 (#18513)
Reword quota definitions based on user input

Fixes: https://github.com/goharbor/harbor/issues/17545

Signed-off-by: OrlinVasilev <ovasilev@vmware.com>
2023-04-12 11:49:03 +08:00
Chlins Zhang 735f800fd6
[cherry-pick] fix: fix error bitsize of jobservice reaper scan locks (#18493)
fix: fix error bitsize of jobservice reaper scan locks

Change the bitSize from 16 to 64 in the jobservice reaper, the 16 is too
small when the redis cursor over the max value of int16.

Fixes: #18486

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-11 09:34:16 +08:00
Chlins Zhang df1ce0f8c6
[cherry-pick] fix: fix the regexp of execution status outdate key (#18482)
fix: fix the regexp of execution status outdate key

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-05 13:53:28 +08:00
Chlins Zhang 62bb56daf6
refactor: refresh the execution status in async mode (#18434)
Refactor the logic for updating the status of execution when receiving
the hook from jobservice, avoid the optimistic lock due to the multiple
tasks update one execution by refreshing the status asynchronously. But
still retain the old way by specifying the flag from ENV.

Fixes: #17584

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-04 16:37:37 +08:00
Wang Yan 60d9664cbc
fix accessory replication issue (#18471)
Fixes #18404
Support multiple level accessories replication.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-04-04 12:46:46 +08:00
Chlins Zhang a7cef5e24f
fix: wrap schedule/exec/task creation as orm tx (#18458)
Wrap orm tx when the scheduler try to create the task because submit job
maybe failure depends on the jobservice.

Fixes: #18452

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-04 08:42:18 +08:00
Chlins Zhang 02c51c6b70
fix: correct the retention webhook payload (#18462)
Fix the incorrect number of total and retained in the retention webhook
payload, and completes the deleted_artifacts field.

Fixes: #18428

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-03 17:51:02 +08:00
Shijun Sun 1499faf67d
Update styles for UI according to the designer's suggestions (#18463)
1. extend the width for event type label
2. add quotes for Retain image last pull time to make it more understandable

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-04-03 16:47:21 +08:00
Chlins Zhang ca9e2d2f07
fix: generate uuid as CloudEvents id and add additional requestid (#18451)
1. Change the the value of CloudEvents id from requestid to uuid
2. Add additional requestid to trace to event

Fixes: #18448

Signed-off-by: chlins <chenyuzh@vmware.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2023-04-03 12:02:19 +08:00
Wang Yan fddfaa7ba5
fix copy artifact issue (#18460)
To enable the middleware to save the project_blob data, make sure to set the accessories options to true when handling the artifact copy.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-04-03 10:58:17 +08:00
Chlins Zhang cb0749c7ab
fix: add default payload_format for http type webhook (#18445)
1. Add migration SQL to handle the lost payload format for old policies.
2. Set payload format to 'Default' if not specified for http webhook in the API handler.
3. Fix the migration sql of notification_job

Fixes: #18401, #18453

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-04-02 15:33:33 +08:00
Chlins Zhang 5d953b48b6
fix: escape the event data for slack webhook payload (#18424)
Escape the event data of slack webhook as original payload is invalid
when send to slack.

Fixes: #18423

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-03-31 17:05:10 +08:00
Shijun Sun 95972ba693
Add new app level warning message (#18449)
1. Show a app level warning if there is a stuck job
2. Chang `Replication finished` to `Replication status changed`

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-03-31 13:08:57 +08:00
Wang Yan f63865d207
fix the copy artifact issue (#18441)
support copy artifact with multipe levels of accessories.

Signed-off-by: wang yan <wangyan@vmware.com>
2023-03-30 02:04:22 +08:00
Shijun Sun d22c94b4fa
Remove markdown pipe for webhook payload data (#18439)
1. Fixes #18435

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-03-29 12:38:32 +08:00
Chlins Zhang 6e9f72315f
fix: fix the invalid jobid for scan data export (#18398)
Change the JobId param type from int to string, use int will bring some
problems for encode/decode type mismatch which generate the invalid
repository name.

Fixes: #18380

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-03-29 10:29:08 +08:00
Shijun Sun 9e0e8e066b
Add copy digest button for accessories (#18433)
1.Fixes #18406

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-03-28 20:37:44 +08:00
Shijun Sun 9b593550ab
Upgrade @clr/angular and @clr/ui to 15.0.3 (#18427)
1.Fixes #18422
2. Upgrade Clarity to 15.0.3 to apply the fix for #18422

Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-03-28 19:38:12 +08:00
Shijun Sun e5e61d4eaa
Correct a grammatical error (#18431)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2023-03-28 18:05:22 +08:00
Wang Yan 1bb3914de4
fix referrers api response issue (#18430)
1, add fitler artifactType to header when the api is called with filter
2, give an empty json body on non aritfact scenario
3, give an empty array on non accessory scenario
4, fix the artifact type filter issue

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-03-28 13:51:37 +08:00
stonezdj(Daojun Zhang) 088d18bccf
Fix sql error in FixDanglingStateExecution (#18411)
Fix sql error in fixDanglingStateExecution

  fixes #18408

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-03-28 12:57:02 +08:00
Wang Yan deaecf2de5
add subject artifact repo (#18394)
add suject_artifact_repo column in the table artifact_accessory

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-03-22 21:48:09 +08:00
Chlins Zhang 395ae77d64
fix: change the default max retry count for webhook job to 3 (#18392)
Signed-off-by: chlins <chenyuzh@vmware.com>
2023-03-22 17:36:50 +08:00
Chlins Zhang 6590fe8eef
fix: register sweeper retain counts for purge audit log job (#18390)
Signed-off-by: chlins <chenyuzh@vmware.com>
2023-03-22 15:22:24 +08:00
Wang Yan 2f380495bf
revert subject id in the accessory (#18377)
DO not replact id with digest and just add digest into the accessory table

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-03-22 10:58:30 +08:00
stonezdj(Daojun Zhang) 46fa91f866
Fix dangling state execution (#18272)
Add max update hour and max dangling hour setting in config.yaml
  Fixes #17611

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-03-21 18:48:14 +08:00