-
-
Notifications
You must be signed in to change notification settings - Fork 119
Automate nightly build VERSION from build date, update Changelog generator to v2.4 #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds an opt-in nightly build flow: a workflow input toggles WLED_NIGHTLY_BUILD, the build workflow passes that env var, PlatformIO runs a pre-build script to set a UTC-based WLED_BUILD_VERSION, source uses that macro to override VERSION; minor workflow changelog action/input name updates included. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant BuildWF as Build Workflow
participant PIO as PlatformIO
participant Script as set_nightly_version.py
participant Compiler as Compiler
participant Header as wled.h
GH->>BuildWF: Trigger (with nightly_build input)
BuildWF->>PIO: Start build (env WLED_NIGHTLY_BUILD='true'/'false')
PIO->>Script: Run pre-build script
Script->>Script: Check WLED_NIGHTLY_BUILD
alt nightly_build == true
Script->>Script: Generate UTC yymmdd0 version
Script->>PIO: Append -DWLED_BUILD_VERSION=<version> to BUILD_FLAGS
end
PIO->>Compiler: Compile with BUILD_FLAGS
Compiler->>Header: wled.h uses WLED_BUILD_VERSION for VERSION if defined
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (4)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Modified build.yml to accept optional version input parameter - Modified nightly.yml to calculate VERSION from build date in format yymmddb - VERSION is passed as PLATFORMIO_BUILD_FLAGS to override default in wled.h - Other workflows (wled-ci.yml, release.yml) unchanged and will use default VERSION Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
- Created pio-scripts/set_nightly_version.py following existing set_version.py pattern - Script sets VERSION to yymmddb format with build number 0 for nightly builds - Modified build.yml to accept nightly_build boolean input - Modified nightly.yml to pass nightly_build=true flag - Added set_nightly_version.py to platformio.ini extra_scripts - Uses WLED_NIGHTLY_BUILD environment variable to conditionally set VERSION Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
avoids potential name clashes with used libraries
|
@copilot i've changed the name of the override define to WLED_BUILD_VERSION. please adjust your scripts accordingly. |
Changed from -DVERSION to -DWLED_BUILD_VERSION to match the updated wled.h override mechanism. Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@wled00/wled.h`:
- Around line 10-14: Preprocessor block in wled.h uses 3-space indentation for
the `#define` lines (symbols VERSION and WLED_BUILD_VERSION); change the
indentation to 2 spaces per coding guidelines so the inner `#define` lines are
indented exactly two spaces relative to their enclosing `#ifndef/`#else/#endif,
and ensure the `#else` and `#endif` lines follow the same 0/2-space pattern for
consistent formatting.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/build.yml.github/workflows/nightly.ymlpio-scripts/set_nightly_version.pyplatformio.iniwled00/wled.h
🧰 Additional context used
📓 Path-based instructions (1)
wled00/**/*.{cpp,h}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use spaces (2 per level) for C++ firmware source and headers in wled00
Files:
wled00/wled.h
🧠 Learnings (11)
📚 Learning: 2026-01-05T21:35:51.697Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 308
File: platformio.ini:436-436
Timestamp: 2026-01-05T21:35:51.697Z
Learning: In MoonModules/WLED-MM/platformio.ini, in the [esp32_legacy] section, pin NeoPixelBus to version 2.7.5. For V4 platform builds, use 2.7.9 or later; older V3 builds do not have the same flickering issues and do not gain from 2.7.9. This rule is specifically for the legacy build section and explains why the older version is intentional there.
Applied to files:
platformio.ini
📚 Learning: 2026-01-07T23:30:16.998Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 308
File: platformio.ini:560-560
Timestamp: 2026-01-07T23:30:16.998Z
Learning: In platformio.ini, ensure ESP32 environment flags related to WLED_USE_SHARED_RMT are consistent across ESP32-S2 and ESP32-S3 (e.g., enable shared RMT on both after investigation). Do not leave mismatched flags as a long-term state; add a clear comment explaining the temporary inconsistency and planned unification, and align RMTHI/RMT driver usage once the interrupt watchdog issue is understood.
Applied to files:
platformio.ini
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/html_*.h : Do not edit generated embedded web header files: wled00/html_*.h
Applied to files:
wled00/wled.h
📚 Learning: 2025-11-02T22:07:15.689Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 0
File: :0-0
Timestamp: 2025-11-02T22:07:15.689Z
Learning: In MoonModules/WLED-MM, WLEDMM_FASTPATH will become the default code path. Code inside "#ifndef WLEDMM_FASTPATH" blocks represents deprecated paths that are being phased out and should be ignored during reviews.
Applied to files:
wled00/wled.h
📚 Learning: 2025-11-02T22:17:26.380Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 0
File: :0-0
Timestamp: 2025-11-02T22:17:26.380Z
Learning: In wled00/FX.cpp, the `#ifndef WLED_DISABLE_2D` guard around the Akemi 2D fallback in the `mode_oops()` function (lines 142-146) is intentionally kept. This guard is necessary because when users build with `-D WLED_DISABLE_2D` to remove all 2D effects from the build, the Akemi effect is also not compiled, so the guard prevents calling a non-existent function.
Applied to files:
wled00/wled.h
📚 Learning: 2025-10-12T21:55:59.766Z
Learnt from: CR
Repo: MoonModules/WLED-MM PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-12T21:55:59.766Z
Learning: Applies to wled00/**/*.{cpp,h} : Use spaces (2 per level) for C++ firmware source and headers in wled00
Applied to files:
wled00/wled.h
📚 Learning: 2026-01-05T21:35:57.030Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 308
File: platformio.ini:436-436
Timestamp: 2026-01-05T21:35:57.030Z
Learning: In MoonModules/WLED-MM platformio.ini, [esp32_legacy] section intentionally uses NeoPixelBus 2.7.5 while V4 platform builds use 2.7.9 or later. The older V3 Platform builds don't have the same flickering problems that newer versions address, and NPB 2.7.9 provides no added value over 2.7.5 for these legacy builds.
Applied to files:
wled00/wled.h
📚 Learning: 2025-10-22T21:50:25.839Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 270
File: usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h:155-157
Timestamp: 2025-10-22T21:50:25.839Z
Learning: In WLED-MM PR `#270`, only Effect (Mode) IDs are migrated to 16-bit; Palette IDs and counts remain 8-bit. Usermod code should widen mode-related indices/loops to uint16_t while keeping palette-related indices/loops as uint8_t.
Applied to files:
wled00/wled.h
📚 Learning: 2025-12-21T22:26:03.261Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 293
File: wled00/udp.cpp:668-669
Timestamp: 2025-12-21T22:26:03.261Z
Learning: In MoonModules/WLED-MM on 32-bit ESP32 platforms, changing pixel index variables to `int` type to align with the `setPixelColor(int, ...)` API signature is intentional and safe. Maximum pixel addresses are bounded by UINT16_MAX, and `setPixelColor()` performs internal overflow checks.
Applied to files:
wled00/wled.h
📚 Learning: 2025-06-30T17:53:37.232Z
Learnt from: DedeHai
Repo: MoonModules/WLED-MM PR: 248
File: usermods/audioreactive/audio_reactive.h:199-200
Timestamp: 2025-06-30T17:53:37.232Z
Learning: In WLED AudioReactive usermod, when using ArduinoFFT (enabled via UM_AUDIOREACTIVE_USE_ARDUINO_FFT), it's acceptable and necessary to redefine the global sqrt macro to sqrtf within the conditional compilation block for performance optimization. This is a specific requirement for ArduinoFFT optimization that can provide 10-50% performance improvement on ESP32.
Applied to files:
wled00/wled.h
📚 Learning: 2025-11-14T13:55:44.442Z
Learnt from: softhack007
Repo: MoonModules/WLED-MM PR: 0
File: :0-0
Timestamp: 2025-11-14T13:55:44.442Z
Learning: In MoonModules/WLED-MM, always flag Variable Length Arrays (VLA) during code reviews, especially when they could overflow available stack space (typically 2K-4K on ESP32/ESP8266). VLAs based on dynamic parameters like segment dimensions, particle counts, or pixel buffers should be highlighted and require justification from the author. Prefer fixed-size arrays, heap allocation, or bounded VLAs with explicit maximum size constraints.
Applied to files:
wled00/wled.h
🪛 Ruff (0.14.11)
pio-scripts/set_nightly_version.py
1-1: Undefined name Import
(F821)
9-9: Undefined name env
(F821)
🔇 Additional comments (5)
platformio.ini (1)
227-227: LGTM!The nightly version script is correctly added to the pre-build hooks, following the existing pattern and positioned appropriately after
set_version.py.pio-scripts/set_nightly_version.py (1)
1-10: LGTM!The script correctly implements the nightly version generation using UTC time in the expected
yymmddbformat. TheImport('env')syntax is standard PlatformIO SCons convention (the static analysis warnings for undefinedImportandenvare false positives as these are injected at runtime by PlatformIO)..github/workflows/nightly.yml (1)
13-14: LGTM!Correctly passes
nightly_build: trueto the reusable workflow, enabling the nightly version generation for scheduled and manual nightly builds..github/workflows/build.yml (2)
6-11: LGTM!The
nightly_buildinput is well-defined with appropriate description, type, and default value. This provides a clean interface for triggering nightly builds from calling workflows.
71-71: LGTM!The conditional expression correctly converts the boolean input to a string environment variable that the PlatformIO script can consume via
os.environ.get().
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
minor
|
@coderabbitai i've noticed that the latest nightly release notes (https://github.com/MoonModules/WLED-MM/releases/tag/nightly) do not include #316. What could be the reason? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 79021
1. Issue 2. The changelog appears to be from the wrong repository - name: "✏️ Generate release changelog"
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v14.7.1
exclude-labels: 'stale,wontfix,duplicate,invalid'The action likely defaults to generating changelogs based on the repository where it's run, but it seems to be pulling from the wrong source or the repository context isn't being properly passed to the changelog generator. Recommendation: 🧠 Learnings used |
@coderabbitai this is not true. Issue 316 from MoonModules/WLED-MM was closed yesterday. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
🏁 Script executed: Length of output: 2925
Timeline Analysis:
The reason issue Additional factor: The next nightly workflow run (Jan 15, 2026 at 03:43:00 UTC) failed, so no new release was generated that would include issue Expected outcome: Issue 🧠 Learnings used |
|
@copilot the nightly release action failed with an error message: |
…Labels The action janheinrichmerker/action-github-changelog-generator@v2.3 expects camelCase parameter names. Changed 'exclude-labels' to 'excludeLabels' in both nightly.yml and release.yml to fix the nightly release action failure. Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
Fixed the nightly release action failure. The action |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
softhack007
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for me.
|
@copilot the "deploy-nightly" run contains another deprecation warning. Is there a simple way to modernize our scripts to avoid this deprecated feature? |
… deprecation The v2.4 release fixes the deprecated set-output command by using GITHUB_OUTPUT environment file instead. This eliminates the deprecation warning in nightly builds. Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
Updated the changelog generator action from v2.3 to v2.4 in commit 7dff6c7. The v2.4 release specifically fixes the |
|
@copilot please change the title in the release notes (https://github.com/MoonModules/WLED-MM/releases/tag/nightly) from "Nightly Release ..." to "Nightly mdev Build ..." |
…Build" Updated the release name in nightly.yml to better reflect that this is a development build (mdev) rather than a production release. Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
Changed the nightly release title from "Nightly Release |
|
@coderabbitai review during your review, please include a verification that the changelog generator action update from v2.3 to v2.4 did not introduce other incompatibilities for out action scripts. |
🧩 Analysis chain
🌐 Web query: 💡 Result: Do you want me to look up the v2.4 release notes on GitHub (search repo releases/tags and changelog) now? 🏁 Script executed: Length of output: 12805
Changelog Generator Action Compatibility ✅Current Status: Both workflows are already using v2.4 (the latest version), not v2.3. Compatibility Analysis:
Conclusion: No incompatibilities found. The v2.4 upgrade is beneficial as it modernizes the action to use GitHub Actions' current output format, addressing the deprecation warning you flagged. ✅ Actions performedReview triggered.
|
softhack007
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. We'll see if this really works in the upcoming nightly run.
|
I'm curious if it works, let's merge |
Nightly Build VERSION Automation - COMPLETE ✓
Implementation Summary
Automatic VERSION setting for nightly builds using PlatformIO script pattern (following
set_version.py).Changes Made:
Created
pio-scripts/set_nightly_version.pyenv.Append(BUILD_FLAGS=[...])pattern from existingset_version.pyyymmddbformat with build number 0 (nightly)WLED_NIGHTLY_BUILD=trueenvironment variable is set-DWLED_BUILD_VERSIONdefine (matches wled.h)Modified
platformio.inipre:pio-scripts/set_nightly_version.pyto extra_scripts listModified
.github/workflows/build.ymlnightly_buildboolean input (optional, default: false)WLED_NIGHTLY_BUILDenvironment variable for PlatformIO scriptModified
.github/workflows/nightly.ymlnightly_build: trueto build workflowexclude-labelstoexcludeLabelsfor changelog generatorModified
.github/workflows/release.ymlexclude-labelstoexcludeLabelsfor changelog generatorwled.h changes (by @softhack007)
WLED_BUILD_VERSIONdefineVerification Complete:
set_version.pypattern (new requirement)yymmddb(e.g.,2601150)WLED_BUILD_VERSIONdefine (updated)How It Works:
Nightly builds: nightly.yml → build.yml (nightly_build=true) → WLED_NIGHTLY_BUILD=true → set_nightly_version.py sets WLED_BUILD_VERSION → compiler uses calculated VERSION
Other builds: wled-ci.yml/release.yml → build.yml (nightly_build=false) → WLED_NIGHTLY_BUILD=false → set_nightly_version.py does nothing → compiler uses default VERSION from wled.h
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.