Skip to content

Compare warning bodies and automatically update stale comment links - #28

Closed
yaito3014 wants to merge 11 commits into
mainfrom
compare-warning-bodies
Closed

yaito3014 wants to merge 11 commits into
mainfrom
compare-warning-bodies

Conversation

@yaito3014

Copy link
Copy Markdown
Member

fixes #24

No behavior change. The create/replace/skip choice now lives in
action/src/comment.ts so it can be unit-tested with node --test.
When neither the new build nor the previous bot comment has a warning,
the bot used to stay silent, leaving the old comment pointing at a
stale run. It now edits that comment in place with the fresh table, so
the links always jump to the latest run while still not notifying
anyone.

Fixes #24
An object literal with only an id has no property in common with
CommentLike, so tsc rejected it (TS2559). Neither the Rollup build nor
node --test type-checks the test file, which is why it went unnoticed.
The check used to search the entire comment HTML for "warning", which
every link URL matches when the repository name contains that word (as
iris-cpp/cpp-warning-notifier does), so the bot always posted a new
comment. The status strings are now shared with the renderer and only
the link text inside status cells is compared against the warning one.
Recognises the GCC/Clang and MSVC line formats, strips the Actions
timestamp and the runner workspace prefix, and falls back to a
file-less diagnostic for any other line the previous line-based
detection would have counted. Not wired in yet.
A cell's warnings are identified by the multiset of (file, flag,
message); line and column are ignored so that unrelated edits above a
warning do not count as a change. The digest of that multiset, with the
cell's environment and status, is embedded in the comment as a
machine-readable HTML comment block so the next run can compare
without re-reading expired logs. Not wired in yet.
The script now parses all diagnostics of a job instead of grepping for
the first one, keeps them on the cell, and renders the comment through
a tested module: the table as before, a collapsed list of warnings per
environment, and the machine-readable block. Status and link anchor
are derived from the same diagnostics, so they are unchanged. The
decision still looks only at statuses; the next commit uses the block.
When the previous bot comment carries a block, the per-cell statuses
and warning digests are compared with the current build. Identical
means the comment is edited in place (links refreshed), even when
warnings exist. Any difference involving a warning on either side
minimizes the old comment and posts a new one. A previous comment
without a block falls back to its status cells once.

Refs #24
@cppwarningnotifier

This comment has been minimized.

One <details> whose summary gives the total count and the number of
environments, with the warnings grouped per environment as nested
lists inside, instead of one collapsed section per environment.
@cppwarningnotifier

This comment has been minimized.

@cppwarningnotifier

Copy link
Copy Markdown
EnvironmentC++20C++23C++26
ubuntu24.04GNU13Debug⚠️warning⚠️warning⚠️warning
Release⚠️warning⚠️warning⚠️warning
LLVM20Debug⚠️warning⚠️warning⚠️warning
Release⚠️warning⚠️warning⚠️warning
48 warnings in 12 environments
  • ubuntu 24.04 GNU 13 Debug C++20 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 GNU 13 Debug C++23 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 GNU 13 Debug C++26 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 GNU 13 Release C++20 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 GNU 13 Release C++23 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 GNU 13 Release C++26 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 LLVM 20 Debug C++20 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 LLVM 20 Debug C++23 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 LLVM 20 Debug C++26 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 LLVM 20 Release C++20 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 LLVM 20 Release C++23 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]
  • ubuntu 24.04 LLVM 20 Release C++26 (4 warnings)
    • test/source.cpp:3 #warning before C++23 is a GCC extension
    • test/source.cpp:3 #warning "WARNING!!!!" [-Wcpp]
    • test/source.cpp:9 ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    • test/source.cpp:8 unused variable ‘unused_variable’ [-Wunused-variable]

@yaito3014

Copy link
Copy Markdown
Member Author

Discussed on private; agreed that we should keep single live comment and always overwrite it.

@yaito3014 yaito3014 closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Existing comment's links should be automatically updated by the bot

1 participant