Skip to content

Commit 61760a3

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into feat/live-config-diff
2 parents 929ff22 + bc8106e commit 61760a3

File tree

195 files changed

+3197
-5910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+3197
-5910
lines changed

.eslintignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@ src/components/CIPipelineN/ciPipeline.utils.tsx
4949
src/components/ClusterNodes/ClusterEvents.tsx
5050
src/components/ClusterNodes/ClusterManifest.tsx
5151
src/components/ClusterNodes/ClusterNodeEmptyStates.tsx
52-
src/components/ClusterNodes/NodeActions/EditTaintsModal.tsx
53-
src/components/ClusterNodes/NodeActions/NodeActionsMenu.tsx
54-
src/components/ClusterNodes/NodeActions/validationRules.ts
5552
src/components/ClusterNodes/NodeDetails.tsx
5653
src/components/ClusterNodes/__tests__/ClusterManifest.test.tsx
5754
src/components/ClusterNodes/__tests__/NodeList.test.tsx
58-
src/components/ClusterNodes/constants.ts
5955
src/components/Hotjar/Hotjar.tsx
6056
src/components/Jobs/ExpandedRow/ExpandedRow.tsx
6157
src/components/Jobs/JobDetails/JobDetails.tsx
@@ -130,7 +126,6 @@ src/components/app/list/appList.modal.ts
130126
src/components/app/list/emptyView/Empty.tsx
131127
src/components/app/list/expandedRow/ExpandedRow.tsx
132128
src/components/app/service.ts
133-
src/components/app/types.ts
134129
src/components/bulkEdits/BulkEdits.tsx
135130
src/components/bulkEdits/bulkedit.utils.tsx
136131
src/components/cdPipeline/BuildCD.tsx
@@ -372,7 +367,6 @@ src/components/v2/values/chartValuesDiff/ChartValuesView.reducer.ts
372367
src/components/v2/values/chartValuesDiff/ChartValuesView.tsx
373368
src/components/v2/values/chartValuesDiff/ProjectUpdateModal.tsx
374369
src/components/v2/values/common/chartValues.api.ts
375-
src/components/workflowEditor/CDSuccessModal.tsx
376370
src/components/workflowEditor/CreateWorkflow.tsx
377371
src/components/workflowEditor/DeprecatedWarningModal.tsx
378372
src/components/workflowEditor/EmptyWorkflow.tsx

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ module.exports = {
4242
'airbnb',
4343
'airbnb/hooks',
4444
'prettier',
45-
'plugin:storybook/recommended',
4645
],
4746
rules: {
4847
'prettier/prettier': ['error'],

.github/workflows/pr-issue-validator.yaml

Lines changed: 19 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -12,132 +12,34 @@ on:
1212
- 'release-**'
1313
- 'develop'
1414
- 'hotfix-**'
15-
15+
# paths-ignore:
16+
# - 'docs/**'
17+
# - '.github/'
18+
# - 'CHANGELOG/'
19+
# - 'charts/'
20+
# - 'manifests/'
21+
# - 'sample-docker-templates/'
1622
jobs:
1723
validate-PR-issue:
1824
runs-on: ubuntu-latest
19-
permissions:
20-
issues: write
21-
contents: read
22-
pull-requests: write
23-
repository-projects: read
25+
2426
steps:
2527
- name: Checkout repository
2628
uses: actions/checkout@v2
2729

28-
- name: Validate Issue Reference
30+
- name: Set up jq (for parsing JSON)
31+
run: sudo apt-get install -y jq
32+
33+
- name: PR Validation Script
2934
env:
30-
GH_TOKEN: ${{ github.token }}
3135
PR_BODY: ${{ github.event.pull_request.body }}
3236
PRNUM: ${{ github.event.pull_request.number }}
3337
TITLE: ${{ github.event.pull_request.title }}
38+
GH_TOKEN: ${{ github.token }}
39+
GH_PR_VALIDATOR_TOKEN: ${{ secrets.GH_PR_VALIDATOR_TOKEN }}
40+
BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }}
41+
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
3442
run: |
35-
set -x
36-
# Skip validation for documentation or chore PRs
37-
if [[ "$TITLE" =~ ^(doc:|docs:|chore:|misc:|release:|sync:) ]]; then
38-
echo "Skipping validation for docs/chore PR."
39-
echo "PR NUMBER-: $PRNUM "
40-
gh pr edit $PRNUM --remove-label "PR:Issue-verification-failed"
41-
gh pr edit $PRNUM --add-label "PR:Ready-to-Review"
42-
exit 0
43-
fi
44-
45-
# Define all issue matching patterns
46-
patterns=(
47-
"((Fixes|Resolves) #[0-9]+)"
48-
"((Fixes|Resolves) https://github.com/devtron-labs/devtron/issues/[0-9]+)"
49-
"((Fixes|Resolves) devtron-labs/devtron#[0-9]+)"
50-
"(Fixes|Resolves):?\\s+\\[#([0-9]+)\\]"
51-
"((Fixes|Resolves):? #devtron-labs/devops-sprint/issues/[0-9]+)"
52-
"((Fixes|Resolves):? #devtron-labs/sprint-tasks/issues/[0-9]+)"
53-
"((Fixes|Resolves) https://github.com/devtron-labs/devops-sprint/issues/[0-9]+)"
54-
"((Fixes|Resolves) https://github.com/devtron-labs/sprint-tasks/issues/[0-9]+)"
55-
)
56-
57-
# Extract issue number and repo from PR body
58-
extract_issue_number() {
59-
local pattern="$1" # Get the pattern as the first argument to the function
60-
61-
# Check if PR_BODY matches the provided pattern using Bash's =~ regex operator
62-
if [[ "$PR_BODY" =~ $pattern ]]; then
63-
echo "matched for this pattern $pattern"
64-
65-
issue_num=$(echo "$PR_BODY" | grep -oE "$pattern" | grep -oE "[0-9]+")
66-
67-
# Extract the repository name (e.g., devtron-labs/devtron) from PR_BODY using grep
68-
repo=$(echo "$PR_BODY" | grep -oE "devtron-labs/[a-zA-Z0-9_-]+")
69-
echo "Extracted issue number: $issue_num from repo: $repo"
70-
71-
return 0 # Return success
72-
else
73-
echo "No match for the pattern $pattern"
74-
fi
75-
return 1 # Return failure if no match
76-
}
77-
78-
issue_num=""
79-
repo="devtron-labs/devtron" # Default repo
80-
for pattern in "${patterns[@]}"; do
81-
echo "Now checking for $pattern"
82-
extract_issue_number "$pattern" && break
83-
done
84-
85-
if [[ -z "$issue_num" ]]; then
86-
echo "No valid issue number found."
87-
gh pr edit $PRNUM --add-label "PR:Issue-verification-failed"
88-
gh pr edit $PRNUM --remove-label "PR:Ready-to-Review"
89-
exit 1
90-
fi
91-
92-
# Form the issue API URL dynamically
93-
issue_api_url="https://api.github.com/repos/$repo/issues/$issue_num"
94-
echo "API URL: $issue_api_url"
95-
96-
# Check if the issue exists in the private repo
97-
response_code=$(curl -s -o /dev/null -w "%{http_code}" \
98-
--header "authorization: Bearer ${{ secrets.GH_PR_VALIDATOR_TOKEN }}" \
99-
"$issue_api_url")
100-
101-
if [[ "$response_code" -eq 200 ]]; then
102-
echo "Issue #$issue_num is valid and exists in $repo."
103-
104-
# Fetch the current state of the issue (open/closed) from the private repository.
105-
issue_status=$(curl -s \
106-
--header "authorization: Bearer ${{ secrets.GH_PR_VALIDATOR_TOKEN }}" \
107-
"$issue_api_url" | jq '.state'|tr -d \")
108-
# Check if the issue is still open.
109-
# if [[ "$issue_status" == open ]]; then
110-
# echo "Issue #$issue_num is opened."
111-
if [[ $forked == true ]]; then
112-
echo "PR:Ready-to-Review, exiting gracefully"
113-
exit 0
114-
fi
115-
# Remove the 'Issue-verification-failed' label (if present) and add 'Ready-to-Review'.
116-
gh pr edit $PRNUM --remove-label "PR:Issue-verification-failed"
117-
gh pr edit $PRNUM --add-label "PR:Ready-to-Review"
118-
echo "PR:Ready-to-Review, exiting gracefully"
119-
exit 0
120-
# else
121-
# echo "Issue #$issue_num is closed. Please link an open issue to proceed."
122-
# if [[ $forked == true ]]; then
123-
# echo "PR:Ready-to-Review, exiting gracefully"
124-
# exit 0
125-
# fi
126-
# Add a comment to the PR indicating the issue is not linked correctly.
127-
# gh pr comment $PRNUM --body "PR is linked to a closed issue. Please link an open issue to proceed."
128-
129-
# Add the 'Issue-verification-failed' label and remove 'Ready-to-Review'.
130-
# gh pr edit $PRNUM --add-label "PR:Issue-verification-failed"
131-
# gh pr edit $PRNUM --remove-label "PR:Ready-to-Review"
132-
# exit 1
133-
#fi
134-
else
135-
echo "Issue not found. Invalid URL or issue number."
136-
# Add a comment to the PR indicating the issue is not linked correctly.
137-
gh pr comment $PRNUM --body "PR is not linked to a valid issue. Please update the issue link."
138-
139-
# Apply 'Issue-verification-failed' label and remove 'Ready-to-Review' label.
140-
gh pr edit $PRNUM --add-label "PR:Issue-verification-failed"
141-
gh pr edit $PRNUM --remove-label "PR:Ready-to-Review"
142-
exit 1
143-
fi
43+
wget https://raw.githubusercontent.com/devtron-labs/utilities/feat/central-pr-validator/.github/workflows/validateIssue.sh
44+
chmod +x validateIssue.sh
45+
./validateIssue.sh

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@ storybook-static
4343
.yalc
4444
yalc.lock
4545
.build-cache
46+
47+
.yarn/*
48+
!.yarn/cache
49+
!.yarn/patches
50+
!.yarn/plugins
51+
!.yarn/releases
52+
!.yarn/sdks
53+
!.yarn/versions
54+
.pnp.*

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"*.{js,jsx,ts,tsx}": [
3-
"yarn eslint"
3+
"eslint"
44
]
55
}

.storybook/main.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

.storybook/preview-head.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

.storybook/preview.tsx

Lines changed: 0 additions & 69 deletions
This file was deleted.

.storybook/storybook.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN yarn install --frozen-lockfile --network-timeout 600000
1010
COPY . .
1111

1212
RUN echo `git rev-parse --short HEAD` > health.html && \
13+
echo "" >> .env && \
1314
echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)" >> .env && \
1415
yarn build
1516

0 commit comments

Comments
 (0)