134 Commits

Author SHA1 Message Date
Rainer Gerhards
f17ad70f7e
ci: add clang static analyzer workflow via github action (#5981)
This replaces the former clang static analyzer check via buildbot, which needed quite some baby-sitting due to environment constraints. For the next time, run it via github action.

Note that we use the same core script to run the analyzer like we did previously. This means we can also switch back with ease.
2025-08-21 19:10:01 +02:00
Rainer Gerhards
d445a33d6e
Merge pull request #5995 from alorbach/pr-issue-5989
ci: add Fedora 41/42 and Debian 13 dev-base images
2025-08-21 12:54:19 +02:00
Cursor Agent
574ad7c3b4 ci: add Fedora 41/42 and Debian 13 dev-base images
Modernize our dev/CI matrix to match current distro lines and reduce
toolchain drift. This keeps project-provided images aligned with what
contributors run locally and moves us toward “project-supported” bases.

Impact: CI matrix refresh only; no runtime behavior change intended.

Before: CI used Fedora 35/36 and Debian 10/11 dev-base images.
After: CI uses Fedora 41/42 and Debian 11/13 dev-base images.

Update run_checks.yml to use new container tags and pass consistent
configure extras (incl. enabling dtls in relevant jobs). Add Dockerfiles
and helper scripts for debian:13 and fedora:{41,42}. Bump the cached
ZooKeeper tarball to 3.9.3 across legacy images. Debian 13 adds a small
libgcrypt-config wrapper that defers to pkg-config to keep builds working.
Fedora images refresh toolchains (clang18 et al.) and re-sync module flags.
No API/ABI changes; this is build/CI plumbing only.

closes: https://github.com/rsyslog/rsyslog/issues/5989
2025-08-21 12:06:14 +02:00
Rainer Gerhards
4c7d85d04c
Update .github/instructions/modules.plugins.instructions.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-20 10:31:23 +02:00
Rainer Gerhards
a29cbd6d09
ci: add copilot support instruction files
This adds repository-level instructions to guide GitHub Copilot in
producing higher quality and safer pull requests. It is part of the
"AI First" approach, aiming to improve contributor experience and
reduce review friction.

Impact: no change to runtime or user-facing behavior.

The new files under `.github/` provide scoped rules for Copilot across
documentation, plugins, and contrib modules. They emphasize alignment
with AGENTS.md, developer checklists, and module maps. Guardrails cover
quoting, doc structure, config conventions, and mandatory source
citations. The intent is to ensure AI-assisted edits follow existing
rsyslog patterns and remain minimal and test-backed.

These changes are additive only and have no effect on rsyslog code,
APIs, or operational semantics. They prepare the repo for more
consistent AI-assisted contributions.
2025-08-20 10:24:55 +02:00
Rainer Gerhards
97c7c68f5c
docs: streamline contrib templates and commit guidance
This modernizes contributor experience by simplifying PR templates and
removing the lengthy GDPR disclaimer that often discouraged or confused
new contributors. The update encourages more participation and shows how
responsible AI can be used to improve open source workflows.

Impact: none on runtime behavior; contributor workflow improved.

Before: PR template included long GDPR block; commit message rules were
scattered and partly implicit.
After: PR template is concise, GDPR text removed, and commit assistant
usage is documented across README, CONTRIBUTING, and AGENTS.md.

Technical changes include:
- PR template: drop GDPR notice, add commit-assistant references.
- CONTRIBUTING.md: add explicit commit rules and workflow guidance.
- AGENTS.md: require canonical base prompt and commit-first workflow.
- README.md: point to assistant and updated guidance.
- base_prompt.txt: enforce "Findings:" colon format.
- Minor formatting corrections in comments.
2025-08-18 13:59:53 +02:00
Rainer Gerhards
081df56c2c
CI: suppress unneded sphinx output during CI builds
We are interested in errors and warnings. The rest, like progress
indicator, just distracts.
2025-08-14 09:29:49 +02:00
619b5983c7 omazurevenethubs: fix compiler warning
- docker: add libqpid-proton build deps to ubuntu/24.04 base container
- CI: build omazureventhubs in run_checks ubuntu/24.04

closes: https://github.com/rsyslog/rsyslog/issues/5895
2025-08-04 12:43:45 +02:00
Rainer Gerhards
3ddd711ddb
CI: add code style check
Introduce a GitHub Actions workflow that automatically runs
devtools/format-code.sh on every pull request touching source files.
If formatting changes are detected, the check fails and provides clear
instructions for contributors—run the formatter locally and enable
“Allow edits from maintainers” so fixes can be applied.

This prevents code‑style drift and eliminates style‑only update noise.
2025-07-30 12:32:53 +02:00
Rainer Gerhards
6c027f9a8f
CI: Enhance PR validation and update branch name
This patch improves the GitHub Actions PR validation workflow:
- Added comprehensive inline documentation for clarity.
- Corrected branch reference from 'master' to 'main'
  in `tests/CI/PR_validation.sh`.

These changes enhance CI/CD clarity and maintainability.

With support from AI Agents: Gemini
2025-07-22 17:08:06 +02:00
Rainer Gerhards
17963c9c3c
ci: simplify compile check workflow and guarantee exit status
- Consolidate change detection into a single “Check for doc changes” step
- Remove separate determine_changes_type and doc_only_success_check jobs
- Ensure the CI job always returns an exit status (satisfies branch protection)
- Update checkout action version and file‐pattern list for code changes
- Bump copyright year to 2025
2025-07-22 09:06:15 +02:00
Rainer Gerhards
7a6f8f71ad
Merge pull request #5834 from rgerhards/tests-autobuild
testbench: bootstrap build setup for direct test runs
2025-07-20 15:48:02 +02:00
Rainer Gerhards
876c84699b
Add doc build workflow for PRs 2025-07-20 15:31:01 +02:00
Rainer Gerhards
e5791212a2 Add documentation build workflow
Create doc_build.yml for GitHub Actions. The workflow builds
Sphinx docs when *.rst files under doc/ change. It still runs for
other pull requests but exits early so branch protection succeeds
without running make.

AI-Agent: Codex
2025-07-20 08:11:03 +02:00
Rainer Gerhards
179befb2e1 ci: add yamllint workflow for YAML validation
Signed-off-by: Codex <codex@openai.com>
2025-07-19 15:40:11 +02:00
Rainer Gerhards
0ed0710513
testbench: bootstrap build setup for direct test runs
AI tools and newcomers often execute test scripts
without running autoreconf, configure or make. This
causes missing binaries and confusing failures.

The diag.sh stub now self-bootstraps when needed:
- Run autoreconf -fi if configure is missing.
- Run configure with testbench flags if Makefile is
  missing.
- Build tests/tcpflood and tools/rsyslogd via
  make check TESTS="".

This makes tests more robust against improper
environment setup.
2025-07-19 14:15:21 +02:00
Rainer Gerhards
f274d74b38
CI: run code checks only when code files were changed 2025-07-15 14:59:59 +02:00
Rainer Gerhards
6bba692bba
dev doc: add design notes to queue subsystem files 2025-07-12 12:23:46 +02:00
Rainer Gerhards
516dfb0ef4
github: next try 2025-07-11 19:18:49 +02:00
Rainer Gerhards
1f6e94e79e
next try
sorry for the thrash in history, but github has no preview...
2025-07-11 19:16:51 +02:00
Rainer Gerhards
6d405130bd
github: next trx a issue template sort order 2025-07-11 19:15:37 +02:00
Rainer Gerhards
05ce2ce063
github: work-around for issue template display order 2025-07-11 19:12:07 +02:00
Rainer Gerhards
2486f21ac0
github: improve issue template configuration 2025-07-11 18:53:38 +02:00
Rainer Gerhards
cd01660e81 Merge branch 'mytmp' 2025-07-11 18:48:09 +02:00
Rainer Gerhards
76b38072f3
github: move to new issue template system
Most importantly, make use of the great new features.
2025-07-11 18:45:09 +02:00
Rainer Gerhards
5ee3f94775
github: move to new issue template system
Most importantly, make use of the great new features.
2025-07-11 18:29:30 +02:00
Rainer Gerhards
a62f3c72ba
CI: (try to) fix running compile checks only on code file changes
Previously, they never ran. Trying now a more robust method.
2025-06-19 14:22:28 +02:00
dependabot[bot]
011e425528
Bump tj-actions/changed-files from 4 to 46 in /.github/workflows
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 4 to 46.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v4...v46)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: '46'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 12:00:55 +00:00
Rainer Gerhards
6c9ae54ed0
CI: Optimize compile check for doc-only changes
Enhances the 'compile check' GitHub Actions workflow to intelligently
skip resource-intensive compilation when Pull Requests (PRs) only
involve documentation or other non-source code modifications.

