Chat notifications should report the correct name of the job

slack
chat
circle.yml
workflow

#1

Started using v2 with this new project of mine, and it’s been really good so far, I love how fast builds are now, and deployments are equally as fast too. Great job guys!

I setup chat notifications for this project, as I usually do, and I noticed that each job in a workflow returns it’s result with the name “build”, even though that’s not the name of the job.

Given something similar to:

version: 2
defaults: &defaults
  environment:
    TZ: /usr/share/zoneinfo/Europe/London
  working_directory: /home/circleci/awesome-project
jobs:
  build:
    <<: *defaults
    environment:
      NODE_ENV: testing
    docker:
      - image: circleci/node:7.9.0
    steps:
      - checkout

      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: Install dependencies
          command: npm install
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules

      - run: npm run lint
      - run: npm test

  deploy-develop:
    <<: *defaults
    machine: true
    steps:
      - checkout
      - ./deploy-develop.sh # placeholder for this example

  deploy-master:
    <<: *defaults
    machine: true
    steps:
      - checkout
      - ./deploy-master.sh # placeholder for this example

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build
      - deploy-develop:
          filters:
            branches:
              only: develop
          requires:
            - build
      - deploy-master:
          filters:
            branches:
              only: master
          requires:
            - build

For a push to the master branch, I see the following delivered by the Slack chat notification:

However the build job didn’t execute twice, so I think the second notification should reflect the actual name of the job, for example:

Success: build(#55 blah blah)
blah blah

Success: deploy-master (#56 blah blah)
blah blah

I think this would make it less confusing, especially when parts of a workflow fail.

Thanks,

James


#2

Thanks so much for the feedback. cc @KunalJain


#3

@levlaz - Is this on the roadmap? I personally think it’d be preferable to get a single notification as to when the entire build’s workflow chain fails or succeeds. These messages are a bit too granular, especially when there’s no job details.

NOTE: Additionally, it looks like the by field is empty as well


#5

This is definitely a problem. Esp. with the new v2 workflows where you have lots of jobs that would all just become spammy noise since they carry very little info apart from either failing or succeeding. There’s no possibility to tell a deployment from a test for instance.


#6

I agree with @ain. After transitioning to v2 workflows for all of our projects, the flood of messages makes it much harder to know when a build is complete. It would nice to either get a single notification for the build or include the job name in the notification.


#7

We just ended up restricting notifications to trigger only on state change, i.e. either failing or recovering. Not ideal, but a temporary workaround.


#8