Skip to content

Commit

Permalink
Merge branch 'master' into infra-prom-collector-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ledbruno authored Aug 13, 2024
2 parents dbf1b6a + 69982ee commit 9ba25a8
Show file tree
Hide file tree
Showing 28 changed files with 5,116 additions and 162 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
5 changes: 4 additions & 1 deletion MENTORING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ This document serves as a comprehensive record of mentees, mentors, issues, and
| LFX Mentorship | June 1st - August 31st, 2023 | [Soham Ratnaparkhi](https://github.com/SohamRatnaparkhi) | [Amit Kumar Das](https://github.com/amityt), [Arkajyoti Mukherjee](https://github.com/arkajyotiMukherjee) | https://github.com/litmuschaos/litmus/issues/3970 | -- |
| LFX Mentorship | June 1st - August 31st, 2023 | [Nagesh Bansal](https://github.com/Nageshbansal) | [Shubham Chaudhary](https://github.com/ispeakc0de), [Vansh Bhatia](https://github.com/vanshBhatia-A4k9) | https://github.com/litmuschaos/litmus/issues/3969 | [Blog](https://dev.to/nageshbansal/exploring-litmusctl-a-comprehensive-guide-170k) |
| LFX Mentorship | September 1st - November 30th, 2023 | [Magnim Thibaut Freedisch Batale](https://github.com/Freedisch) | [Saranya Jena](https://github.com/Saranya-jena), [Sayan Mondal](https://github.com/S-ayanide) | https://github.com/litmuschaos/litmus/issues/4102 | [Blog](https://dev.to/freedisch_10/embarking-on-a-professional-growth-adventure-insights-from-my-lfx-mentorship-program-at-litmuschaos-5cbc) |
| LFX Mentorship | September 1st - November 30th, 2023 | [Deep Poharkar](https://github.com/deep-poharkar) | [Sarthak Jain](https://github.com/SarthakJain26), [Neelanjan Manna](https://github.com/neelanjan00) | https://github.com/litmuschaos/litmus/issues/4101 | --
| LFX Mentorship | September 1st - November 30th, 2023 | [Deep Poharkar](https://github.com/deep-poharkar) | [Sarthak Jain](https://github.com/SarthakJain26), [Neelanjan Manna](https://github.com/neelanjan00) | https://github.com/litmuschaos/litmus/issues/4101 | -- |
| LFX Mentorship | March 1st - April 31st, 2024 | [Aryan Bhokare](https://github.com/aryan-bhokare) | [Saranya Jena](https://github.com/Saranya-jena), [Hrishav Kumar](https://github.com/hrishavjha), [Sahil Kumar](https://github.com/SahilKr24) | https://github.com/litmuschaos/litmus/issues/4407 | --
| LFX Mentorship | March 1st - April 31st, 2024 | [Shivam Purohit](https://github.com/shivam-Purohit) | [Sarthak Jain](https://github.com/SarthakJain26), [Vedant Shrotria](https://github.com/jonsy13), [Nagesh Bansal](https://github.com/Nageshbansal) | https://github.com/litmuschaos/litmus/issues/4405 | --
| LFX Mentorship | March 1st - April 31st, 2024 | [M R DHANUSH](https://github.com/Dhanush0369) | [Raj Babu Das](https://github.com/imrajdas), [Shubham Chaudhary](https://github.com/ispeakc0de), [NamKyu Park](https://github.com/namkyu1999) | https://github.com/litmuschaos/litmus/issues/4406 | -- |

> Refer to the [CNCF Mentoring](https://github.com/cncf/mentoring) repository for more details.
Expand Down
16 changes: 7 additions & 9 deletions RELEASE_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ reach out by [filing an issue](https://github.com/litmuschaos/litmus/issues).

- The chaos chart bundles are created by publishing the github releases for the [chaos-charts](https://github.com/litmuschaos/chaos-charts) repo. This is picked by the chaos [charthub](https://hub.litmuschaos.io) for user download.

- Tracking of releases is done on Github [project board](https://github.com/litmuschaos/litmus/projects)

- The release flow consists of the following steps:

- Sprint Planning based on backlogs & feature requests from the community
Expand All @@ -56,16 +54,16 @@ considered "pre-releases".

### Major and Minor Releases

Major and minor releases of LitmusChaos will be made from main. Releases of
Major and minor releases of LitmusChaos will be made from master. Releases of
LitmusChaos will be marked with GPG signed tags and announced at
https://github.com/LitmusChaos/LitmusChaos/releases. The tag will be of the
format `v<major>.<minor>.<patch>` and should be made with the command `git tag
-s v<major>.<minor>.<patch>`.
https://github.com/litmuschaos/litmus/releases. The tag will be of the
format `<major>.<minor>.<patch>` and should be made with the command `git tag
-s <major>.<minor>.<patch>`.

After a minor release, a branch will be created, with the format
`release/<major>.<minor>` from the minor tag. All further patch releases will
be done from that branch. For example, once we release `v1.0.0`, a branch
`release/1.0` will be created from that tag. All future patch releases will be
`release-<major>.<minor>.x` from the minor tag. All further patch releases will
be done from that branch. For example, once we release `1.0.0`, a branch
`release-1.0.x` will be created from that tag. All future patch releases will be
done against that branch.

### Pre-releases
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/authentication/api/handlers/rest/user_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ func LoginUser(service services.ApplicationService) gin.HandlerFunc {
user, err := service.FindUserByUsername(userRequest.Username)
if err != nil {
log.Error(err)
c.JSON(utils.ErrorStatusCodes[utils.ErrUserNotFound], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
c.JSON(utils.ErrorStatusCodes[utils.ErrInvalidCredentials], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
return
}

// Checking if user is deactivated
if user.DeactivatedAt != nil {
c.JSON(utils.ErrorStatusCodes[utils.ErrUserDeactivated], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
c.JSON(utils.ErrorStatusCodes[utils.ErrInvalidCredentials], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
return
}

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
Loading

0 comments on commit 9ba25a8

Please sign in to comment.