This optimization improves CI efficiency and reduces build times for
documentation-only changes, while still enforcing full compilation for
actual code modifications.

Key changes include:
- **Removed `paths-ignore`**: The workflow now always triggers, allowing for granular job control.
- **Introduced `determine_changes_type` job**: This job uses `tj-actions/changed-files` to accurately detect if a PR consists solely of ignored files (e.g., `ChangeLog`, `*.md`, `*.txt`, `doc/**`).
- **Conditional `doc_only_success_check` job**: A lightweight job that runs and passes quickly when only documentation changes are present, satisfying branch protection requirements.
- **Conditional `run` job**: The main compilation job now only executes if actual source code changes are detected, preventing unnecessary builds.

This ensures that all required status checks for branch protection are met,
whether the PR touches code or just documentation.
2025-06-17 13:14:31 +02:00
Rainer Gerhards
2bfef046d5
github: fix issue in automatic labler script 2025-06-10 17:41:55 +02:00
Rainer Gerhards
8997fc1d96
github: add automatic issue labler 2025-06-10 17:02:35 +02:00
Rainer Gerhards
8d03775730 ci: skip expensive workflows on doc-only changes 2025-06-07 19:11:51 +02:00
Rainer Gerhards
ad1fd213a7
imtcp: major multithreading and performance improvements
This commit significantly enhances imtcp by introducing a fully
functional worker thread pool, enabling true multi-threaded
processing for better scalability under high loads. This is
particularly beneficial when using TLS connections.

