Skip to content

Commit

Permalink
Merge branch 'goharbor:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vad1mo authored May 15, 2023
2 parents 40dc8ce + f8e28db commit 0fb10bf
Show file tree
Hide file tree
Showing 793 changed files with 14,786 additions and 7,564 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ on:
paths-ignore:
- 'docs/**'
- '**.md'
- 'tests/**'
- '!tests/**.sh'
- '!tests/apitests/**'
- '!tests/ci/**'
push:
paths-ignore:
- 'docs/**'
- '**.md'
- 'tests/**'
- '!tests/**.sh'
- '!tests/apitests/**'
- '!tests/ci/**'

jobs:
UTTEST:
Expand All @@ -36,7 +44,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -97,7 +105,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -152,7 +160,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -207,7 +215,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -260,7 +268,7 @@ jobs:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto_assign_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set the author of a PR as the assignee
uses: kentaro-m/[email protected].4
uses: kentaro-m/[email protected].5
with:
configuration-path: ".github/auto-assignees.yml"
9 changes: 5 additions & 4 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:
- uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- uses: google-github-actions/setup-gcloud@v0
- uses: google-github-actions/setup-gcloud@v1
with:
version: '285.0.0'
- run: gcloud info
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- name: Setup Docker
uses: docker-practice/actions-setup-docker@1.0.11
uses: docker-practice/actions-setup-docker@master
with:
docker_version: 20.10
docker_channel: stable
Expand All @@ -46,7 +46,8 @@ jobs:
if: |
contains(steps.changed-files.outputs.modified, 'Dockerfile.base') ||
contains(steps.changed-files.outputs.modified, 'VERSION') ||
contains(steps.changed-files.outputs.modified, '.buildbaselog')
contains(steps.changed-files.outputs.modified, '.buildbaselog') ||
github.ref == 'refs/heads/main'
run: |
set -x
echo "BUILD_BASE=true" >> $GITHUB_ENV
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: "Code scanning - action"

on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
schedule:
- cron: '0 16 * * 6'

Expand All @@ -29,7 +23,7 @@ jobs:
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conformance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- uses: google-github-actions/setup-gcloud@v0
- uses: google-github-actions/setup-gcloud@v1
- run: gcloud info
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20.1
go-version: 1.20.4
id: go
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/housekeeping-stale-issues-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@v8.0.0
with:
stale-issue-message: 'This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.'
stale-pr-message: 'This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Check release-note label set
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v3
- uses: mheap/github-action-required-labels@v4
with:
mode: minimum
count: 1
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/nightly-trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
matrix:
# maintain the versions of harbor that need to be actively
# security scanned
# TODO have to add 2.7 version also once it is released
versions: [dev, v2.7.0-dev]
versions: [dev, v2.8.0-dev]
# list of images that need to be scanned
images: [harbor-core, harbor-db, harbor-exporter, harbor-jobservice, harbor-log, harbor-portal, harbor-registryctl, prepare]
permissions:
Expand All @@ -35,4 +34,4 @@ jobs:
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
sarif_file: 'trivy-results.sarif'
56 changes: 56 additions & 0 deletions .github/workflows/pass-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
pull_request:
paths:
- 'docs/**'
- '**.md'
- 'tests/**'
- '!tests/**.sh'
- '!tests/apitests/**'
- '!tests/ci/**'
push:
paths:
- 'docs/**'
- '**.md'
- 'tests/**'
- '!tests/**.sh'
- '!tests/apitests/**'
- '!tests/ci/**'

jobs:
UTTEST:
runs-on:
- ubuntu-latest
steps:
- run: 'echo "No run required"'

APITEST_DB:
runs-on:
- ubuntu-latest
steps:
- run: 'echo "No run required"'

APITEST_DB_PROXY_CACHE:
runs-on:
- ubuntu-latest
steps:
- run: 'echo "No run required"'

APITEST_LDAP:
runs-on:
- ubuntu-latest
steps:
- run: 'echo "No run required"'

OFFLINE:
runs-on:
- ubuntu-latest
steps:
- run: 'echo "No run required"'

UI_UT:
runs-on:
- ubuntu-latest
steps:
- run: 'echo "No run required"'
4 changes: 2 additions & 2 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- uses: google-github-actions/setup-gcloud@v0
- uses: google-github-actions/setup-gcloud@v1
with:
version: '285.0.0'
- name: Prepare Assets
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
echo "ONLINE_PACKAGE_PATH=$assets_path/$dst_online_package" >> $GITHUB_ENV
echo "MD5SUM_PATH=$assets_path/md5sum" >> $GITHUB_ENV
- name: Setup Docker
uses: docker-practice/actions-setup-docker@1.0.11
uses: docker-practice/actions-setup-docker@master
with:
docker_version: 20.10
docker_channel: stable
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ src/portal/src/lib/coverage
src/portal/ng-swagger-gen
src/portal/docker-build/nginx.conf
src/portal/.angular
src/portal/cypress/videos
src/portal/cypress/screenshots
**/npm*.log

