Skip to content

CI status watch - #2091

Open
shodiBoy1 wants to merge 13 commits into
devonfw:mainfrom
shodiBoy1:feature/ci-status-watch
Open

CI status watch#2091
shodiBoy1 wants to merge 13 commits into
devonfw:mainfrom
shodiBoy1:feature/ci-status-watch

Conversation

@shodiBoy1

@shodiBoy1 shodiBoy1 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This PR adds ci status watch and external discussion observer workflows

Implemented changes:

  • New ci-status-watch.yml weekday-morning workflow that lists the workflows currently red on main and posts them as a single Teams card, so a broken CI is noticed in the Daily. Reports current state (a workflow stays listed until it's green again); creates no issues. Read-only (actions: read).
  • Extended issue-pr-observer.yml the daily digest now also reports new external GitHub Discussions (fetched via GraphQL, since they have no REST search). Issues/PRs and discussions are shown as two separate sections in the same card. Each source falls back to empty on error, so a failure in one still posts the other.

Testing instructions

  1. Make sure the repo secret TEAMS_WEBHOOK_URL is set (Teams incoming webhook).
  2. CI status watch: Actions -> "CI status watch" → Run workflow. If any workflow on main is red, a card with the list appears in Teams; otherwise the run log says all green and nothing is posted.
  3. Issue/PR/Discussion observer: Actions -> "External Issue, PR & Discussion Observer" -> Run workflow. New external issues/PRs/discussions from the look-back window appear as two sections; if there's nothing new, no message is sent.
  4. Check the run logs each step prints how many items it found.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jun 29, 2026
@shodiBoy1 shodiBoy1 self-assigned this Jun 29, 2026
@shodiBoy1 shodiBoy1 added SCM software-configuration-management (github actions, internal processes, git or github utilization) internal Nothing to be added to CHANGELOG, only internal story workflow GitHub actions (CI,CD,update urls/CVEs) labels Jun 29, 2026
@coveralls

coveralls commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30564081540

Coverage increased (+0.03%) to 72.618%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%

Coverage Stats

Coverage Status
Relevant Lines: 16997
Covered Lines: 12866
Line Coverage: 75.7%
Relevant Branches: 7603
Covered Branches: 4998
Branch Coverage: 65.74%
Branches in Coverage %: Yes
Coverage Strength: 3.21 hits per line

💛 - Coveralls

@shodiBoy1
shodiBoy1 marked this pull request as ready for review June 29, 2026 21:27
@shodiBoy1 shodiBoy1 moved this from 🆕 New to Team Review in IDEasy board Jun 29, 2026

@quando632 quando632 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall solid and defensively written. One point is worth resolving before merge (PR description vs. implementation), the rest are small follow-ups.

Comment thread .github/workflows/ci-status-watch.yml Outdated

# Posts a Teams message ONLY when one of the README badge workflows on the default
# branch turns red (green -> red). For each it compares the two latest runs with gh; a
# change is reported only if the newest run finished within the look-back window, so a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says the workflow lists the currently red workflows and keeps them listed until they turn green again. This header comment and the code actually implement a green-to-red transition that is deduplicated (a workflow that stays red is reported once, not every day). The comment here is the accurate one, so please update the PR description to match the implementation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be even smarter if we keep posting to our channel every night if something is broken so we get spammed and want to get rid of the spam by fixing the problem and nobody can excuse that he missed the notification ;)

Comment thread .github/workflows/ci-status-watch.yml Outdated
Comment thread .github/workflows/ci-status-watch.yml Outdated
Comment thread .github/workflows/ci-status-watch.yml Outdated
Comment thread .github/workflows/ci-status-watch.yml Outdated
IFS=$'\t' read -r CUR CURTIME URL PREV NAME <<< "$ROW"
[ -z "$CUR" ] && continue
[[ "$CURTIME" > "$SINCE" ]] || continue
if is_red "$CUR" && { [ "$PREV" = "success" ] || [ -z "$PREV" ]; }; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A genuinely red run is swallowed when the previous run was cancelled: for runs [failure, cancelled], PREV is cancelled, which is neither success nor empty, so nothing is reported. Since cancelled runs are pruned daily the window is small, but within the same day a real failure can be hidden. Consider treating cancelled as neither red nor green and comparing against the next older non-cancelled run.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quando632 thanks for this finding that I agree to. 👍
Could you suggest a fix so we can merge?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I was checking this again:

  1. I do not see for which workflow we actually cancel in any normal situation so this would be relevant
  2. If we simply send a notification whenever something is read, we can make this so much simpler and do not actually need to dig in the history at all.

I would therefore suggest to go for KISS and simply send the notification whenever the workflow is failed.

FYI:
Initially I thought we would simply integrate this directly into the according workflow what would be even simpler.
However, the advantage of this dedicated workflow is that this extra nice-to-have feature is isolated, not redundantly copied to multiple workflows, cannot break the critical workflows like nightly-build or especially release so I now like this approach...

Comment thread .github/workflows/issue-pr-observer.yml Outdated
@hohwille hohwille moved this from Team Review to 👀 In review in IDEasy board Jul 27, 2026
Comment thread .github/workflows/ci-status-watch.yml Outdated
Co-authored-by: quando632 <quang-hieu.do@capgemini.com>
Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>
@hohwille hohwille changed the title Feature/ci status watch CI status watch Jul 27, 2026

@quando632 quando632 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hohwille as requested, here is the concrete change for the KISS approach report whatever is currently red, every morning, instead of detecting a green→red transition. Four suggestions below, all in ci-status-watch.yml;

One thing worth deciding explicitly rather than leaving it as-is: you wrote "every night", but the cron is 0 7 * * 1-5. Something breaking on Friday evening stays silent until Monday 09:00 CEST. 0 7 * * * would close that gap weekday-only is defensible too, I just don't think it should stay that way by accident. Not included in the suggestions since it's your call.

Comment thread .github/workflows/ci-status-watch.yml Outdated
Comment thread .github/workflows/ci-status-watch.yml Outdated
Comment thread .github/workflows/ci-status-watch.yml Outdated
Comment thread .github/workflows/ci-status-watch.yml Outdated
@hohwille

Copy link
Copy Markdown
Member

One thing worth deciding explicitly rather than leaving it as-is: you wrote "every night" ...

Thanks for pointing that out. Indeed I did not want to imply a workflow schedule/cron change as we do not work on weekends and need no notification on Saturday/Sunday. So I was just lax/un-precise and you are fully correct.

Co-authored-by: quando632 <quang-hieu.do@capgemini.com>

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quando632 thanks for your constructive review suggestions following my KISS idea that I all applied 👍

I have one last suggestion, I would consider to apply before merge.
Can you quickly double-check that I am not missing something.
Then we finally merge and take this nice feature live.

# long as it stays red it is reported every morning, so nobody can miss it.
RED=$(for WF_PATH in $WORKFLOWS; do
gh run list --repo "$REPO" --workflow "$WF_PATH" --branch "$BRANCH" \
--status completed --limit 5 --json conclusion,url,updatedAt,workflowName \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you increased the limit from 2 to 5. However, we only take the first result [0] and ignore the rest anyway.
IMHO the old limit was more reasonable (could be even 1).

Suggested change
--status completed --limit 5 --json conclusion,url,updatedAt,workflowName \
--status completed --limit 2 --json conclusion,url,updatedAt,workflowName \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Nothing to be added to CHANGELOG, only internal story SCM software-configuration-management (github actions, internal processes, git or github utilization) workflow GitHub actions (CI,CD,update urls/CVEs)

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

5 participants