feat: upgrade golang-runtime from 1.19.3 to 1.21.4; upgrade golangci-lint version to v1.51.2; upgrade MOCKERY_VERSION to v2.22.1; fix mock issue
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
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>
fix: support customize cache db for business
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>
chore: fix incorrect otel timeout in harbor yaml template
Update the incorrect otel timeout sample value in the harbor YAML
configuration template.
Signed-off-by: chlins <chenyuzh@vmware.com>
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>
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>
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>
Return error when proxy cache get too many request error(429)
Add 429 too many request error in http error
Change e2e container for 2.7.x
Fixes#18707
Signed-off-by: stonezdj <stonezdj@gmail.com>
Using code to patch the migration SQL instead of migration SQL file by
go-migrate, the latter way will bring the potential upgrade issue, refer
to code comments for more details.
Signed-off-by: chlins <chenyuzh@vmware.com>
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>
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>
fix: correct the retention webhook payload
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>
fix copy artifact issue
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>
fix: escape the event data for slack webhook payload
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>
fix: fix the invalid jobid for scan data export
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>
Update DB Dockerfile.base
1. Update the path to postgresql.conf.sample as it has changed in postgresql 13.10
2. Remove creating symbolic link as it already exists in postgresql 13.10
Signed-off-by: Yang Jiao <jiaoya@vmware.com>
Add JobService Dashboard API test cases
Added test cases for the following APIs:
1. GET /jobservice/pools/{pool_id}/workers Get workers
2. PUT /jobservice/jobs/{job_id} Stop running jc
3. PUT /jobservice/queues/{job_type} stop and clean, pause, resume pending jobs in the queue
4. GET /jobservice/queues list job queues
5. GET /jobservice/pools Get worker pools
6. GET /schedules List schedules
7. GET /schedules/{job_type}/paused Get scheduler paused status
Signed-off-by: Yang Jiao <jiaoya@vmware.com>