Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop -> master (Release v0.1.3) #143

Merged
merged 38 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
862be69
add workflows test.yml file
Xiangs18 Mar 2, 2024
3ceb294
fix minio download bug
Xiangs18 Mar 2, 2024
6504061
update test.yml file and add test_dependencies
Xiangs18 Mar 2, 2024
95b4aac
check truncated_response_body
Xiangs18 Mar 2, 2024
1ea7d4c
rm legacy Feb
Xiangs18 Mar 2, 2024
0b70f82
go tidy && cleanup
Xiangs18 Mar 2, 2024
05f498f
delete travis.yml and add TODO in test.yml
Xiangs18 Mar 4, 2024
4e261f7
add other GHA workflows
Xiangs18 Mar 4, 2024
077b92c
Merge pull request #140 from kbase/dev-gha_test
Xiangs18 Mar 5, 2024
d89e3ad
run on mongo7 without update
Xiangs18 Mar 5, 2024
6a71395
add function getMongoDBVer and fix --nojournal arg
Xiangs18 Mar 9, 2024
b1fc000
add more ref for nojournal option
Xiangs18 Mar 9, 2024
d0afe81
remove namespace check
Xiangs18 Mar 9, 2024
d143ada
fix error
Xiangs18 Mar 9, 2024
d1286a3
add auth shadow jar
Xiangs18 Mar 12, 2024
95e7f5c
finish & clean up
Xiangs18 Mar 12, 2024
d2b48b7
update test.yml, var name, and mongo connection testing
Xiangs18 Mar 13, 2024
2ecb09a
check test connection && compare mongo version
Xiangs18 Mar 13, 2024
71babb3
update all the way
Xiangs18 Mar 14, 2024
6dc56fc
fix spacing issue
Xiangs18 Mar 14, 2024
f859c67
switch to ioutil
Xiangs18 Mar 14, 2024
f1c7445
use jar xf to unzip
Xiangs18 Mar 14, 2024
408b570
fix path bug
Xiangs18 Mar 14, 2024
33d9ee7
display all files
Xiangs18 Mar 14, 2024
6369af9
display with println
Xiangs18 Mar 14, 2024
2c8f9d1
sleep 1 sec
Xiangs18 Mar 14, 2024
19ebf3b
check kbase_auth2_templates existence
Xiangs18 Mar 14, 2024
04daa79
clean up && finish
Xiangs18 Mar 14, 2024
8576aab
move pullTemplatesOutofAuth2Jar into New
Xiangs18 Mar 14, 2024
8503aba
address all comments
Xiangs18 Mar 15, 2024
651d281
debug permission denied
Xiangs18 Mar 15, 2024
b30088a
fix bug
Xiangs18 Mar 15, 2024
a3cc1fe
replace nil by context.Background()
Xiangs18 Mar 15, 2024
9771d7e
fix file check
Xiangs18 Mar 15, 2024
f634a19
Merge pull request #141 from kbase/dev-mongo7_upgrade
Xiangs18 Mar 15, 2024
613515c
add release notes for 0.2.0
Xiangs18 Mar 18, 2024
45345d6
bump version
Xiangs18 Mar 18, 2024
05504a5
Merge pull request #142 from kbase/dev-release_notes
Xiangs18 Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "CodeQL"

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop

jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

permissions:
# required for all workflows
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
11 changes: 11 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Manual Build & Push
on:
workflow_dispatch:
jobs:
build-push:
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: br-${{ github.ref_name }}
secrets: inherit
43 changes: 43 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Pull Request Build, Tag, & Push
on:
pull_request:
branches:
- develop
- main
- master
types:
- opened
- reopened
- synchronize
- closed
jobs:
build-develop-open:
if: github.base_ref == 'develop' && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build.yml@main
secrets: inherit
build-develop-merge:
if: github.base_ref == 'develop' && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: pr-${{ github.event.number }},latest
secrets: inherit
build-main-open:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }}
secrets: inherit
build-main-merge:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }},latest-rc
secrets: inherit
trivy-scans:
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Release - Build & Push Image
on:
release:
branches:
- main
- master
types: [ published ]
jobs:
check-source-branch:
uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main
with:
build_branch: '${{ github.event.release.target_commitish }}'
validate-release-tag:
needs: check-source-branch
uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
with:
release_tag: '${{ github.event.release.tag_name }}'
build-push:
needs: validate-release-tag
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: '${{ github.event.release.tag_name }},latest'
secrets: inherit
87 changes: 87 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: KBase Blobstore test

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop

env:
AUTH2_JAR_NAME: kbase-auth2-test-shadow-all-0.7.0.jar

jobs:
workspace_deluxe_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- go: '1.12'
mongo: 'mongodb-linux-x86_64-3.6.12'
minio: '2019-05-23T00-29-34Z'
wired_tiger: 'false'
- go: '1.12'
mongo: 'mongodb-linux-x86_64-ubuntu2204-7.0.4'
minio: '2019-05-23T00-29-34Z'
wired_tiger: 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{matrix.go}}

- name: Install dependencies and set up test config
shell: bash
run: |

# set HOMEDIR
export HOMEDIR=`pwd`

# move to parent dir to install binaries etc
cd ..

# set up auth2 jar
wget -q https://github.com/kbase/jars/raw/master/lib/jars/kbase/auth2/$AUTH2_JAR_NAME
export AUTH2JAR=`pwd`/$AUTH2_JAR_NAME

# set up mongo
wget -q http://fastdl.mongodb.org/linux/${{matrix.mongo}}.tgz
tar xfz ${{matrix.mongo}}.tgz
export MONGOD=`pwd`/${{matrix.mongo}}/bin/mongod

