Skip to content

Feature/ci status watch#2091

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

Feature/ci status watch#2091
shodiBoy1 wants to merge 10 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 28817579077

Coverage increased (+0.01%) to 71.811%

Details

  • Coverage increased (+0.01%) 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/version/VersionSegment.java 1 91.34%

Coverage Stats

Coverage Status
Relevant Lines: 16556
Covered Lines: 12391
Line Coverage: 74.84%
Relevant Branches: 7432
Covered Branches: 4835
Branch Coverage: 65.06%
Branches in Coverage %: Yes
Coverage Strength: 3.17 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.


# 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.

GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WEBHOOK: ${{ secrets.TEAMS_WEBHOOK_URL }}
REPO: ${{ github.repository }}
BRANCH: ${{ github.event.repository.default_branch }}

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.

github.event.repository.default_branch is not guaranteed to be populated on the schedule event payload. If it is empty, gh run list --branch "" silently widens the query to all branches. github.ref_name resolves to the default branch on a scheduled run and is always set.

Suggested change
BRANCH: ${{ github.event.repository.default_branch }}
BRANCH: ${{ github.ref_name }}

else
SINCE=$(date -u -d '1 day ago' +%Y-%m-%dT%H:%M:%SZ)
fi
echo "Checking badge workflows for red since $SINCE"

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 branch drives the whole query but is never logged, which makes a failing scheduled run harder to debug. Suggest logging the resolved branch.

Suggested change
echo "Checking badge workflows for red since $SINCE"
echo "Checking badge workflows for red since $SINCE"
echo "Resolved branch: $BRANCH"

[ -z "$ROW" ] && continue
IFS=$'\t' read -r CUR CURTIME URL PREV NAME <<< "$ROW"
[ -z "$CUR" ] && continue
[[ "$CURTIME" > "$SINCE" ]] || continue

@quando632 quando632 Jul 14, 2026

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.

this is a lexicographic string comparison, not a date comparison. It is correct here only because both values are fixed-format ISO-8601 UTC (ending in Z). Worth a short inline comment so it is not later refactored into something that breaks that assumption.

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.

vivu001
run: |
# so a failing gh api trips the || fallback instead of being hidden by the trailing jq
set -o pipefail

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.

This intentionally uses only set -o pipefail and not set -e, because the per-source || { ... ITEMS='[]'; } fallbacks rely on the script continuing after a failed fetch. Please document that intent inline so it is not later "hardened" to set -e, which would break the fallbacks.

Suggested change
set -o pipefail
set -o pipefail # no `set -e`: the per-source `|| { ... ITEMS='[]'; }` fallbacks must keep the script running

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: Team Review

Development

Successfully merging this pull request may close these issues.

4 participants