Skip to content

Commit 66145e1

Browse files
Merge pull request #6107 from devtron-labs/main-sync-develop-nov18
misc: main sync develop nov18
2 parents f0fb924 + b4bf74a commit 66145e1

Some content is hidden

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

45 files changed

+379
-305
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#ALL
2-
* @vikramdevtron @kripanshdevtron @nishant-d @prakarsh-dt
2+
* @vikramdevtron @nishant-d @prakarsh-dt @vivek-devtron
33

44
#Helm Charts
5-
charts/devtron/ @prakarsh-dt @pawan-mehta-dt @nishant-d
6-
scripts/devtron-reference-helm-charts @prakarsh-dt @pawan-mehta-dt @nishant-d
7-
CHANGELOG/ @prakarsh-dt @pawan-mehta-dt @nishant-d
5+
charts/devtron/ @prakarsh-dt @pawan-mehta-dt @nishant-d @vikramdevtron
6+
scripts/devtron-reference-helm-charts @prakarsh-dt @pawan-mehta-dt @nishant-d @vikramdevtron
7+
CHANGELOG/ @prakarsh-dt @pawan-mehta-dt @nishant-d @vikramdevtron
88

99
#Migration scripts
10-
scripts/sql @prakarsh-dt @vikramdevtron @kripanshdevtron @nishant-d
11-
scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt
10+
scripts/sql @prakarsh-dt @vikramdevtron @nishant-d @vivek-devtron
11+
scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt @vivek-devtron
1212

1313
#Github Specific
14-
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt
14+
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt @vikramdevtron

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