**/*ngsummary.json
Expand Down
42 changes: 27 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Follow us on Twitter at [@project_harbor][twitter]
### Fork Repository

Fork the Harbor repository on GitHub to your personal account.
```
```sh
#Set golang environment
export GOPATH=$HOME/go
mkdir -p $GOPATH/src/github.com/goharbor
Expand Down Expand Up @@ -165,6 +165,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo
| 2.5 | 1.17.7 |
| 2.6 | 1.18.6 |
| 2.7 | 1.19.4 |
| 2.8 | 1.20.4 |

Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.

Expand Down Expand Up @@ -209,12 +210,12 @@ Note: If you split your pull request to small changes, please make sure any of t
Fork the Harbor repository and clone the code to your local workspace. Per Go's [workspace instructions](https://golang.org/doc/code.html#Workspaces), place Harbor's code on your `GOPATH`. Refer to section [Fork Repository](#fork-repository) for details.

Define a local working directory:
```
```sh
working_dir=$GOPATH/src/github.com/goharbor
```

Set user to match your github profile name:
```
```sh
user={your github profile name}
```

Expand All @@ -223,7 +224,7 @@ Both `$working_dir` and `$user` are mentioned in the figure above.
### Branch
Changes should be made on your own fork in a new branch. The branch should be named `XXX-description` where XXX is the number of the issue. PR should be rebased on top of `main` without multiple branches mixed into the PR. If your PR do not merge cleanly, use commands listed below to get it up to date.

```
```sh
#goharbor is the origin upstream

cd $working_dir/harbor
Expand All @@ -234,7 +235,7 @@ git rebase goharbor/main

Branch from the updated `main` branch:

```
```sh
git checkout -b my_feature main
```

Expand All @@ -246,11 +247,11 @@ Try to limit column width to 120 characters for both code and markdown documents

As we are enforcing standards set by [golint](https://github.com/golang/lint), please always run golint on source code before committing your changes. If it reports an issue, in general, the preferred action is to fix the code to comply with the linter's recommendation
because golint gives suggestions according to the stylistic conventions listed in [Effective Go](https://golang.org/doc/effective_go.html) and the [CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments).
```
```sh
#Install fgt and golint

go get -u golang.org/x/lint/golint
go get github.com/GeertJohan/fgt
go install golang.org/x/lint/golint@latest
go install github.com/GeertJohan/fgt@latest

#In the #working_dir/harbor, run

Expand All @@ -261,13 +262,13 @@ go list ./... | grep -v -E 'vendor|tests' | xargs -L1 fgt golint
Unit test cases should be added to cover the new code. Unit test framework for backend services is using [go testing](https://golang.org/doc/code.html#Testing). The UI library test framework is built based on [Jasmine](https://jasmine.github.io/) and [Karma](https://karma-runner.github.io/1.0/index.html), please refer to [Angular Testing](https://angular.io/guide/testing) for more details.

Run go test cases:
```
```sh
#cd #working_dir/src/[package]
go test -v ./...
```

Run UI library test cases:
```
```sh
#cd #working_dir/src/portal/lib
npm run test
```
Expand Down Expand Up @@ -310,7 +311,7 @@ The commit message should follow the convention on [How to Write a Git Commit Me

To help write conformant commit messages, it is recommended to set up the [git-good-commit](https://github.com/tommarshall/git-good-commit) commit hook. Run this command in the Harbor repo's root directory:

```
```sh
curl https://cdn.rawgit.com/tommarshall/git-good-commit/v0.6.1/hook.sh > .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg
```

Expand All @@ -327,7 +328,7 @@ Once your pull request has been opened, harbor will run two CI pipelines against

### Push and Create PR
When ready for review, push your branch to your fork repository on `github.com`:
```
```sh
git push --force-with-lease $user my_feature

```
Expand Down Expand Up @@ -364,11 +365,22 @@ The main location for the documentation is the [website repository](https://gith

Documents are written with Markdown. See [Writing on GitHub](https://help.github.com/categories/writing-on-github/) for more details.

## Design new features
## Develop and propose new features.
### The following simple process can be used to submit new features or changes to the existing code.

- See if your feature is already being worked on. Check both the [Issues](https://github.com/goharbor/harbor/issues) and the [PRs](https://github.com/goharbor/harbor/pulls) in the main Harbor repository as well as the [Community repository](https://github.com/goharbor/community).
- Submit(open PR) the new proposal at [community/proposals/new](https://github.com/goharbor/community/tree/main/proposals/new) using the already existing [template](https://github.com/goharbor/community/blob/main/proposals/TEMPLATE.md)
- The proposal must be labeled as "kind/proposal" - check examples [here](https://github.com/goharbor/community/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3Akind%2Fproposal)
- The proposal can be modified and adapted to meet the requirements from the community, other maintainers and contributors. The overall architecture needs to be consistent to avoid duplicate work in the [Roadmap](https://github.com/goharbor/harbor/wiki#roadmap).
- Proposal should be discussed at Community meeting [Community Meeting agenda](https://github.com/goharbor/community/wiki/Harbor-Community-Meetings) to be presented to maintainers and contributors.
- When reviewed and approved it can be implemented either by the original submitter or anyone else from the community which we highly encourage, as the project is community driven. Open PRs in the respective repositories with all the necessary code and test changes as described in the current document.
- Once implemented or during the implementation, the PRs are reviewed by maintainers and contributors, following the best practices and methods.
- After merging the new PRs, the proposal must be moved to [community/proposals](https://github.com/goharbor/community/tree/main/proposals) and marked as done!
- You have made Harbor even better, congratulations. Thank you!


You can propose new designs for existing Harbor features. You can also design entirely new features, Please submit a proposal in GitHub.(https://github.com/goharbor/community/tree/master/proposals). Harbor maintainers will review this proposal as soon as possible. This is necessary to ensure the overall architecture is consistent and to avoid duplicated work in the roadmap.

[community-meetings]: https://github.com/goharbor/community/blob/master/MEETING_SCHEDULE.md
[community-meetings]: https://github.com/goharbor/community/blob/main/MEETING_SCHEDULE.md
[past-meetings]: https://www.youtube.com/playlist?list=PLgInP-D86bCwTC0DYAa1pgupsQIAWPomv
[users-slack]: https://cloud-native.slack.com/archives/CC1E09J6S
[dev-slack]: https://cloud-native.slack.com/archives/CC1E0J0MC
Expand Down
Loading

0 comments on commit 0fb10bf

Please sign in to comment.