Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7ace6df
add support to parse spec field of manifest
ayu-devtron Sep 17, 2024
f122eb7
add support for kind and apiVersion field in resource info
ayu-devtron Sep 17, 2024
1659a68
added common functions to build resource tree and metadata
ayu-devtron Sep 27, 2024
8d4f960
make functions public
ayu-devtron Sep 27, 2024
f726ed7
func renaming
ayu-devtron Sep 27, 2024
1f106a0
cyclic import refactor
ayu-devtron Sep 27, 2024
f5f9ffc
more imports handling
ayu-devtron Sep 27, 2024
5654ff9
remove rest config from arguements
ayu-devtron Sep 27, 2024
7a31db2
added common matching pod function
ayu-devtron Sep 30, 2024
197f504
added common function to build application status
ayu-devtron Sep 30, 2024
0138760
add resource tree resp struct
ayu-devtron Sep 30, 2024
eda545d
Merge branch 'develop' of github.com:devtron-labs/common-lib into app…
ayu-devtron Oct 1, 2024
89916a2
misc: Release candidate v0.19.0 (#190)
vikramdevtron Oct 3, 2024
ad8cac9
fix: sync with common-lib changes (#132)
systemsdt Oct 3, 2024
d1816bc
fix: sync with common-lib changes (#43)
vikramdevtron Oct 3, 2024
44c4465
misc: Release candidate v0.19.0 (#79)
vikramdevtron Oct 3, 2024
bf3835b
fix: sync with common-lib changes (#42)
vikramdevtron Oct 3, 2024
1859c74
chore: Release candidate v0.19.0 (#194)
vikramdevtron Oct 3, 2024
7a9aea9
chore: Release candidate v0.19.0 (#33)
vikramdevtron Oct 3, 2024
2784806
Merge branch 'develop' of github.com:devtron-labs/common-lib into app…
ayu-devtron Oct 4, 2024
c63dd67
Merge remote-tracking branch 'chart-sync/main'
Oct 5, 2024
d137165
Move chart-sync files into subdir
Oct 5, 2024
214b517
Merge remote-tracking branch 'ci-runner/main'
Oct 5, 2024
f24c7c3
Move ci-runner files into subdir
Oct 5, 2024
5d1cbc6
Merge remote-tracking branch 'kubelink/main'
Oct 5, 2024
77c84dd
Move kubelink files into subdir
Oct 5, 2024
c1db5b3
Merge remote-tracking branch 'git-sensor/main'
Oct 5, 2024
f83cf04
Move git-sensor files into subdir
Oct 5, 2024
89a3765
Merge remote-tracking branch 'kubewatch/main'
Oct 5, 2024
48142dc
Move kubewatch files into subdir
Oct 5, 2024
12cd6fb
Merge remote-tracking branch 'lens/main'
Oct 5, 2024
aa78050
Move lens files into subdir
Oct 5, 2024
edce168
Merge remote-tracking branch 'authenticator/main'
Oct 5, 2024
909d03c
Move authenticator files into subdir
Oct 5, 2024
029148c
added binaries
Oct 5, 2024
c5f393f
removed unused file
Oct 5, 2024
32c82b2
Merge remote-tracking branch 'common-lib/appdetails-improv-sept24' in…
Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
156 changes: 156 additions & 0 deletions .github/config/multi-gitter-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# The username of the assignees to be added on the pull request.
assignees:
- systemsdt

# Email of the committer. If not set, the global git config setting will be used.
author-email:

# Name of the committer. If not set, the global git config setting will be used.
author-name:

# The branch which the changes will be based on.
base-branch:

# Base URL of the target platform, needs to be changed for GitHub enterprise, a self-hosted GitLab instance, Gitea or BitBucket.
base-url:

# The name of the branch where changes are committed.
branch:

# The temporary directory where the repositories will be cloned. If not set, the default os temporary directory will be used.
clone-dir:

# Use a code search to find a set of repositories to target (GitHub only). Repeated results from a given repository will be ignored, forks are NOT included by default (use `fork:true` to include them). See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-code.
code-search:

# The commit message. Will default to title + body if none is set.
commit-message:

# The maximum number of concurrent runs.
concurrent: 1

# What should happen if the branch already exist.
# Available values:
# skip: Skip making any changes to the existing branch and do not create a new pull request.
# replace: Replace the existing content of the branch by force pushing any new changes, then reuse any existing pull request, or create a new one if none exist.
conflict-strategy: skip

# Create pull request(s) as draft.
draft: false

# Run without pushing changes or creating pull requests.
dry-run: false

# Limit fetching to the specified number of commits. Set to 0 for no limit.
fetch-depth: 1

# Fork the repository instead of creating a new branch on the same owner.
fork: false

# If set, make the fork to the defined value. Default behavior is for the fork to be on the logged in user.
fork-owner:

# The type of git implementation to use.
# Available values:
# go: Uses go-git, a Go native implementation of git. This is compiled with the multi-gitter binary, and no extra dependencies are needed.
# cmd: Calls out to the git command. This requires git to be installed and available with by calling "git".
git-type: cmd

# Labels to be added to any created pull request.
labels:
- dependencies
- multi-gitter

# The file where all logs should be printed to. "-" means stdout.
log-file: "-"

# The formatting of the logs. Available values: text, json, json-pretty.
log-format: text

# The level of logging that should be made. Available values: trace, debug, info, error.
log-level: info

# If this value is set, reviewers will be randomized.
max-reviewers: 0

# If this value is set, team reviewers will be randomized
max-team-reviewers: 0

# The name of a GitHub organization. All repositories in that organization will be used.
# org:
# - devtron-labs

# The file that the output of the script should be outputted to. "-" means stdout.
output: "-"

# Don't use any terminal formatting when printing the output.
plain-output: false

# The platform that is used. Available values: github, gitlab, gitea, bitbucket_server, bitbucket_cloud. Note: bitbucket_cloud is in Beta
platform: github

# The body of the commit message. Will default to everything but the first line of the commit message if none is set.
pr-body: "This PR was created by multi-gitter to sync common-lib changes across multiple repositories."

# The title of the PR. Will default to the first line of the commit message if none is set.
pr-title:

# The name, including owner of a GitLab project in the format "ownerName/repoName".
project:
- group/project

# Skip pull request and only push the feature branch.
push-only: false

# The name, including owner of a GitHub repository in the format "ownerName/repoName".
repo:
- devtron-labs/common-lib-private
- devtron-labs/devtron-enterprise
- devtron-labs/kubewatch
- devtron-labs/kubelink-enterprise
- devtron-labs/image-scanner-enterprise
- devtron-labs/lens
- devtron-labs/ci-runner-enterprise
- devtron-labs/git-sensor-enterprise
- devtron-labs/chart-sync-enterprise
- devtron-labs/devtron
- devtron-labs/kubelink
- devtron-labs/image-scanner
- devtron-labs/ci-runner
- devtron-labs/git-sensor
- devtron-labs/chart-sync



# Exclude repositories that match with a given Regular Expression
repo-exclude:

# Include repositories that match with a given Regular Expression
repo-include:

# Use a repository search to find repositories to target (GitHub only). Forks are NOT included by default, use `fork:true` to include them. See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories.
repo-search:

# The username of the reviewers to be added on the pull request.
reviewers:
- prkhrkat




# Skip repositories which are forks.
skip-forks: false

# Skip pull request and directly push to the branch.
skip-pr: false

# Skip changes on specified repositories, the name is including the owner of repository in the format "ownerName/repoName".
skip-repo:
- example

# Use SSH cloning URL instead of HTTPS + token. This requires that a setup with ssh keys that have access to all repos and that the server is already in known_hosts.
ssh-auth: false

# The personal access token for the targeting platform. Can also be set using the GITHUB_TOKEN/GITLAB_TOKEN/GITEA_TOKEN/BITBUCKET_SERVER_TOKEN/BITBUCKET_CLOUD_APP_PASSWORD environment variable.
token:

30 changes: 30 additions & 0 deletions .github/scripts/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Title: Updates a go module to a new (patch/minor) version

### Change these values ###
MODULE=github.com/devtron-labs/common-lib
VERSION=$VERSION

echo "Commit SHA: $VERSION"

# Stop the script if any command fails
set -e

# Check if the module already exists, abort if it does not
go list -m $MODULE &> /dev/null
status_code=$?
if [ $status_code -ne 0 ]; then
echo "Module \"$MODULE\" does not exist"
exit 1
fi

# Update the module to the specified version
go get $MODULE@$VERSION

go mod tidy

# Vendor the dependencies
go mod vendor


2 changes: 1 addition & 1 deletion .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ititleOnly: true
titleOnly: true

types:
- fix
Expand Down
48 changes: 48 additions & 0 deletions .github/workflow/multi-gitter-pr-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Creating PR using Multi-Gitter

on:
pull_request:
types: [opened]
branches:
- develop

jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '>=1.17.0'

- name: Install multi-gitter
run: curl -s https://raw.githubusercontent.com/lindell/multi-gitter/b62a2dfda0ed266502f7c71f7ce79f8fd9c26bf6/install.sh | sh

- name: Get PR details
env:
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
run: |
echo "HEAD_BRANCH=$HEAD_BRANCH" >> $GITHUB_ENV
echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
echo "PR_AUTHOR=$PR_AUTHOR" >> $GITHUB_ENV
echo "PR_AUTHOR_ID=$PR_AUTHOR_ID" >> $GITHUB_ENV
echo "PR_AUTHOR_EMAIL=${PR_AUTHOR_ID}+${PR_AUTHOR}@users.noreply.github.com" >> $GITHUB_ENV

- name: Update script with PR details
run: |
sed -i 's/VERSION=.*/VERSION=${{ env.COMMIT_SHA }}/' .github/scripts/update-version.sh

- name: Run multi-gitter
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
chmod +x .github/scripts/update-version.sh
multi-gitter run .github/scripts/update-version.sh --token "$GITEA_TOKEN" --base-branch "$BASE_BRANCH" --branch "$HEAD_BRANCH" --author-name "$PR_AUTHOR" --author-email "$PR_AUTHOR_EMAIL" --pr-title "fix: sync with changes from $HEAD_BRANCH of common-lib" --config .github/config/multi-gitter-config
23 changes: 23 additions & 0 deletions .github/workflows/lens_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: sync

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
sync:
runs-on: ubuntu-latest
name: Git Repo Sync
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: pawan-59/[email protected]
with:
target-url: 'https://gitee.com/devtron-labs/lens'
target-username: 'prakarsh'
target-token: ${{ secrets.GITEE_ACCESS_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/multi-gitter-pr-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Creating PR using Multi-Gitter

on:
pull_request:
types: [opened]
branches:
- develop
- main

jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '>=1.17.0'

- name: Install multi-gitter
run: curl -s https://raw.githubusercontent.com/lindell/multi-gitter/b62a2dfda0ed266502f7c71f7ce79f8fd9c26bf6/install.sh | sh

- name: Get PR details
env:
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
run: |
echo "HEAD_BRANCH=$HEAD_BRANCH" >> $GITHUB_ENV
echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
echo "PR_AUTHOR=$PR_AUTHOR" >> $GITHUB_ENV
echo "PR_AUTHOR_ID=$PR_AUTHOR_ID" >> $GITHUB_ENV
echo "PR_AUTHOR_EMAIL=${PR_AUTHOR_ID}+${PR_AUTHOR}@users.noreply.github.com" >> $GITHUB_ENV

- name: Update script with PR details
run: |
sed -i 's/VERSION=.*/VERSION=${{ env.COMMIT_SHA }}/' .github/scripts/update-version.sh

- name: Run multi-gitter
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
chmod +x .github/scripts/update-version.sh
multi-gitter run .github/scripts/update-version.sh --token "$GITEA_TOKEN" --base-branch "$BASE_BRANCH" --branch "$HEAD_BRANCH" --author-name "$PR_AUTHOR" --author-email "$PR_AUTHOR_EMAIL" --pr-title "fix: sync with changes from $HEAD_BRANCH of common-lib" --config .github/config/multi-gitter-config
23 changes: 23 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: sync

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
sync:
runs-on: ubuntu-latest
name: Git Repo Sync
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: pawan-59/[email protected]
with:
target-url: 'https://gitee.com/devtron-labs/git-sensor'
target-username: 'prakarsh'
target-token: ${{ secrets.GITEE_ACCESS_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/tag-patch-incre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Increment tag for patch or minor

on:
pull_request:
branches:
- main
types:
- closed # Trigger only when a PR is closed (merged or not)

jobs:
tag:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create new tag
env:
TOKEN: ${{ secrets.TAG_CREATION_TOKEN_PUBLIC }}
run: |
echo $TOKEN | gh auth login --with-token
latest_tag=$(git tag | sort -V | tail -n 1)
echo "Latest tag: $latest_tag"

# Extract major and minor versions
version=$(echo $latest_tag | cut -d. -f1-2)
# Extract patch version
patch=$(echo $latest_tag | cut -d. -f3)
# Extract minor version
minor=$(echo $latest_tag | cut -d. -f2)
major=$(echo $latest_tag | cut -d. -f1)

# Check if the incoming branch starts with 'release-candidate-'
incoming_branch="${{ github.head_ref }}"
if [[ "$incoming_branch" == release-candidate-* ]]; then
# Increment minor version and reset patch
new_minor=$((minor+1))
new_tag="$major.$new_minor.0"
echo "New tag will be (minor increment): $new_tag"
else
# Increment patch version
new_tag="$version.$((patch+1))"
echo "New tag will be (patch increment): $new_tag"
fi

git config --global user.email "[email protected]"
git config --global user.name "systemsdt"
git tag $new_tag
git push origin $new_tag
Loading