Lines changed: 90 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
branches:
1111
- 'main'
1212
- 'release-**'
13+
- 'develop'
1314
# paths-ignore:
1415
# - 'docs/**'
1516
# - '.github/'
@@ -42,7 +43,6 @@ jobs:
4243
PRNUM: ${{ github.event.pull_request.number }}
4344
TITLE: ${{ github.event.pull_request.title }}
4445
run: |
45-
set -x
4646
echo "base or target repo : ${{ github.event.pull_request.base.repo.full_name }}"
4747
echo "head or source repo : ${{ github.event.pull_request.head.repo.full_name }}"
4848
if [[ ${{ github.event.pull_request.head.repo.full_name }} == ${{ github.event.pull_request.base.repo.full_name }} ]]; then
@@ -169,78 +169,105 @@ jobs:
169169
pr_no: ${{ github.event.pull_request.number }}
170170
GH_TOKEN: ${{ github.token }}
171171
run: |
172-
173172
# Fetch the latest changes from the main branch
174173
git fetch origin main
175-
174+
176175
# Get the list of changed files
177176
git diff origin/main...HEAD --name-only > diff
178-
177+
178+
# Specify the directory containing migration files
179+
MIGRATION_DIR="scripts/sql"
180+
ls
181+
pwd
182+
183+
# Print changed files
179184
echo "Changed files:"
180185
cat diff
181-
182-
echo "Changed SQL files-:"
183-
# Filter SQL files from the list of changed files
184-
awk '/scripts\/sql\//' diff
185-
186-
# Count the number of changed SQL files in the 'scripts/sql' directory
187-
count=$(awk '/scripts\/sql\//' diff | wc -l)
188-
189-
# Check if no SQL files were changed
190-
if [[ $count == "0" ]]; then
191-
echo "No SQL files were added, Exiting from this action."
192-
exit 0
193-
fi
194-
195-
# Iterate through each changed SQL file
196-
for filename in $(awk '/scripts\/sql\//' diff); do
197-
echo "Checking File: $filename"
186+
187+
changed_files=""
188+
while IFS= read -r file; do
189+
if [[ $file == $MIGRATION_DIR/* && $file == *.up.sql ]]; then
190+
changed_files+="$file\n"
191+
fi
192+
done < diff
193+
194+
# Print the filtered .up.sql files
195+
echo "Filtered .up.sql files:"
196+
echo -e "$changed_files"
197+
198+
# Check if there are any .up.sql migration files in the changed files list
199+
if [ -z "$changed_files" ]; then
200+
echo "No .up.sql migration files found in the changes."
201+
else
202+
# Extract unique migration numbers from the directory (considering only .up.sql files)
203+
existing_migrations=$(ls $MIGRATION_DIR | grep -E "\.up\.sql$" | grep -oE "[0-9]{3}[0-9]{3}[0-9]{2}" | sort | uniq)
198204
199-
# Check if the SQL file name is in the correct format (i.e., it ends with either '.up.sql' or '.down.sql')
200-
if [[ "$filename" =~ \.(up|down)\.sql$ ]]; then
201-
202-
# Print a message that the file name is in the correct format
203-
echo "File name: $filename is in the correct format"
204-
else
205-
# Print an error message
206-
echo "Error: The SQL file name is not in the correct format: $filename."
207-
208-
# Post a comment on a GitHub pull request with the error message
209-
gh pr comment $pr_no --body "The SQL file name: $filename is not in the correct format."
210-
211-
# Exit the script with a non-zero status code
212-
exit 1
213-
fi
214-
215-
# Navigate to the SQL files directory
216-
sql_dir="scripts/sql"
217-
echo "Current directory: $(pwd)"
218-
cd "$sql_dir"
219-
echo "SQL files directory: $(pwd)"
205+
# Exclude migration numbers from changed files in existing_migrations
206+
while read -r file; do
207+
migration_number=$(basename "$file" | grep -oE "[0-9]{3}[0-9]{3}[0-9]{2}")
208+
existing_migrations=$(echo "$existing_migrations" | grep -v "$migration_number")
209+
done <<< "$changed_files"
220210
221-
# Extract the migration number from the SQL file name
222-
migration_no=$(echo "$filename" | cut -d "/" -f 3 | cut -d "_" -f 1)
223-
echo "Migration Number: $migration_no"
211+
# Validate each changed .up.sql migration file
212+
is_valid=true
213+
processed_migrations=()
214+
while read -r file; do
215+
# Extract migration number from the filename
216+
migration_number=$(basename "$file" | grep -oE "[0-9]{3}[0-9]{3}[0-9]{2}")
224217
225-
# Count the number of files with the same migration number
226-
migration_files_present_of_this_no=$(ls | cut -d "_" -f 1 | grep -w -c "$migration_no")
227-
228-
# Navigate back to the original directory
229-
cd ../..
218+
# Check if the filename has the full XXXPPPNN format
219+
if [[ ! $(basename "$file") =~ ^[0-9]{3}[0-9]{3}[0-9]{2}_ ]]; then
220+
echo "Error: Migration file $file does not have the complete XXXPPPNN format."
221+
is_valid=false
222+
continue
223+
fi
230224
231-
# Check the conditions based on the number of files with the same migration number
232-
if [[ $migration_files_present_of_this_no == "2" ]]; then
233-
echo "All looks good for this migration number."
234-
elif [[ $migration_files_present_of_this_no == "1" ]]; then
235-
# Only one file is present for this migration number
236-
echo "Only single migration file was present for migration no.: $migration_no. either up or down migration is missing! EXITING"
237-
gh pr comment $pr_no --body "Error: Only a single migration file was present for this number: $migration_no."
238-
exit 1
239-
else
240-
# Migration number is repeated
241-
echo "Error: Migration number is repeated."
242-
gh pr comment $pr_no --body "Error: The SQL file number: $migration_no is duplicated"
225+
if [ -z "$migration_number" ]; then
226+
echo "Warning: Could not extract migration number from $file."
227+
continue
228+
fi
229+
230+
# Check if this migration number has already been processed
231+
if [[ " ${processed_migrations[@]} " =~ " $migration_number " ]]; then
232+
continue
233+
fi
234+
processed_migrations+=("$migration_number")
235+
236+
# Check if the migration number is unique
237+
if echo "$existing_migrations" | grep -q "$migration_number"; then
238+
echo "Error: Migration number $migration_number already exists."
239+
is_valid=false
240+
fi
241+
242+
# Check if the migration number is greater than previous ones
243+
last_migration=$(echo "$existing_migrations" | tail -n 1)
244+
if [ "$migration_number" -le "$last_migration" ]; then
245+
echo "Error: Migration number $migration_number is not greater than the latest ($last_migration)."
246+
is_valid=false
247+
fi
248+
249+
# Check for sequential hotfix requirement (if NN > 01, check for NN-1)
250+
hotfix_number=$(echo "$migration_number" | grep -oE "[0-9]{2}$")
251+
if [ "$hotfix_number" -gt "01" ]; then
252+
previous_hotfix=$(printf "%02d" $((10#$hotfix_number - 1)))
253+
expected_previous_number="${migration_number:0:6}$previous_hotfix"
254+
if ! echo "$existing_migrations" | grep -q "$expected_previous_number"; then
255+
echo "Error: Previous hotfix migration $expected_previous_number not found for $migration_number."
256+
is_valid=false
257+
fi
258+
fi
259+
260+
done <<< "$changed_files"
261+
262+
if [ "$is_valid" = false ]; then
263+
echo "Validation failed. Please fix the errors before merging."
264+
gh pr comment $pr_no --body "The Migration files providede inside of the PR does not pass the criteria!!"
243265
exit 1
244266
fi
245-
done
267+
268+
echo "All .up.sql migration file validations passed."
269+
gh pr comment $pr_no --body "The migration files have successfully passed the criteria!!"
270+
fi
271+
272+
246273

CHANGELOG/release-notes-v0.7.4.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## v0.7.4
2+
3+
## Bugs
4+
- fix: Helm rollback in case of no gitops (#6005)
5+
- fix: App detail deployed by (#6032)
6+
- fix: Removed not null constraint for releaseOverride (#6044)
7+
- fix: Showing inaccurate data in template/list api while fetching previous deployments list in template/list api, output shown was cartesian product of deployment_template_history and wfr (#6034)
8+
- fix: Plugin getByName method error handling (#6016)
9+
- fix: Config deployment history fix (#6003)
10+
- fix: Force abort fix (#5990)
11+
- fix: Custom tag (#5999)
12+
- fix: Helm deployment status (#5996)
13+
- fix: Deployment window FIXED type (#5986)
14+
- fix: Migration seq fix (#5962)
15+
- fix: Modified the query for User listing with filters (#5957)
16+
- fix: Bulk deploy panic and docker tag handling (#5949)
17+
- fix: stage artifact logic (#5913)
18+
## Enhancements
19+
- feat: Config diff enhancement (#5837)
20+
- feat: Terminal role casbin policy (#5991)
21+
- feat: Refactoring argo application service and common-lib constants (#5944)
22+
- feat: Feature release v9 sql scripts (#5950)
23+
## Others
24+
- misc: Main sync develop (#6047)
25+
- misc: Permission access getting clubbed (#6045)
26+
- fix : Multiple param of filter in helm app list (#6013)
27+
- chore: Adding refchart migration (#6007)
28+
- chore: Cluster terminal images migration (#6006)
29+
- chore: Trigger clean (#6004)
30+
- misc: Removed deployment group validation when deleting CD pipelines (#5989)
31+
- misc: Replaced != with <> for PostgreSQL compatibility (#5987)
32+
- misc: Main sync 14 oct 2024 (#5985)
33+
- misc: isLatest field in plugin_metadata tag changed to not_null (#5984)
34+
- chore: Main sync develop (#5983)
35+
- misc: error handling while creating github repo in case of concurrent reqs (#5978)
36+
- misc: Release candidate v0.20.0 (#5980)
37+
- misc: Release candidate v0.19.0 (#5930)
38+
- misc: updated migration number (#5948)
39+
- misc: err handling for configmap access (#5938)
40+
41+

CHANGELOG/release-notes-v1.0.0.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## v1.0.0
2+
3+
## Bugs
4+
- fix: Helm rollback in case of no gitops (#6005)
5+
- fix: App detail deployed by (#6032)
6+
- fix: Removed not null constraint for releaseOverride (#6044)
7+
- fix: Showing inaccurate data in template/list api while fetching previous deployments list in template/list api, output shown was cartesian product of deployment_template_history and wfr (#6034)
8+
- fix: Plugin getByName method error handling (#6016)
9+
- fix: Config deployment history fix (#6003)
10+
- fix: Force abort fix (#5990)
11+
- fix: Helm deployment status (#5996)
12+
- fix: Deployment window FIXED type (#5986)
13+
- fix: Migration seq fix (#5962)
14+
- fix: Modified the query for User listing with filters (#5957)
15+
- fix: Bulk deploy panic and docker tag handling (#5949)
16+
- fix: Stage artifact logic (#5913)
17+
- fix: Permission access getting clubbed (#6045)
18+
## Enhancements
19+
- feat: Config diff enhancement (#5837)
20+
- feat: Terminal role casbin policy (#5991)
21+
- feat: Refactoring argo application service and common-lib constants (#5944)
22+
## Others
23+
- fix : Multiple param of filter in helm app list (#6013)
24+
- chore: Adding refchart migration (#6007)
25+
- chore: Cluster terminal images migration (#6006)
26+
- misc: Removed deployment group validation when deleting CD pipelines (#5989)
27+
- misc: Replaced != with <> for PostgreSQL compatibility (#5987)
28+
- misc: isLatest field in plugin metadata tag changed to not_null (#5984)
29+
- misc: Error handling while creating github repo in case of concurrent reqs (#5978)
30+
- misc: Updated migration number (#5948)
31+
- misc: Err handling for configmap access (#5938)

CHANGELOG/release-notes-v1.0.1.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## v1.0.1
2+
3+
## Bugs
4+
- fix: server version on updating fix (#6079)
5+
- fix: all module installation fix (#6083)
6+
- fix: cluster namespace list informer (#6069)
7+
## Documentation
8+
- doc: Updated Readme for K8s Dashboard & Devtron platform (#6074)
9+
10+

COMMUNITY_CONTRIBUTIONS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* https://www.financialexpress.com/industry/sme/devtron-a-business-opportunity-in-developers-needs/2274094/ - By Srinath Srinivasan
2323

2424

25-
## Videos
25+
## :video_camera: Videos
2626

2727
* https://www.youtube.com/watch?v=ZKcfZC-zSMM - By Victor Farcic
2828

@@ -33,3 +33,4 @@
3333
* https://www.youtube.com/watch?v=W4-UorfDQxI - Carbon_Capital Consulting
3434

3535
* https://www.youtube.com/watch?v=FB5BI3Ef7uw&t=363s - Let's learn Devtron
36+

0 commit comments

Comments
 (0)