Skip to content

Commit

Permalink
Merge branch 'master' into fix/fix-image-links
Browse files Browse the repository at this point in the history
Signed-off-by: Jongwoo Han <jongwooo.han@gmail.com>
  • Loading branch information
jongwooo committed Aug 14, 2024
2 parents 1439991 + 50a66ff commit 60e1bf6
Show file tree
Hide file tree
Showing 21 changed files with 254 additions and 184 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# dex-server: ${{ steps.filter.outputs.dex-server }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -44,7 +44,7 @@ jobs:
gitleaks-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run GitLeaks
Expand All @@ -59,9 +59,8 @@ jobs:
if: needs.changes.outputs.graphql-server == 'true' || needs.changes.outputs.authentication == 'true' || needs.changes.outputs.subscriber == 'true' || needs.changes.outputs.event-tracker == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/setup-go@v2
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22" # By default, the go version is v1.15 in runner.

Expand All @@ -82,9 +81,8 @@ jobs:
if: ${{ needs.changes.outputs.frontend == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16

Expand All @@ -101,8 +99,8 @@ jobs:
- backend-checks
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-go@v2
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22" # By default, the go version is v1.15 in runner.
- name: Backend unit tests
Expand All @@ -118,8 +116,8 @@ jobs:
- frontend-checks
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Chaoscenter web unit tests
Expand All @@ -137,7 +135,7 @@ jobs:
if: ${{ needs.changes.outputs.graphql-server == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build graphql server docker image
shell: bash
Expand All @@ -164,7 +162,7 @@ jobs:
if: ${{ needs.changes.outputs.authentication == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build auth server docker image
shell: bash
Expand All @@ -191,7 +189,7 @@ jobs:
if: ${{ needs.changes.outputs.subscriber == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build subscriber docker image
shell: bash
Expand All @@ -217,7 +215,7 @@ jobs:
if: ${{ needs.changes.outputs.frontend == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: yarn build check
run: |
Expand Down Expand Up @@ -248,7 +246,7 @@ jobs:
if: ${{ needs.changes.outputs.event-tracker == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build event tracker docker image
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
outputs:
changed-paths: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ needs.find-latest-commit-sha.outputs.commit-sha }}
fetch-depth: 0

- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
ref: ${{ needs.find-latest-commit-sha.outputs.commit-sha }}
Expand All @@ -64,7 +64,7 @@ jobs:
matrix:
path: ${{ fromJSON(needs.find-changes.outputs.changed-paths) }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ needs.find-latest-commit-sha.outputs.commit-sha }}
fetch-depth: 0
Expand All @@ -88,7 +88,7 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Checkout litmus-E2E Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: litmuschaos/litmus-e2e
path: litmus-e2e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v1
with:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-go@v2
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22" # By default, the go version is v1.15 in runner.
- run: |
Expand All @@ -27,8 +27,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: |
Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- run: |
img_tag=""
array=(`echo ${GITHUB_REF} | sed 's/\//\n/g'`)
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
- backend-checks
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Downloading image artficate
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- backend-checks
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Downloading image artficate
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- backend-checks
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Downloading image artficate
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
- backend-checks
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Downloading image artficate
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
- frontend-checks
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Downloading image artficate
uses: actions/download-artifact@v2
Expand All @@ -254,7 +254,7 @@ jobs:
with:
version: latest

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16

Expand Down
12 changes: 6 additions & 6 deletions chaoscenter/authentication/pkg/project/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (r repository) CreateProject(project *entities.Project) error {

// AddMember adds a new member into the project whose projectID is passed
func (r repository) AddMember(projectID string, member *entities.Member) error {
query := bson.D{{"_id", projectID}}
query := bson.D{{"_id", bson.D{{"$eq", projectID}}}}
update := bson.D{{"$push", bson.D{
{"members", member},
}}}
Expand All @@ -228,7 +228,7 @@ func (r repository) AddMember(projectID string, member *entities.Member) error {

// RemoveInvitation removes member or cancels the invitation
func (r repository) RemoveInvitation(projectID string, userID string, invitation entities.Invitation) error {
query := bson.D{{"_id", projectID}}
query := bson.D{{"_id", bson.D{{"$eq", projectID}}}}
update := bson.D{
{"$pull", bson.D{
{"members", bson.D{
Expand Down Expand Up @@ -301,7 +301,7 @@ func (r repository) UpdateInvite(projectID string, userID string, invitation ent

// UpdateProjectName :Updates Name of the project
func (r repository) UpdateProjectName(projectID string, projectName string) error {
query := bson.D{{"_id", projectID}}
query := bson.D{{"_id", bson.D{{"$eq", projectID}}}}
update := bson.D{{"$set", bson.M{"name": projectName}}}

_, err := r.Collection.UpdateOne(context.TODO(), query, update)
Expand All @@ -319,7 +319,7 @@ func (r repository) UpdateMemberRole(projectID string, userID string, role *enti
bson.D{{"elem.user_id", userID}},
},
})
query := bson.D{{"_id", projectID}}
query := bson.D{{"_id", bson.D{{"$eq", projectID}}}}
update := bson.D{{"$set", bson.M{"members.$[elem].role": role}}}

_, err := r.Collection.UpdateOne(context.TODO(), query, update, opts)
Expand Down Expand Up @@ -436,7 +436,7 @@ func (r repository) GetOwnerProjects(ctx context.Context, userID string) ([]*ent

// GetProjectOwners takes projectID and returns the owners
func (r repository) GetProjectOwners(projectID string) ([]*entities.Member, error) {
filter := bson.D{{"_id", projectID}}
filter := bson.D{{"_id", bson.D{{"$eq", projectID}}}}

var project struct {
Members []*entities.Member `bson:"members"`
Expand Down Expand Up @@ -634,7 +634,7 @@ func NewRepo(collection *mongo.Collection) Repository {

// DeleteProject deletes the project with given projectID
func (r repository) DeleteProject(projectID string) error {
query := bson.D{{"_id", projectID}}
query := bson.D{{"_id", bson.D{{"$eq", projectID}}}}

result, err := r.Collection.DeleteOne(context.TODO(), query)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (r repository) RevokeToken(token *entities.RevokedToken) error {
func (r repository) IsTokenRevoked(encodedToken string) bool {
var result = entities.RevokedToken{}
err := r.Collection.FindOne(context.TODO(), bson.M{
"token": encodedToken,
"token": bson.M{"$eq": encodedToken},
}).Decode(&result)

return err == nil
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ func (c *ChaosExperimentHandler) GetExperiment(ctx context.Context, projectID st
pipeline = mongo.Pipeline{
bson.D{
{"$match", bson.D{
{"experiment_id", experimentID},
{"project_id", projectID},
{"experiment_id", bson.D{{"$eq", experimentID}}},
{"project_id", bson.D{{"$eq", projectID}}},
{"is_removed", false},
}},
},
Expand Down Expand Up @@ -512,7 +512,7 @@ func (c *ChaosExperimentHandler) ListExperiment(projectID string, request model.
// Match with identifiers
matchIdStage := bson.D{
{"$match", bson.D{
{"project_id", projectID},
{"project_id", bson.D{{"$eq", projectID}}},
}},
}

Expand Down Expand Up @@ -1051,7 +1051,7 @@ func (c *ChaosExperimentHandler) GetExperimentStats(ctx context.Context, project
// Match with identifiers
matchIdentifierStage := bson.D{
{"$match", bson.D{
{"project_id", projectID},
{"project_id", bson.D{{"$eq", projectID}}},
{"is_removed", false},
}},
}
Expand Down Expand Up @@ -1345,7 +1345,7 @@ func (c *ChaosExperimentHandler) GetProbesInExperimentRun(ctx context.Context, p
// validateDuplicateExperimentName validates if the name of experiment is duplicate
func (c *ChaosExperimentHandler) validateDuplicateExperimentName(ctx context.Context, projectID, name string) error {
filterQuery := bson.D{
{"project_id", projectID},
{"project_id", bson.D{{"$eq", projectID}}},
{"name", name},
{"is_removed", false},
}
Expand Down
Loading

0 comments on commit 60e1bf6

Please sign in to comment.