# set up minio
export MINIO=$HOMEDIR/test_dependencies/minio/${{matrix.minio}}/minio
gunzip $MINIO.gz
chmod a+x $MINIO

# set up test config
cd $HOMEDIR
cp -n test.cfg.example test.cfg
sed -i "s#^test.temp.dir =.*#test.temp.dir=temp_test_dir#" test.cfg
sed -i "s#^test.mongo.exe.*#test.mongo.exe=$MONGOD#" test.cfg
sed -i "s#^test.minio.exe.*#test.minio.exe=$MINIO#" test.cfg
sed -i "s#^test.mongo.wired_tiger.*#test.mongo.wired_tiger=${{matrix.wired_tiger}}#" test.cfg
sed -i "s#^test.auth2jar.*#test.auth2jar=$AUTH2JAR#" test.cfg
cat test.cfg

- name: Run tests
shell: bash
run: |
export GO111MODULE=on
go build app/blobstore.go
export TCFG=`pwd`/test.cfg
BLOBSTORE_TEST_CFG=$TCFG go test -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.1.3

- Added GHA workflows and removed Travis CI
- MongoController is now compatible with Mongo versions 2 through 7
- Updated test config file to specify the auth2 shadow jar path vs. the jars repo path

# 0.1.2

- Support for disabling SSL verification of remote S3 certificates (default false) with the s3-disable-ssl-verify option in the configuration file.
Expand Down
2 changes: 1 addition & 1 deletion app/blobstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

const (
name = "blobstore"
version = "0.1.2"
version = "0.1.3"
shockname = "Shock"
shockver = "0.9.6" // do not increment
deprecation = "The id and version fields are deprecated."
Expand Down
4 changes: 1 addition & 3 deletions auth/kbase_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (t *TestSuite) SetupSuite() {
t.mongo = mongoctl

auth, err := kbaseauthcontroller.New(kbaseauthcontroller.Params{
JarsDir: tcfg.JarsDir,
Auth2Jar: tcfg.Auth2JarPath,
MongoHost: "localhost:" + strconv.Itoa(mongoctl.GetPort()),
MongoDatabase: "test_kb_auth_provider_authdb",
RootTempDir: tcfg.TempDir,
Expand Down Expand Up @@ -260,7 +260,6 @@ func (t *TestSuite) TestGetUserFailBadURL() {
"<!DOCTYPE html>",
"<head>",
"<title>1944 Birthday Honours/api/V2/token - Wikipedia</title>",
"February",
},
1000,
},
Expand Down Expand Up @@ -382,7 +381,6 @@ func (t *TestSuite) TestValidateUserNameFailBadURL() {
"<!DOCTYPE html>",
"<head>",
"<title>1944 Birthday Honours/api/V2/users - Wikipedia</title>",
"February",
},
1000,
},
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ github.com/aws/aws-sdk-go v1.19.21 h1:xLaPxl8gy0ZSXbc13jsCKIaHD6NiX+2tAQodPSEL5r
github.com/aws/aws-sdk-go v1.19.21/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -44,7 +43,6 @@ github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 h1:Jpy1PX
github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w=
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
11 changes: 5 additions & 6 deletions nodestore/mongostore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func (t *TestSuite) TestConstructFailAddConfigIndex() {
t.Contains(err.Error(), "E11000 duplicate key error", "incorrect error")
t.Contains(err.Error(), testDB+".config", "incorrect error")
t.Contains(err.Error(), "schema_1", "incorrect error")
t.Contains(err.Error(), "dup key: { : \"schema\" }", "incorrect error")
t.Contains(err.Error(), "dup key: { ", "incorrect error")
t.Contains(err.Error(), ": \"schema\" }", "incorrect error")
}

func (t *TestSuite) TestConstructFailTwoConfigDocs() {
Expand Down Expand Up @@ -773,7 +774,7 @@ func (t *TestSuite) TestConfigIndexes() {
"_id_": false,
"schema_1": true,
}
t.checkIndexes("config", testDB+".config", expected)
t.checkIndexes("config", expected)
}

func (t *TestSuite) TestUserIndexes() {
Expand All @@ -782,20 +783,19 @@ func (t *TestSuite) TestUserIndexes() {
"user_1": true,
"id_1": true,
}
t.checkIndexes("users", testDB+".users", expected)
t.checkIndexes("users", expected)
}

func (t *TestSuite) TestNodeIndexes() {
expected := map[string]bool{
"_id_": false,
"id_1": true,
}
t.checkIndexes("nodes", testDB+".nodes", expected)
t.checkIndexes("nodes", expected)
}

func (t *TestSuite) checkIndexes(
collection string,
expectedNamespace string,
expectedIndexes map[string]bool) {
_, err := NewMongoNodeStore(t.client.Database(testDB))
if err != nil {
Expand All @@ -815,7 +815,6 @@ func (t *TestSuite) checkIndexes(
t.Fail(err.Error())
}
m := elem.Map()
t.Equal(expectedNamespace, m["ns"], "incorrect name space")
if un, ok := m["unique"]; ok {
names[m["name"].(string)] = un.(bool)
} else {
Expand Down
2 changes: 1 addition & 1 deletion service/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (t *TestSuite) addTestRole(username string, role string) {
func (t *TestSuite) setupAuth(cfg *testhelpers.TestConfig,
) (*kbaseauthcontroller.Controller, url.URL) {
auth, err := kbaseauthcontroller.New(kbaseauthcontroller.Params{
JarsDir: cfg.JarsDir,
Auth2Jar: cfg.Auth2JarPath,
MongoHost: "localhost:" + strconv.Itoa(t.mongo.GetPort()),
MongoDatabase: "test_kb_auth_provider_authdb",
RootTempDir: cfg.TempDir,
Expand Down
Loading
Loading