Remove port 9443 from harbor IP for webhook event check (#22320)

for LDAP test, the default port changed from 443 to 9443, the original hostname contains IP:PORT, but the webhook event just contains the IP, need remove port before validation.
  fix issue related to CI pass checks

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
This commit is contained in:
stonezdj(Daojun Zhang) 2025-09-05 09:18:57 +08:00 committed by GitHub
parent b1d41ce82b
commit 19c60ea8a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View File

@ -15,6 +15,8 @@ env:
UI_BUILDER_VERSION: 1.6.0 UI_BUILDER_VERSION: 1.6.0
on: on:
# the paths-ignore is the same as the paths in pass-CI.yml, they should be synced together
# see https://web.archive.org/web/20230506145443/https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks#handling-skipped-but-required-checks
pull_request: pull_request:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
@ -23,7 +25,11 @@ on:
- '!tests/**.sh' - '!tests/**.sh'
- '!tests/apitests/**' - '!tests/apitests/**'
- '!tests/ci/**' - '!tests/ci/**'
- '!tests/resources/**'
- '!tests/robot-cases/**'
- '!tests/robot-cases/Group1-Nightly/**'
push: push:
# the paths-ignore is the same as the paths in pass-CI.yml, they should be synced together
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
@ -31,6 +37,9 @@ on:
- '!tests/**.sh' - '!tests/**.sh'
- '!tests/apitests/**' - '!tests/apitests/**'
- '!tests/ci/**' - '!tests/ci/**'
- '!tests/resources/**'
- '!tests/robot-cases/**'
- '!tests/robot-cases/Group1-Nightly/**'
jobs: jobs:
UTTEST: UTTEST:
@ -349,4 +358,4 @@ jobs:
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v5
with: with:
files: ./src/github.com/goharbor/harbor/src/portal/coverage/lcov.info files: ./src/github.com/goharbor/harbor/src/portal/coverage/lcov.info
flags: unittests flags: unittests

View File

@ -2,6 +2,7 @@ name: CI
on: on:
pull_request: pull_request:
# the paths is the same as the paths-ignore in CI.yml, they should be synced together
paths: paths:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
@ -13,6 +14,7 @@ on:
- '!tests/robot-cases/**' - '!tests/robot-cases/**'
- '!tests/robot-cases/Group1-Nightly/**' - '!tests/robot-cases/Group1-Nightly/**'
push: push:
# the paths is the same as the paths-ignore in CI.yml, they should be synced together
paths: paths:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'

View File

@ -16,10 +16,16 @@
Documentation This resource wrap test case body Documentation This resource wrap test case body
Library ../apitests/python/testutils.py Library ../apitests/python/testutils.py
Library ../apitests/python/library/repository.py Library ../apitests/python/library/repository.py
Library String
*** Variables *** *** Variables ***
*** Keywords *** *** Keywords ***
Remove Port
[Arguments] ${address}
${result}= Replace String ${address} :9443 ${EMPTY}
[Return] ${result}
Body Of Manage project publicity Body Of Manage project publicity
Init Chrome Driver Init Chrome Driver
${d}= Get Current Date result_format=%m%s ${d}= Get Current Date result_format=%m%s
@ -578,7 +584,8 @@ Verify Webhook By Tag Retention Finished Event
Verify Webhook By Replication Status Changed Event Verify Webhook By Replication Status Changed Event
[Arguments] ${project_name} ${webhook_name} ${project_dest_name} ${replication_rule_name} ${user} ${harbor_handle} ${webhook_handle} ${payload_format}=Default [Arguments] ${project_name} ${webhook_name} ${project_dest_name} ${replication_rule_name} ${user} ${harbor_handle} ${webhook_handle} ${payload_format}=Default
&{replication_finished_property}= Create Dictionary &{replication_finished_property}= Create Dictionary
Run Keyword If '${payload_format}' == 'Default' Set To Dictionary ${replication_finished_property} type=REPLICATION operator=${user} registry_type=harbor harbor_hostname=${ip} ${cleaned_ip}= Remove Port ${ip}
Run Keyword If '${payload_format}' == 'Default' Set To Dictionary ${replication_finished_property} type=REPLICATION operator=${user} registry_type=harbor harbor_hostname=${cleaned_ip}
... ELSE Set To Dictionary ${replication_finished_property} specversion=1.0 type=harbor.replication.status.changed datacontenttype=application/json operator=${user} trigger_type=MANUAL namespace=${project_name} ... ELSE Set To Dictionary ${replication_finished_property} specversion=1.0 type=harbor.replication.status.changed datacontenttype=application/json operator=${user} trigger_type=MANUAL namespace=${project_name}
Switch Window ${webhook_handle} Switch Window ${webhook_handle}
Delete All Requests Delete All Requests