jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.56k stars 786 forks source link

JX Slack integration is not working with nested repos (GitLab) #8303

Open svilenvul opened 2 years ago

svilenvul commented 2 years ago

Currently we don't see only the notifications in Slack. Can you tell us if you need to do smt additionally there to support Slack notifications for GitLab nested Projects? We configured Slack with a token according to the guide https://jenkins-x.io/v3/develop/ui/slack/ and we still don't see any slack notifications. JX Slack pod is showing in the logs that configuration is missing,


│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10                                                                                                     │
│ no slack configuration for our-company-our-group-protection-microservices-dp-ms-legalagreement-main-10 

We are using a default configuration in .jx/gitops/source-config.yaml

apiVersion: gitops.jenkins-x.io/v1alpha1
kind: SourceConfig
metadata:
  creationTimestamp: null
spec:
  groups:
  - owner: our-group-cicd-platform
    provider: https://gitlab.our-group.com/
    providerKind: gitlab
    repositories:
    - name: java-project-example
    scheduler: in-repo
  - owner: our-company
    provider: https://gitlab.our-group.com/
    providerKind: gitlab
    repositories:
    - name: our-group-data-protection/microservices/dp-ms-legalagreement
    - name: our-group-mscr/library/our-group-mscr-library
    - name: our-group-mscr/template/our-group-mscr-charts
    - name: our-group-notification/microservices/tn-ms-phonenumber-verification
    - name: our-groupid/microservices/tiam-ms-profile
    scheduler: in-repo
  slack:
    channel: '#builds'
    kind: failureOrNextSuccess
    pipeline: all

PS tested with jx-slack version 0.1.3.

cc @ankitm123

svilenvul commented 2 years ago

@ankitm123 I am adding here the output of the PipelineActivity

apiVersion: jenkins.io/v1
kind: PipelineActivity
metadata:
  annotations:
    lighthouse.jenkins-x.io/cloneURI: https://gitlab.our-company.com/our-group/our-company-data-protection/microservices/our-service.git
    lighthouse.jenkins-x.io/job: release
  creationTimestamp: "2022-07-14T09:18:19Z"
  generation: 15
  labels:
    branch: main
    build: "10"
    context: release
    created-by-lighthouse: "true"
    event-GUID: ""
    lighthouse.jenkins-x.io/baseSHA: 3aa6e025ddc11a935b51da73d23b88f901d44dfd
    lighthouse.jenkins-x.io/branch: main
    lighthouse.jenkins-x.io/buildNum: "1657790299507"
    lighthouse.jenkins-x.io/context: release
    lighthouse.jenkins-x.io/id: p-ms-legalagreement-main-release-bpzmz
    lighthouse.jenkins-x.io/job: release
    lighthouse.jenkins-x.io/lastCommitSHA: 3aa6e025ddc11a935b51da73d23b88f901d44dfd
    lighthouse.jenkins-x.io/refs.org: our-group
    lighthouse.jenkins-x.io/refs.repo: our-company-data-protection-microservices-our-service
    lighthouse.jenkins-x.io/type: postsubmit
    owner: our-group
    podName: p-ms-legalagreement-main-release-qzpht-from-build-pack-j2-5d86p
    provider: gitlab-our-company-com-tr
    repository: our-company-data-protection-microservices-our-service
    tekton.dev/pipeline: p-ms-legalagreement-main-release-qzpht
  name: our-group-our-company-data-protection-microservices-our-service-main-10
  namespace: jx
  resourceVersion: "288366380"
  uid: f53cc5ff-7550-4d18-91fe-56130a3bebb5
spec:
  baseSHA: 3aa6e025ddc11a935b51da73d23b88f901d44dfd
  batchPipelineActivity: {}
  build: "10"
  completedTimestamp: "2022-07-14T09:28:36Z"
  context: release
  gitBranch: main
  gitOwner: our-group
  gitRepository: our-company-data-protection-microservices-our-service
  gitUrl: https://gitlab.our-company.com/our-group/our-company-data-protection/microservices/our-service.git
  lastCommitMessage: |
    fix: trigger build
  lastCommitSHA: 3aa6e025ddc11a935b51da73d23b88f901d44dfd
  pipeline: our-group/our-company-data-protection-microservices-our-service/main
  releaseNotesURL: https://gitlab.our-company.com/our-group/our-company-data-protection/microservices/our-service/releases/tag/v1.0.27
  startedTimestamp: "2022-07-14T09:18:19Z"
  status: Failed
  steps:
  - kind: Stage
    stage:
      completedTimestamp: "2022-07-14T09:28:36Z"
      name: from build pack
      startedTimestamp: "2022-07-14T09:18:28Z"
      status: Failed
      steps:
      - completedTimestamp: "2022-07-14T09:18:28Z"
        name: Git Clone
        startedTimestamp: "2022-07-14T09:18:28Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:18:29Z"
        name: Next Version
        startedTimestamp: "2022-07-14T09:18:29Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:18:31Z"
        name: Jx Variables
        startedTimestamp: "2022-07-14T09:18:30Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:28:00Z"
        name: Build Mvn Deploy
        startedTimestamp: "2022-07-14T09:18:31Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:28:06Z"
        name: Check Registry
        startedTimestamp: "2022-07-14T09:28:00Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:28:25Z"
        name: Build Container Build
        startedTimestamp: "2022-07-14T09:28:06Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:28:28Z"
        name: Promote Changelog
        startedTimestamp: "2022-07-14T09:28:26Z"
        status: Succeeded
      - completedTimestamp: "2022-07-14T09:28:36Z"
        name: Promote Helm Release
        startedTimestamp: "2022-07-14T09:28:29Z"
        status: Failed
  version: 1.0.27
marziman commented 2 years ago

@ankitm123 👀