Notable changes:
- Implemented a complete worker pool for imtcp.
- Introduced the `workerthreads` config parameter for tuning
  concurrency.
- Improved epoll efficiency by enabling edge-triggered mode.
- Added starvation handling via `starvationProtection.maxReads`.
- Refactored session accept logic and optimized network object
  handling.
- Removed an obsolete network driver layer for event notification.
- Fixed multiple issues related to message timing, EPOLLERR
  handling, and tests.
- Improved performance in poll() mode by reducing redundant
  allocations.
- Introduced new CI tests for imtcp without epoll.
- Allowed disabling imtcp tests via a new configure switch.
- Added new impstats counters for worker thread pool statistics.

Details:
- The worker pool replaces an outdated experimental
  implementation.
- If `workerthreads=1`, no worker pool is created to minimize
  context switches.
- Moves worker pool variables inside `tcpsrv` instance to
  prevent conflicts.
- Extracts session `accept()` logic into a dedicated function
  for clarity.
- Fixes message ordering inconsistencies in multi-threaded
  scenarios.
- Properly handles `EPOLLERR` notifications to improve error
  resilience.
- Optimizes poll() mode by avoiding unnecessary reallocation
  of file descriptors.
- Replaces the old network driver layer for event notification
  with a streamlined solution.
  - Now uses **conditional compilation** to select the best
    method (epoll or poll) at build time.
  - This significantly reduces code complexity, improves
    maintainability, and boosts performance.
- The previous "thread pool" was a rough experiment that did
  not perform significantly better than single-threaded mode.
  - The **new implementation** allows multiple worker threads
    on platforms with `epoll`.
  - On non-epoll systems, an optimized **poll() based
    single-threaded approach** is used, which is expected to
    perform better than the old "thread pool."
