Skip to content

Commit

Permalink
Merge branch 'main' into fix-config-auth-oidcscope-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
wy65701436 authored Oct 24, 2024
2 parents 59e06b6 + bfa67a7 commit 3c4e8ad
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .buildbaselog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* Add date here... Add signature here...
- Add your reason here...

* Oct 24 2024 <[email protected]>
- Refresh base image

* Nov 28 2022 <[email protected]>
- Refresh base image

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,23 @@ jobs:
echo "Package name is: $harbor_offline_build_bundle"
echo "Package name is: $harbor_online_build_bundle"
echo -en "${{ secrets.HARBOR_SIGN_KEY }}" | gpg --import
gpg -v -ab -u ${{ secrets.HARBOR_SIGN_KEY_ID }} $harbor_offline_build_bundle
gpg -v -ab -u ${{ secrets.HARBOR_SIGN_KEY_ID }} $harbor_online_build_bundle
# echo -en "${{ secrets.HARBOR_SIGN_KEY }}" | gpg --import
# gpg -v -ab -u ${{ secrets.HARBOR_SIGN_KEY_ID }} $harbor_offline_build_bundle
# gpg -v -ab -u ${{ secrets.HARBOR_SIGN_KEY_ID }} $harbor_online_build_bundle
source tests/ci/build_util.sh
cp ${harbor_offline_build_bundle} harbor-offline-installer-latest.tgz
cp ${harbor_offline_build_bundle}.asc harbor-offline-installer-latest.tgz.asc
# cp ${harbor_offline_build_bundle}.asc harbor-offline-installer-latest.tgz.asc
cp ${harbor_online_build_bundle} harbor-online-installer-latest.tgz
cp ${harbor_online_build_bundle}.asc harbor-online-installer-latest.tgz.asc
# cp ${harbor_online_build_bundle}.asc harbor-online-installer-latest.tgz.asc
uploader ${harbor_offline_build_bundle} $harbor_target_bucket
uploader ${harbor_offline_build_bundle}.asc $harbor_target_bucket
# uploader ${harbor_offline_build_bundle}.asc $harbor_target_bucket
uploader ${harbor_online_build_bundle} $harbor_target_bucket
uploader ${harbor_online_build_bundle}.asc $harbor_target_bucket
# uploader ${harbor_online_build_bundle}.asc $harbor_target_bucket
uploader harbor-offline-installer-latest.tgz $harbor_target_bucket
uploader harbor-offline-installer-latest.tgz.asc $harbor_target_bucket
# uploader harbor-offline-installer-latest.tgz.asc $harbor_target_bucket
uploader harbor-online-installer-latest.tgz $harbor_target_bucket
uploader harbor-online-installer-latest.tgz.asc $harbor_target_bucket
# uploader harbor-online-installer-latest.tgz.asc $harbor_target_bucket
echo "BUILD_BUNDLE=$harbor_offline_build_bundle" >> $GITHUB_ENV
publishImage $target_branch $Harbor_Assets_Version "${{ secrets.DOCKER_HUB_USERNAME }}" "${{ secrets.DOCKER_HUB_PASSWORD }}"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/reg/adapter/harbor/v2/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ adp.ArtifactRegistry = &adapter{}
func New(base *base.Adapter) adp.Adapter {
return &adapter{
Adapter: base,
client: &client{Client: base.Client},
client: &client{Client: base.Client, pageSize: 100},
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/pkg/reg/adapter/harbor/v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

type client struct {
*base.Client
pageSize int64
}

func (c *client) listRepositories(project *base.Project) ([]*model.Repository, error) {
Expand All @@ -51,8 +52,12 @@ func (c *client) listRepositories(project *base.Project) ([]*model.Repository, e
func (c *client) listArtifacts(repo string) ([]*model.Artifact, error) {
project, repo := utils.ParseRepository(repo)
repo = repository.Encode(repo)
url := fmt.Sprintf("%s/projects/%s/repositories/%s/artifacts?with_label=true&with_accessory=true",
c.BasePath(), project, repo)
// set the default value to equal the value specified when the UI submits the request
if c.pageSize == 0 {
c.pageSize = 15
}
url := fmt.Sprintf("%s/projects/%s/repositories/%s/artifacts?page_size=%d&with_label=true&with_accessory=true",
c.BasePath(), project, repo, c.pageSize)
artifacts := []*artifact.Artifact{}
if err := c.C.GetAndIteratePagination(url, &artifacts); err != nil {
return nil, err
Expand Down
4 changes: 3 additions & 1 deletion src/portal/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export class AppComponent implements OnInit, OnDestroy {
if (this.sessionService.getCurrentUser()?.has_admin_role) {
this.jobServiceDashboardHealthCheckService.checkHealth();
} else {
this.jobServiceDashboardHealthCheckService.setHealthy(true);
this.jobServiceDashboardHealthCheckService.setUnHealthy(
false
);
}
}, CHECK_HEALTH_INTERVAL);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class JobServiceDashboardHealthCheckService {
return this._hasManuallyClosed;
}

setHealthy(value: boolean): void {
setUnHealthy(value: boolean): void {
this._hasUnhealthyQueue = value;
}
setManuallyClosed(value: boolean): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,21 @@
{{ 'REPLICATION.DES_REPO_FLATTENING' | translate }}
</ng-template>
</clr-dg-column>
<clr-dg-column>
<ng-template [clrDgHideableColumn]="{ hidden: hiddenArray[6] }">
{{ 'REPLICATION.REPLICATION_TRIGGER' | translate }}
</ng-template></clr-dg-column
>
<clr-dg-column [clrDgSortBy]="'speed'">
<ng-template [clrDgHideableColumn]="{ hidden: hiddenArray[7] }">
<ng-template [clrDgHideableColumn]="{ hidden: hiddenArray[6] }">
{{ 'REPLICATION.BANDWIDTH' | translate }}
</ng-template>
</clr-dg-column>
<clr-dg-column [clrDgField]="'description'">
<ng-template [clrDgHideableColumn]="{ hidden: hiddenArray[8] }">
<ng-template [clrDgHideableColumn]="{ hidden: hiddenArray[7] }">
{{ 'REPLICATION.DESCRIPTION' | translate }}
</ng-template>
</clr-dg-column>
<clr-dg-column>
<ng-template [clrDgHideableColumn]="{ hidden: hiddenArray[8] }">
{{ 'REPLICATION.REPLICATION_TRIGGER' | translate }}
</ng-template>
</clr-dg-column>
<clr-dg-placeholder>{{
'REPLICATION.PLACEHOLDER' | translate
}}</clr-dg-placeholder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class ListReplicationRuleComponent implements OnInit, OnDestroy {
paused: boolean = false;
hiddenArray: boolean[] = getHiddenArrayFromLocalStorage(
PageSizeMapKeys.LIST_REPLICATION_RULE_COMPONENT,
[false, false, false, false, false, false, false, true, true]
[false, false, false, false, false, false, true, true, false]
);
@ViewChild('datagrid')
datagrid: ClrDatagrid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,84 @@
{{ 'PROJECT_CONFIG.PUBLIC_POLICY' | translate }}
</clr-control-helper>
</clr-checkbox-container>
<clr-checkbox-container *ngIf="isSystemAdmin" clrInline>
<label class="label-color-input">
{{ 'PROJECT.PROXY_CACHE' | translate }}
</label>
<clr-checkbox-wrapper id="is-project-proxy-cache-enabled">
<input
type="checkbox"
clrCheckbox
disabled="!allowUpdateProxyCacheConfiguration"
[(ngModel)]="projectPolicy.ProxyCacheEnabled"
name="project-proxy-cache-enabled" />
</clr-checkbox-wrapper>
<clr-control-helper class="config-subtext">
{{ 'PROJECT.PROXY_CACHE_TOOLTIP' | translate }}
</clr-control-helper>
</clr-checkbox-container>
<div
*ngIf="isSystemAdmin && projectPolicy.ProxyCacheEnabled"
class="clr-form-control mt-0">
<label class="clr-control-label"></label>
<div class="clr-select-wrapper row-inline">
<label class="clr-control-label">
{{ 'PROJECT.ENDPOINT' | translate }}
</label>
<select
class="width-164 ml-1"
id="registry"
name="registry"
disabled="!allowUpdateProxyCacheConfiguration"
[(ngModel)]="projectPolicy.RegistryId">
<option class="display-none" value=""></option>
<option *ngFor="let r of registries" [value]="r.id">
{{ r.name }}-{{ r.url }}
</option>
</select>
</div>
<div class="row-inline ml-2" clrInline>
<label class="clr-control-label">
{{ 'PROJECT.BANDWIDTH' | translate }}
</label>
<div
class="clr-control-container ml-1"
[class.clr-error]="bandwidthError">
<input
type="number"
id="bandwidth"
[(ngModel)]="projectPolicy.ProxySpeedKb"
name="bandwidth"
disabled="!allowUpdateProxyCacheConfiguration"
class="clr-input width-164 mr-10 clr-input-underline"
autocomplete="off"
(ngModelChange)="validateBandwidth()" />
<clr-icon
*ngIf="bandwidthError"
class="clr-validate-icon"
shape="exclamation-circle"></clr-icon>
<div class="clr-select-wrapper mr-10 margin-left-05">
<select
id="bandwidth_unit"
name="bandwidth_unit"
disabled="!allowUpdateProxyCacheConfiguration"
[(ngModel)]="speedUnit">
<option
*ngFor="let unit of speedUnits"
[value]="unit.UNIT">
{{ unit.UNIT }}
</option>
</select>
</div>
<clr-control-error
*ngIf="bandwidthError"
class="tooltip-content">
{{ 'PROJECT.SPEED_LIMIT_TIP' | translate }}
</clr-control-error>
</div>
</div>
</div>

<clr-checkbox-container *ngIf="!isProxyCacheProject" clrInline>
<label
><span>{{ 'PROJECT_CONFIG.SECURITY' | translate }}</span></label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@
.margin-top-05 {
margin-top: 0.5rem;
}

.margin-left-05 {
margin-left: 0.5rem;
}

.row-inline {
display: flex;
}

.row-inline label {
align-self: end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { of } from 'rxjs';
import { SharedTestingModule } from '../../../../shared/shared.module';
import { ErrorHandler } from '../../../../shared/units/error-handler';
import { MessageHandlerService } from '../../../../shared/services/message-handler.service';
import { SessionService } from '../../../../shared/services/session.service';
import { Component, ViewChild } from '@angular/core';

const mockSystemInfo: SystemInfo[] = [
Expand Down Expand Up @@ -99,6 +100,14 @@ const userPermissionService = {
return of(true);
},
};

const sessionService = {
getCurrentUser() {
return of({
has_admin_role: true,
});
},
};
describe('ProjectPolicyConfigComponent', () => {
let fixture: ComponentFixture<TestHostComponent>,
component: TestHostComponent;
Expand All @@ -114,6 +123,7 @@ describe('ProjectPolicyConfigComponent', () => {
{ provide: ErrorHandler, useClass: MessageHandlerService },
{ provide: ProjectService, useValue: projectService },
{ provide: SystemInfoService, useValue: systemInfoService },
{ provide: SessionService, useValue: sessionService },
{
provide: UserPermissionService,
useValue: userPermissionService,
Expand Down
Loading

0 comments on commit 3c4e8ad

Please sign in to comment.