diff --git a/.github/workflows/Processors_Release_Tag_and_dockerhub.yaml b/.github/workflows/Processors_Release_Tag_and_dockerhub.yaml new file mode 100644 index 00000000..01712939 --- /dev/null +++ b/.github/workflows/Processors_Release_Tag_and_dockerhub.yaml @@ -0,0 +1,250 @@ +name: Release - Tag from master + Docker Hub Push + +on: + workflow_dispatch: + inputs: + tag_version: + description: "Release tag/version to create (e.g., 16.1.0)" + required: true + type: string + next_dev_version: + description: "Next development version after tagging (e.g., 16.1.1-SNAPSHOT)" + required: true + type: string + push_to_dockerhub: + description: "Push Docker image to Docker Hub? Push only during major and minor releases (e.g., 16.0.0 or 16.1.0), not for patch releases (e.g., 16.1.1)" + required: true + type: choice + options: + - "no" + - "yes" + default: "no" + +permissions: + contents: write + +env: + JIRA_NAME: knowhow-processors-jira + JIRA_XRAY_ZEPHYR_SQUAD_NAME: knowhow-processors-jira-xray-zephyr-squad + JIRA_ZEPHYR_SCALE_NAME: knowhow-processors-jira-zephyr-scale + DEVOPS_NAME: knowhow-processors-devops-processor + AZUREBOARD_NAME: knowhow-processors-azure-boards + AZUREPIPELINE_NAME: knowhow-processors-azure-pipeline-repo-processor + RALLY_NAME: knowhow-processors-rally + SCM_NAME: knowhow-processors-knowhow-scm-processor + DATA_PROCESSOR_NAME: knowhow-processors-data-processor + DOCKERHUB_ORG: psknowhow + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} # without .azurecr.io + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + +jobs: + tag_build_optional_push: + name: Tag, Build, Optional Docker Hub Push + runs-on: ubuntu-latest + timeout-minutes: 40 + + steps: + - name: Checkout master + uses: actions/checkout@v4 + with: + ref: master + fetch-depth: 0 + + - name: Set up Git identity (for commits/tags) + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Set Up Java 17 + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "17" + cache: "maven" + + # Optional: Configure Maven to use GitHub Packages (keep if you need private deps) + - name: Configure Maven settings.xml for GitHub Packages + if: ${{ inputs.push_to_dockerhub == 'yes' }} + run: | + mkdir -p ~/.m2 + cat > ~/.m2/settings.xml <<'EOF' + + + + github + ${{ github.actor }} + ${{ secrets.MAVEN_TOKEN }} + + + + + github + + + github + https://maven.pkg.github.com/PublicisSapient/knowhow-ai-gateway-client + + + + + + github + + + EOF + + # Optional: Clone & build knowhow-common if your build requires it + - name: Clone & Build knowhow-common + if: ${{ inputs.push_to_dockerhub == 'yes' }} + run: | + echo "Cloning knowhow-common branch outside the main repo workspace" + git clone --branch "${{ inputs.tag_version }}" https://github.com/PublicisSapient/knowhow-common.git /tmp/knowhow-common + cd /tmp/knowhow-common && mvn clean install -DskipTests + + - name: Set project version to release + run: | + mvn -B -ntp versions:set \ + -DnewVersion="${{ inputs.tag_version }}" \ + -DprocessAllModules=true \ + -DgenerateBackupPoms=false + + - name: Update common dependency to release version + run: | + mvn -B -ntp versions:use-dep-version \ + -Dincludes=com.publicissapient.kpidashboard:common \ + -DdepVersion="${{ inputs.tag_version }}" \ + -DforceVersion=true \ + -DprocessAllModules=true \ + -DgenerateBackupPoms=false + + - name: Commit release version change + run: | + git add -A + git commit -m "chore(release): ${{ inputs.tag_version }}" || echo "No changes to commit" + + - name: Create annotated git tag + run: | + git tag -a "${{ inputs.tag_version }}" -m "Release ${{ inputs.tag_version }}" + + - name: Push commit + tag to origin/master + run: | + # avoid staging a submodule path accidentally if knowhow-common exists in the superproject + git restore --staged knowhow-common || true + git restore knowhow-common || true + git push origin master + git push origin --follow-tags + + - name: Build jar skip tests + if: ${{ inputs.push_to_dockerhub == 'yes' }} + run: | + mvn clean install -Ddockerfile.skip=true -DskipTests + + - name: Set up Docker Buildx + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/setup-buildx-action@v3 + + - name: Docker login (Docker Hub) + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push JIRA Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: jira/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.JIRA_NAME }}:${{ inputs.tag_version }} + + - name: Build and push DevOps Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: . + file: devops-processor-startup/Dockerfile + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.DEVOPS_NAME }}:${{ inputs.tag_version }} + + - name: Build and push Rally Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: rally/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.RALLY_NAME }}:${{ inputs.tag_version }} + + - name: Build and push JIRA Zephyr scale Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: jira-zephyr-scale/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.JIRA_ZEPHYR_SCALE_NAME }}:${{ inputs.tag_version }} + + - name: Build and push JIRA Zephyr Squad Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: jira-xray-zephyr-squad/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.JIRA_XRAY_ZEPHYR_SQUAD_NAME }}:${{ inputs.tag_version }} + + - name: Build and push Azure Board Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: azure-boards/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.AZUREBOARD_NAME }}:${{ inputs.tag_version }} + + - name: Build and push Azure Pipeline Repo Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: . + file: azure-pipeline-repo-processor-startup/Dockerfile + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.AZUREPIPELINE_NAME }}:${{ inputs.tag_version }} + + - name: Build and push SCM Processor Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: knowhow-scm-processor/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.SCM_NAME }}:${{ inputs.tag_version }} + + - name: Build and push Data Processor Docker image to Docker Hub + if: ${{ inputs.push_to_dockerhub == 'yes' }} + uses: docker/build-push-action@v6 + with: + context: data-processor/ + push: ${{ inputs.push_to_dockerhub == 'yes' }} + tags: | + ${{ env.DOCKERHUB_ORG }}/${{ env.DATA_PROCESSOR_NAME }}:${{ inputs.tag_version }} + + - name: Bump to next development version + run: | + mvn -B -ntp versions:set \ + -DnewVersion="${{ inputs.next_dev_version }}" \ + -DprocessAllModules=true \ + -DgenerateBackupPoms=false + + - name: Commit next development version bump + run: | + git add -A + git commit -m "chore: bump version to ${{ inputs.next_dev_version }}" || echo "No changes to commit" + + - name: Push next development version commit to origin/master + run: | + git push origin master diff --git a/argocd/pom.xml b/argocd/pom.xml index 0149bffe..b0a58d6a 100644 --- a/argocd/pom.xml +++ b/argocd/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml argocd-processor diff --git a/azure-boards/pom.xml b/azure-boards/pom.xml index 3a172c34..8043fc49 100644 --- a/azure-boards/pom.xml +++ b/azure-boards/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml azure-processor diff --git a/azure-pipeline/pom.xml b/azure-pipeline/pom.xml index cf642897..93aa7e13 100644 --- a/azure-pipeline/pom.xml +++ b/azure-pipeline/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml azurepipeline-processor diff --git a/azure-repo/pom.xml b/azure-repo/pom.xml index 30800676..25cb7ebf 100644 --- a/azure-repo/pom.xml +++ b/azure-repo/pom.xml @@ -14,7 +14,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml azurerepo-processor diff --git a/bamboo/pom.xml b/bamboo/pom.xml index bc46699c..9bac19f7 100644 --- a/bamboo/pom.xml +++ b/bamboo/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml bamboo-processor diff --git a/bitbucket/pom.xml b/bitbucket/pom.xml index 12d9476e..f3543386 100644 --- a/bitbucket/pom.xml +++ b/bitbucket/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml bitbucket-processor diff --git a/data-processor/pom.xml b/data-processor/pom.xml index ee67b8ec..03480c1a 100644 --- a/data-processor/pom.xml +++ b/data-processor/pom.xml @@ -19,11 +19,11 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml data-processor - 16.1.0 + 17.2.0-SNAPSHOT Microservice used for preparing, enriching and storing data used by the AI components of the platform data-processor diff --git a/github-action/pom.xml b/github-action/pom.xml index 2658e718..0b98ff63 100644 --- a/github-action/pom.xml +++ b/github-action/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml githubaction-processor diff --git a/github/pom.xml b/github/pom.xml index 44eb736a..6a7dac55 100644 --- a/github/pom.xml +++ b/github/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml github-processor diff --git a/gitlab/pom.xml b/gitlab/pom.xml index ee7f8ece..0299d106 100644 --- a/gitlab/pom.xml +++ b/gitlab/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml gitlab-processor diff --git a/jenkins/pom.xml b/jenkins/pom.xml index d9ecafce..42a93bdd 100644 --- a/jenkins/pom.xml +++ b/jenkins/pom.xml @@ -14,7 +14,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml jenkins-processor diff --git a/jira-xray-zephyr-squad/pom.xml b/jira-xray-zephyr-squad/pom.xml index 0991f22a..f689375a 100644 --- a/jira-xray-zephyr-squad/pom.xml +++ b/jira-xray-zephyr-squad/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml jiratest-processor diff --git a/jira-zephyr-scale/pom.xml b/jira-zephyr-scale/pom.xml index f163a1ec..151c2bb6 100644 --- a/jira-zephyr-scale/pom.xml +++ b/jira-zephyr-scale/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml zephyr-processor diff --git a/jira/pom.xml b/jira/pom.xml index 25f7da7e..0c1dc103 100644 --- a/jira/pom.xml +++ b/jira/pom.xml @@ -14,7 +14,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml jira-processor diff --git a/jira/src/main/java/com/publicissapient/kpidashboard/jira/service/OutlierSprintStrategyImpl.java b/jira/src/main/java/com/publicissapient/kpidashboard/jira/service/OutlierSprintStrategyImpl.java index ce57bcf9..ef0fea41 100644 --- a/jira/src/main/java/com/publicissapient/kpidashboard/jira/service/OutlierSprintStrategyImpl.java +++ b/jira/src/main/java/com/publicissapient/kpidashboard/jira/service/OutlierSprintStrategyImpl.java @@ -26,6 +26,7 @@ import java.util.Set; import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; import org.bson.types.ObjectId; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -69,7 +70,8 @@ public Map> execute(ObjectId basicProjectConfigId) { SprintDetails currentSprint = projectSprints.get(i); SprintDetails nextSprint = projectSprints.get(i + 1); - if (currentSprint.getEndDate() == null || nextSprint.getStartDate() == null) { + if (StringUtils.isEmpty(currentSprint.getEndDate()) + || StringUtils.isEmpty(nextSprint.getStartDate())) { continue; // Skip comparison if either date is null } diff --git a/knowhow-scm-processor/pom.xml b/knowhow-scm-processor/pom.xml index 518fd856..c11cfabd 100644 --- a/knowhow-scm-processor/pom.xml +++ b/knowhow-scm-processor/pom.xml @@ -4,7 +4,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml knowhow-scm-processor diff --git a/pom.xml b/pom.xml index 23e6e2dd..b0946aa5 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT pom scm:git:https://github.com/PublicisSapient/knowhow-processor.git @@ -194,7 +194,7 @@ com.publicissapient.kpidashboard common - 16.1.0 + 17.2.0-SNAPSHOT compile diff --git a/rally/pom.xml b/rally/pom.xml index 395cc974..76e9d477 100644 --- a/rally/pom.xml +++ b/rally/pom.xml @@ -14,7 +14,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml rally-processor diff --git a/sonar/pom.xml b/sonar/pom.xml index e25d4934..e9565fc7 100644 --- a/sonar/pom.xml +++ b/sonar/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml sonar-processor diff --git a/teamcity/pom.xml b/teamcity/pom.xml index 3be97695..4aecfa57 100644 --- a/teamcity/pom.xml +++ b/teamcity/pom.xml @@ -21,7 +21,7 @@ com.publicissapient.kpidashboard processors - 16.1.0 + 17.2.0-SNAPSHOT ../pom.xml teamcity-processor