- Adds `pthread_setname_np` only when available to improve
  portability.
- Fixes test cases that assumed strict message timing, which
  was unreliable.
- Reduces test parallelism for TSAN CI runs to prevent
  resource exhaustion.
- Moves a test case to `imdiag` to ensure stable execution.
- Provides a new CI environment to verify `imtcp` behavior
  without epoll.
- Introduces `--enable-imtcp-tests` configure switch for test
  flexibility.
- Improves debug logging and adds better error handling for
  worker pool startup.

New configuration parameters:
- `workerthreads`: Defines the number of worker threads for
  imtcp. If set to 1, no worker pool is created.
- `starvationProtection.maxReads`: Defines the maximum number
  of consecutive reads a worker can perform before being
  interrupted to allow other sessions to be processed.

New impstats counters (emitted only when `workerthreads > 1`):
- `runs`: Number of times the worker thread has been invoked.
- `read`: Number of read calls performed by the worker.
  For TLS, this includes read/write calls.
- `accept`: Number of `accept()` calls handled by the worker.
- `starvation_protect`: Number of times a socket was sent
  back to the queue due to reaching the maximum number of
  consecutive requests, ensuring fair scheduling of sessions.

These changes significantly enhance rsyslog’s TCP handling
performance and stability, particularly in high-volume
environments.

Closes #5529, #5532, #5578, #5580.
2025-03-01 14:01:20 +01:00
Rainer Gerhards
d22cb00690
CI: reduce parallel test runs
We are seeing an increasing number of flaky tests with hard-to-explain
failure conditions. Upon analysis it looks like this primarily stems
back to overloaded CI VMs. This can be the case because we have
performance enhanced rsyslog of the past month, which means the VMs
have higher load (due to better parallel processing) at the same time.
This is especially the case with CPU intense checks like TSAN.

In order to address this, we reduce the number of parallel tests.
2025-02-25 13:12:14 +01:00
Rainer Gerhards
abf9b278b1
CI: update github CI runners to use ubuntu-latest image
this should make no difference as we use mostly containers
2025-02-16 14:43:37 +01:00
Rainer Gerhards
9b20f8cc71
CI: add compile check with atomic operations disabled
The platforms that do not have support for atomic operations become
more and more exoctic. Even more so, only Solaris builders now test
that inside the rsyslog CI. To "harden" the CI system against a
potential (temporary) unavailability of Solaris, we now also do
a build where we intentionally disable atomics. This will trigger
build issues on all platforms. This method also permits us to detect
problems quicker, as the solaris builders are slow.
2025-02-13 16:00:25 +01:00
Rainer Gerhards
fc90257ae3
CI: add Testruns under Ubuntu 24.04
Note: we temporarily disable omamqp1 testing while we search for
the missing dependency.

We also add a special setting that permits us to control if
known-(very)-flaky test shall be run.

closes https://github.com/rsyslog/rsyslog/issues/5546
2025-02-11 16:53:36 +01:00
Rainer Gerhards
08501b930f
CI: add check for compile with -std=gnu23 gcc option
Note: The upcoming gnu23 C standard is overdoing it with type-safety. Inside
rsyslog, we historically have method tables for generic calls, which
keeps the code small and easy to understand. This would not decently be
possible with the new type-safety requirements.

So this commit works around these warning in a way that pretends to
provide more type safety. We have done this in the least intrusive
way to reduce the risk for regressions in code that works well in
since decades. Also note that the code already does parameter
validation.

There would have been more elaborate ways to make gnu23 compile happy,
e.g. by using a union of structs to provide the data element. Some folks
consider this type safe. In reality, it is not a bit better than
traditional C without types at all. Because the caller still needs to
ensure it picks the right struct from the union. As this approach
would also have larger regeression potential, we have not used it.

Right now, we have suppressed some of the new warnings, as working
around them would have required an even larger time budget and
potentially larger regression potential. In the long term we may
want to look into enabling them, as they would potentially be
beneficial for new code not involving method tables.

Some nits, however, were detected and have been fixed.

This patch also "fixes" some false positive test failures, mostly
be disabling some test functionality after confirmation these are
flakes.

see also https://github.com/rsyslog/rsyslog/issues/5507
2024-12-31 10:29:00 +01:00
Rainer Gerhards
6666394e60
CI: remove libgrok-related codeql checks
libgrok1 seems to be no longer avaiblabe under Ubuntu 24.04, which now
is being used for running codeql.
2024-12-31 09:56:14 +01:00
Rainer Gerhards
cd329c3232
CI: user newer OS versions in CI workflow
also bump default development container to Ubuntu 24.04

This commit also contains some nitfixes that were detected
by the newer CI components. If it is just nitfixes, we do not
create separate commits for them.
2024-11-23 11:09:25 +01:00
679b0b038c Initial implementation of imdtls and omdtls modules
- Extracted basic OpenSSL helper functions into own module net_ossl.h/net_ossl.c
  Both are compiled into lmnsd_ossl.
- Cleanup of OpenSSL code, fixed minor compiler and linking issues.
- Added DTLS Sender option DTLS into tcpflood for testbench.
- Add initial implementation of imdtls input module. Added to configure and makefile
- Add initial implementation of omdtls output module. Added to configure and makefile
- Add multiple basic tests for imdtls receiving data by using tcpflood.
- Add multiple send-receive test for imdtls and omdtls based on existing tls tests.
- Add timeout and sessionbreak tests for imdtls stress testing.

closes: https://github.com/rsyslog/rsyslog/issues/5211
2024-02-23 13:44:05 +01:00
Rainer Gerhards
df972bd6d7
CI: fix and cleaup github workflow 2023-08-02 09:10:21 +02:00
alakatos
4abe60f526 imjournal: Add FileCreateMode module parameter
FileCreateMode allows to set the default file mode bits
when creating new files. As of now, it has only impact on the state file.
Add test suite as well.

Minor indentation fix in run_journal.yml
2023-06-08 12:18:02 +02:00
Rainer Gerhards
79ddbe1c65
CI: update base ubuntu image for github actions
This is just the "host" for containers, so no big deal. Looks like
Ubuntu 18.04 is no longer supported by github, at least all actions
hang in "queued" status without proceeding.
2023-05-24 10:30:06 +02:00
Rainer Gerhards
f8798ad944
CI/QA: do compile test both with NDEBUG set/unset
Default behaviour does not check all code. This made us not detect
some compile time problem in the past.
2023-01-27 12:44:57 +01:00
Rainer Gerhards
31a46e35d1
CI: fix github CodeQL settings
removing invalid and not really needed stuff
2023-01-19 15:13:25 +01:00
LGTM Migrator
8fde95fbcf
Add CodeQL workflow for GitHub code scanning 2022-12-08 16:52:39 +00:00
Rainer Gerhards
90feae08e6
omfile: support for zstd compression
The zstd library provides better and faster compression than zlib.
This patch integrates zstd as a dynamically-loadable functionality.
As such, no further dependencies need to be added to the rsyslog
base package.

Due to the increased performance, usage of zstd is highly recommended
for high-volume use cases.

This patch also refactor zlib compression in order to unify handling
in both compression cases.
2022-07-13 14:31:51 +02:00
Rainer Gerhards
393ea2405f
CI: further modernizations
- drop Fedora 34, add Fedora 36
2022-07-05 13:22:07 +02:00
Rainer Gerhards
829a6f6a64
CI: improve use of github action matrix feature; optimization
Matrix feature was initially barely usable because github did not permit
to restart just failed jobs. This has changed. So we now migrate back to
the use of matrix feature where it is useful.

We also reduce the number of plain compile tests to newest and oldest
compiler version only. This saves CI ressources. The important other
ones (distro default!) are used during other CI tests anyways.

We also fix some minor coding errors detected by new compiler builds.
None of them seems to be related to any real issues.
2022-07-01 10:12:38 +02:00