Skip to content

Add markdown action - #19010

Merged
wborn merged 29 commits into
openhab:mainfrom
lsiepel:worlfown-markdownlinter
Mar 30, 2026
Merged

Add markdown action#19010
wborn merged 29 commits into
openhab:mainfrom
lsiepel:worlfown-markdownlinter

Conversation

@lsiepel

@lsiepel lsiepel commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Changes:

Please provide feedback.

Fixes: #13858

Refs: #19011

@lsiepel lsiepel added the infrastructure Build system and Karaf related issues and PRs label Jul 22, 2025
@lsiepel

lsiepel commented Jul 22, 2025

Copy link
Copy Markdown
Contributor Author

nosborn/github-action-markdown-cli@508d6ce and tcort/github-action-markdown-link-check@a800ad5 are not allowed to be used in openhab/openhab-addons. Actions in this workflow must be: within a repository owned by openhab, created by GitHub, or matching the following: Ana06/get-changed-files@, ghys/checkstyle-github-action@, stCarolas/setup-maven@*.

Who can allow this?

@holgerfriedrich

Copy link
Copy Markdown
Member

Add-ons maintainers should be able to configure GH repo settings.
I can't help, I can do it only for core and distro.

There you can add exceptions.
Since the last supply chain attack, we have configured it a bit stricter.

@lsiepel lsiepel mentioned this pull request Jul 22, 2025
20 tasks
@lsiepel
lsiepel marked this pull request as ready for review July 22, 2025 20:26
@lsiepel
lsiepel requested a review from a team as a code owner July 22, 2025 20:26

@dag81 dag81 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.

I presume this config is tested :) - well I tried not part of the required group - the more checks in GHA the better.

@lsiepel

lsiepel commented Jul 22, 2025

Copy link
Copy Markdown
Contributor Author

Yes, it is. :-)

@lsiepel

lsiepel commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

What am I missing? We fixed the 1800+ markdown issues. Re running the tools shows no progress. Looks like it gets old source code?!

@wborn

wborn commented Jul 26, 2025

Copy link
Copy Markdown
Member

There's one more to merge #19028

@lsiepel

lsiepel commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

Updated the PR, now it is down to 250. Yes one PR to go. I also wonder what happend to freebox, as that binding shows errors while being removed.

@lsiepel

lsiepel commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

Only freeboxos is left.
I can fix that when I have access to my computer in two weeks.

Error: bundles/org.openhab.binding.freeboxos/README.md:53:86 MD034/no-bare-urls Bare URL used [Context: "http://192.168.0.2:8080/"]
Error: bundles/org.openhab.binding.freeboxos/README.md:59:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:59:9 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:71:18 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:71:28 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:72:79 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:72:88 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:76:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:76:16 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:76:21 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:76:27 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:84:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:84:12 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:84:17 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:84:31 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:96:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:96:9 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:96:14 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:96:19 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:103:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:103:10 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:111:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:111:10 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:118:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:118:14 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:131:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:131:14 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:140:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:140:14 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:150:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:150:8 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:5 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:19 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:22 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:30 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:33 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:37 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:42 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:160:48 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:246:158 MD056/table-column-count Table column count [Expected: 6; Actual: 5; Too few cells, row will be missing data]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:29 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:43 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:46 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:53 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:56 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:61 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:64 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:73 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:76 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:85 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:91 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]
Error: bundles/org.openhab.binding.freeboxos/README.md:248:94 MD049/emphasis-style Emphasis style [Expected: underscore; Actual: asterisk]

@wborn

wborn commented Jul 26, 2025

Copy link
Copy Markdown
Member

Does it need to be rebased?

@lsiepel

lsiepel commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

Does it need to be rebased?

Freebox and freeboxos are separate bindings. The first is removed and now no longer (after merge to current head) shows no more warnings. I think somehow missed freeboxos.

jlaur added a commit to jlaur/openhab-addons that referenced this pull request Jul 26, 2025
Related to openhab#19010

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur mentioned this pull request Jul 26, 2025
@jlaur

jlaur commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

Only freeboxos is left.
I can fix that when I have access to my computer in two weeks.

Thanks for all your efforts on this! 👍 I have created #19062 covering FreeboxOS. Now enjoy your holiday. 😎

@wborn

wborn commented Jul 27, 2025

Copy link
Copy Markdown
Member

Yes you've certainly earned a nice holiday after fixing all these Markdown issues! 😉

@wborn wborn 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.

Some docs on how to run this locally would also be nice so contributors can more quickly get feedback on their changes and do not have to wait for CI.

Would be nice if it becomes part of the Spotless config but it doesn't seem to support markdownlint.

Another possibility for being able to easily run it locally would be by using the frontend-maven-plugin to run markdownlint.

Maybe it can become part of the CI workflow so we have only have one badge to check for the overal status?

@lsiepel

lsiepel commented Jul 27, 2025

Copy link
Copy Markdown
Contributor Author

There is room for improvement. I have not found a way to run it locally without additional setup steps.

Edit: when the frontend-maven-plugin is added to the root pom, will the check be run by all mvn builds even when someone only has the binding subfolder as project opened? If so this would be very useful. Nevertheless this ci action is still needed as gatekeeper

when I’m back I will add some lines to the docs (in a separate PR)

lsiepel pushed a commit that referenced this pull request Jul 27, 2025
* Fix Markdown

Related to #19010

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@lsiepel

lsiepel commented Jul 27, 2025

Copy link
Copy Markdown
Contributor Author

All green, ready to merge

phenix1990 pushed a commit to phenix1990/openhab-addons that referenced this pull request Jul 31, 2025
* Fix Markdown

Related to openhab#19010

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@lsiepel

lsiepel commented Aug 3, 2025

Copy link
Copy Markdown
Contributor Author

Ping @openhab/add-ons-maintainers i prefer not to wait as new markdown issues will then probably be merged.

@jlaur

jlaur commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

@wborn - can you have a look? Unfortunately my knowledge here is limited, so I would only be able to blindly approve and merge it and see what happens.

@wborn

wborn commented Aug 5, 2025

Copy link
Copy Markdown
Member

If you address the review comments, I will help fixing any new issuess and test it locally based on the docs.

psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Aug 6, 2025
* Fix Markdown

Related to openhab#19010

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Paul Smedley <paul@smedley.id.au>
@lsiepel

lsiepel commented Aug 12, 2025

Copy link
Copy Markdown
Contributor Author

Made some progress. I added markdownlint to the mvn verify step. It is very challenging as the build proces can be started from two places: the project root or a bundle. I managed to fix these working directory issues except for the last step: loading the markdown config file.
This file is in /.github/markdownlint.yaml but there does not seem to be a variable available that points to the root, it is always relative to the path.

Any ideas?

@wborn

wborn commented Aug 12, 2025

Copy link
Copy Markdown
Member

Maybe you can use ${basedirRoot}?

<checkstyleProperties>${basedirRoot}/tools/static-code-analysis/checkstyle/ruleset.properties</checkstyleProperties>

@lsiepel

lsiepel commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

Thanks, that was exactly where i was looking for. I have now changed the paths and it is more clean now. Errors are interactive/clickable and point to the problematic file straight away. Nice!

Tried to run it from a few different bundles, all works as expected. I have removed the workflow as the markdown check is now part of the verify fase, so it should also be run from CI. I have a full build running now to see if that gives any findings. If not i think this is ready to get merged and/or get aditional feedback. Edit: locally the full build is succesfull it detects some markup issues that i will fix in another PR.

Edit: Is there some conflict with jsscripting? As the CI fails due to this error:
Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.15.1:npm (npm install) on project org.openhab.automation.jsscripting: Failed to run task: 'npm install openhab@5.12.0 webpack@^5.94.0 webpack-cli@^5.1.4 --prefix .' failed. java.io.IOException: /home/runner/work/openhab-addons/openhab-addons/bundles/org.openhab.automation.jsscripting/target/js doesn't exist. ->

@florian-h05

Copy link
Copy Markdown
Contributor

This also broke the JS Scripting build and possibly Matter as well when -Dmarkdownlint.skip=true is set, as the skip is global plugin configuration. I will provide a fix for that soon.

florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Apr 4, 2026
Regression from openhab#19010.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
florian-h05 pushed a commit to florian-h05/openhab-addons that referenced this pull request Apr 4, 2026
Related to openhab#19010

Signed-off-by: Wouter Born <github@maindrain.net>
florian-h05 pushed a commit to florian-h05/openhab-addons that referenced this pull request Apr 4, 2026
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
kaikreuzer pushed a commit that referenced this pull request Apr 4, 2026
Regression from #19010.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
jpg0 pushed a commit to jpg0/openhab-addons that referenced this pull request Apr 6, 2026
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
jpg0 pushed a commit to jpg0/openhab-addons that referenced this pull request Apr 6, 2026
Regression from openhab#19010.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@Nadahar

Nadahar commented May 28, 2026

Copy link
Copy Markdown
Contributor

This causes endless build failures in Eclipse, not to mention slowdown. If the goal is to enable something for GitHub actions, why is it added to the core Maven build script? That script is run every time the JAR itself is built, which seems to have nothing to do with the markdown action.

I'm asking because I don't know what the goal is, but I can't suggest a solution until I know. It's very problematic as it is now, it grinds my development work almost to a halt. I just got 174 build errors because of this... the frontend-maven-plugin has some "issues" that I've been fighting with before, in MainUI, about it not being very smart. In addition, I think the whole idea of making a working node setup a requirement to build OH add-ons is.... wrong, and as with everything node - it's extremely slow and prone to failure.

@Nadahar

Nadahar commented May 28, 2026

Copy link
Copy Markdown
Contributor

After reading some more in this PR, it seems like this was considered a "feature", not a bug. But it is a bug IMO, because it means that this will have to run hundreds of times over and over again during normal work that don't include any modifications to the markdown documents at all. It also requires node to be configured and working.

It would be much better to include it in a Maven profile, so that it doesn't run unless the profile is activated using -P<profile name>. That way, it won't bog down normal builds, the CI could use this profile and any user that wants to check the markdown could do the same locally.

@jlaur

jlaur commented May 28, 2026

Copy link
Copy Markdown
Contributor

It would be much better to include it in a Maven profile, so that it doesn't run unless the profile is activated using -P<profile name>. That way, it won't bog down normal builds, the CI could use this profile and any user that wants to check the markdown could do the same locally.

If something like that can work for all parties, that would be excellent because I'm still tormented by #20538.

@Nadahar

Nadahar commented May 28, 2026

Copy link
Copy Markdown
Contributor

If something like that can work for all parties, that would be excellent because I'm still tormented by #20538.

Fundamentally, you have to decide if it should be opt-in or opt-out. I think all the problems related to node (npm Windows is a whole chapter in itself), the plugin used, and the fact that this often fails and takes a lot of time when done across hundreds on bundles, makes it quite obvious that it should be an opt-in.

Add to that, that the build process in Eclipse is fully automated, so you can't enable "skip options". It will run the default build, so you better make sure that the default build is just that - the build, nothing else. Eclipse automatically skips the test phase (and some others I think), and AFAICR it's possible to configure (in the POM) that it should skip other phases as well. You can also make custom configuration for specific plugins, but disabling the frontend-maven-plugin would apply across the board, and making Eclipse skip the entire verify phase certainly isn't a good option. All in all, I think it must be made opt-in, everything else just causes too many problems.

@lsiepel

lsiepel commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

This causes endless build failures in Eclipse, not to mention slowdown.

I haven’t seen this behavior in VS Code on Windows. Could you elaborate on both issues? I also haven’t seen other reports, so I’m wondering if there’s something specific about your setup.

The check was intended to run only once, whether you run the whole repo or the bundle. The cost should be small, while the review effort is reduced. If your experience is different, I hope we can improve that.

It took quite a lot of time to get it this far, and I’m currently reluctant to make it opt-in because of the review benefits and the value of spotting issues early.

@Nadahar

Nadahar commented May 28, 2026

Copy link
Copy Markdown
Contributor

I haven’t seen this behavior in VS Code on Windows. Could you elaborate on both issues? I also haven’t seen other reports, so I’m wondering if there’s something specific about your setup.

The check was intended to run only once, whether you run the whole repo or the bundle. The cost should be small, while the review effort is reduced. If your experience is different, I hope we can improve that.

It took quite a lot of time to get it this far, and I’m currently reluctant to make it opt-in because of the review benefits and the value of spotting issues early.

You can't compare VS Code with Eclipse. VS Code is a text editor on steroids (via a million plugins), Eclipse is a fully fledged IDE that integrates extremely well with Java and manages the whole thing for you. This has huge advantages, but it requires that the project is set up "sensibly". In Eclipse, you can find references, implementations, super classes, all uses of a variable etc. with ease (not stupid text-matches like VS Code does, it actually "understands" the code and know about types, classes, inheritance etc.). You can easily do refactorings, rename across projects having every reference updated, you can move packages - in short it's fully integrated. In addition, it builds automatically for you, have a debugger read for use at any time, and it even allows you to modify code when OH is running, where it only builds and "hot replaces" the bytecode that has been changed in memory, making the effect "immediate".

To do all these things, Eclipse must be tightly integrated in the build process itself. But, it requires that projects "follow the rules" to retain this ability, and don't e.g. attach all kind of unrelated tasks to the build. That will obviously cause issues with this whole system. My previous experience with Eclipse is "fantastic", but I've never used BndTools before, and a BndTools plugin is required to integrate the OSGi setup in OH with Eclipse (Eclipse in itself supports/provides the OSGi framework via Equinox, the reference OSGi implementation, Bnd is used to "configure" OSGi (what bundles to run, their relationship they have etc.). Karaf, being a completely different product by Apache, has made a number of "extensions" to OSGi that are Karaf-only, so they don't do anything for Equinox, which is why Bnd is used for everything "outside" Karaf, like running itests, running OH in Eclipse, etc. The BndTools plugin for Eclipse has a lot of issues, and makes the whole OH/Eclipse integration slow and "challenging", which I suspect is why so many have chosen other solutions. But, this is very far from my experience with Eclipse without the BndTools plugin, so I blame that, not Eclipse. Anyway, once you figure out how to live with BndTools, you still have most of the "Eclipse advantages" remaining, just soured by the BndTools tantrums from time to time.

I don't know how you "intended it only to run once", but when you put it in a super POM of all the add-ons, it will apply to each and every add-on. Which means that when Eclipse manages the whole application, it will be triggered again and again and again. Add to that, as I said, that npm isn't even a system that should be required to build OH, and that I'm sure many would be contributors have no idea how to configure and get working, and you have a great reason not to do this in the first place. In addition, if I recall correctly, the "frontend plugin" doesn't support incremental builds, so it will run the whole process every time, regardless of what has changed, and that it often fails. I ususally run Maven in "offline mode" to avoid the constant checking for new artifacts, which is slow and not desirable anyway, I want to run what I have locally, and the plugin seems completely incapable of handling that, and will hang for a while before timing out and causing a build error. It's also a complete waste of time, it probably cost me 30 minutes just to wait for the 174 failures it caused this afternoon.

So, the cost isn't small, it's not even remotely small. It will run, in full, for every add-on for the tiniest change, like a changed timestamp on a file (git checkout, rebasing etc), since it doesn't do differential/smart builds.

It took quite a lot of time to get it this far, and I’m currently reluctant to make it opt-in because of the review benefits and the value of spotting issues early.

I'm not talking about making it opt-in on the CI - but why should we be forced to run this a million times locally when we do completely unrelated things? I can't see how that can be a benefit at all, and frankly, it has made add-ons almost unworkable for me. This has long annoyed me, but I didn't know what caused it. Today, when it completely sabotaged everything, I took the trouble to figure out where it came from, and that's why I haven't said anything before. The annoyance has been there since it was introduced.

@florian-h05

Copy link
Copy Markdown
Contributor

Just to add an example of a „split“ behaviour:
Main UI‘s formatting, linting and type checking run through GitHub actions on PR and pushes to main.
The Maven build only handles the actual build.
So while we enforce our coding standards on all PRs, the Maven build is as minimal as possible.

Wrt to Node/npm: frontend-maven-plugin downloads it for you, it doesn’t use your existing or non-existing local node install.

@Nadahar

Nadahar commented May 28, 2026

Copy link
Copy Markdown
Contributor

Wrt to Node/npm: frontend-maven-plugin downloads it for you, it doesn’t use your existing or non-existing local node install.

That probably explains why it fails in offline mode then - and why it's so slow - it probably downloads that once for every add-on, because the file structure isn't what it expects.

@Nadahar

Nadahar commented May 30, 2026

Copy link
Copy Markdown
Contributor

@lsiepel Don't you have anything more to say? Moving the current plugin configuration into a profile is very easy, and so is modifying the CI runner to activate the profile. So, I kind of seems that your objection is that you don't want to prevent it from running on local builds?

@lsiepel

lsiepel commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Time constraints.. :-/

Initially i had a seperate github action that did the markup checks. I was asked by @wborn to integrated it in the build proces, it took me a million hours todo so and i would be a bit frustrated to have it reverted. But if reverting prevents continous frustration by others, it might be better.

One of the posts above is explaining how excellent eclipse is, i would never question ones IDE preferences. I can only say that when i use vscode i have about all the features you mention available and i do not experience the issues you mention.

I'm not familiair with the way eclipse builds, but it should not run the markdownlint check for each bundle. With the way inheritance is used, it should run the markup check only once per build, no matter if you run the build process from the root, the bundles or the binding folder.

And yes it is important to have it run locally before a PR is created. Just like SAT.

I'm open to improvements.

@Nadahar

Nadahar commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

it took me a million hours todo so and i would be a bit frustrated to have it reverted.

I haven't suggested reverting anything, just moving it into a profile so that it needs an extra parameter to run. It's a minimal change, but the result is that it won't be run by default. I can try to whip up a suggestion as to how it might be done, and you can see what I mean.

I use VS Code too, for other languages, because Eclipse is really only good with Java - and relatively helpless with everything else. And I can promise you that the integration in VS Code can't be compared. But, if you're happy with it, that's fine. My point is that this tight integration has a "cost" in that things must be done in such a way that the automatic handling works. I can say that I wouldn't be able to do the things I do with anything close to the speed and precision I do without Eclipse's close integration. Others have their way of working, but to me, it's very hard to understand why people would want to not use Eclipse for Java development. My point is that we shouldn't make it "impossible" to use Eclipse with OH, because it is a very capable tool.

I'm not familiair with the way eclipse builds, but it should not run the markdownlint check for each bundle. With the way inheritance is used, it should run the markup check only once per build, no matter if you run the build process from the root, the bundles or the binding folder.

I don't understand how you think this should work. Eclipse builds each bundle/project individually. It doesn't run "build all", if only builds what has changed. Maven itself, or its standard plugins like the compiler plugin, supports only recompiling what has changed (if you don't use "clean", which Eclipse does not do unless you explicitly asks for it). It has some way of knowing which source files have changed and what needs to be recompiled, I don't know the details of how this works, but I know that's what it does. So, asking to build a bundle that hasn't changed is very, very cheap. But, the "frontend" plugin doesn't support this, so it will do the full task every time a bundle is built. If it supported differential builds, so that it only ran if one of the markdown files had changed since it was last run, it would "fit" into this system. In addition, it seems like the plugin doesn't respect the "offline" setting in Maven, so that it tries to download npm once every time a bundle is build, and when in "offline" mode, it looks to me like it waits for a timeout, and then fails.

I run Maven "offline" as standard. The reason for this lies in Maven itself, and they way it handles snapshots. Non snapshot versions aren't a problem, it won't try to "refresh" those if they are already cached, because they are assumed not to change. But, snapshot versions change. So, they must be "refreshed". Maven does so when it feels that enough time has elapsed since the last time it tried for that artifact/bundle. I think it's once every 24 hours by standard. When you have hundreds of bundles open, it means that very often some of them are close to this "limit". The next time you build something that depends on a snapshot artifact that Maven considers "expired", it will contact the online repo and compare the timestamps with that of the local cached version. If the online artifact has a more recent snapshot, it will replace the local artifact with a downloaded one.

The problem is that when you're working on a branch, your version will typically be the same as "the latest" snapshots online, e.g. 5.2.0-SNAPSHOT these days. But, their content isn't the same - because you might have made local changes needed for the branch you're working on. When Maven "refreshes" some of the bundles with those found online, it will often download versions that are incompatible with what you're working with. This will break everything, and you get all kind of compilation errors because this and that doesn't exist, a method signature has changed, etc. The only way to "fix" this is to build those bundles locally, so that they overwrite what it just downloaded with a newer timestamp. But, you don't always know what bundles were downloaded, and this keeps happening in the background while you work because Eclipse runs the Maven builds automatically. It's quite a hopeless and very frustrating situation when things just keep breaking "by itself", and if you don't know what bundles was replaced, the "fix" is to build core in its entirety. Until next time it happens, with can be at any time. Rinse and repeat.

From the Maven command line, you have the -nsu option, which I "always" use. It means No Snapshot Update, so it disables this "expiry" functionality. However, the makes of M2E (the Eclipse Maven integration) hasn't included that option, so you can't tell Eclipse to use it. But, it does have to "offline" option -o. That prevents the snapshots being updated as well, but in addition, it doesn't allow downloads of any kind, so if you don't have an artifact cached locally, it will fail. -nsu would have been a much better option, but it is what it is. So, because OH keeps uploading new snapshots regularly, the timestamps keep changing, and Maven keep pulling incompatible bundles automatically when Eclipse builds. The only way I've found to stop the madness is to use "offline" mode. But, that makes the "frontend" plugin fail the build. See the problem?

So, to me, this is a nightmare, and the only way I'm able to work with add-ons now is to keep reverting this PR locally every time I check something out. I must then exclude the reversal every time I commit, so that it won't be a part of the commit. And, I must revert the reversal before I can switch branch or rebase, or Git thinks I have a "dirty work tree". It's not exactly convenient, and makes me not want to work with add-ons at all.

And yes it is important to have it run locally before a PR is created. Just like SAT.

I usually don't run SAT locally. Sure, it happens that I must run spotless after pushing because I forgot that I changed something that spotless doesn't like. But, I'd much rather do that from time to time, than waste the time to run SAT locally all the time. But, the big, essential difference is that SAT has been set up so that it doesn't run. I don't remember exactly how that is done at this time, but I know that it doesn't run, or spotless would have failed the build constantly when you work. Not adhering to spotless doesn't break Eclipse builds.

Perhaps it's possible to do something similar with this, but I thought that the whole plugin had been excluded from running during Eclipse builds (although I can't find any such configuration right now). With the sat-plugin it would be OK to exclude it completely, the problem with the "frontend" plugin is that it's genuinely needed for some things, like building the webui. So, you can't disable the plugin from all Eclipse builds.

@Nadahar

Nadahar commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

It took some digging, but I finally found out how the SAT plugin it excluded from the Eclipse build: It's bound to the verify phase, and this "late stage" phase isn't run during incremental builds. You have bound the markdown actions to validate, which is a very early stage that is run by Eclipse.

Is there a particular reason why validate was chosen? Solving this problem might be as easy as to change the plugin configuration to run during verify instead.

@Nadahar

Nadahar commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

There is something strange here, even if I move it to verify, Eclipse still list it as "execute". I'm not sure exactly what it means:

bilde

I found the reason the plugin insists on running on incremental builds, the plugin author has specifically configured it to do so:

https://github.com/eirslett/frontend-maven-plugin/blob/58bc2331a61e228240989d5c716f5034f38f26bc/frontend-maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml#L1-L46

The plugin comes with Eclipse configuration that "makes sure" that it runs with Eclipse builds... 😞

@Nadahar

Nadahar commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Setting it to verify isn't enough, it still runs, and not only that, it errors:

07.06.2026, 05:26:20 CEST: [INFO] Copying 50 resources from src\main\resources to target\classes
07.06.2026, 05:26:21 CEST: [INFO] Copying 0 resource from src\test\resources to target\test-classes
07.06.2026, 05:26:21 CEST: [INFO] Node v24.12.0 is already installed.
07.06.2026, 05:26:21 CEST: [INFO] NPM 11.6.2 is already installed.
07.06.2026, 05:26:21 CEST: [INFO] Running 'npm exec --yes markdownlint-cli2 -- **/*.md !**/target/** !**/node_modules/** --config ${maven.multiModuleProjectDirectory}/.github/markdownlint.yaml' in C:\Repos\Java\openHAB\openhab-addons\bundles\org.openhab.binding.shelly
07.06.2026, 05:26:23 CEST: [INFO] markdownlint-cli2 v0.22.1 (markdownlint v0.40.0)
07.06.2026, 05:26:23 CEST: [INFO] Error: Unable to use configuration file 'C:/Repos/Java/openHAB/openhab-addons/bundles/org.openhab.binding.shelly/${maven.multiModuleProjectDirectory}/.github/markdownlint.yaml'; ENOENT: no such file or directory, open 'C:\Repos\Java\openHAB\openhab-addons\bundles\org.openhab.binding.shelly\${maven.multiModuleProjectDirectory}\.github\markdownlint.yaml'
07.06.2026, 05:26:23 CEST: [INFO]     at throwForConfigurationFile (file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
07.06.2026, 05:26:23 CEST: [INFO]     at readOptionsOrConfig (file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
07.06.2026, 05:26:23 CEST: [INFO]     at async main (file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
07.06.2026, 05:26:23 CEST: [INFO]     at async file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
07.06.2026, 05:26:23 CEST: [INFO]   [cause]: Error: ENOENT: no such file or directory, open 'C:\Repos\Java\openHAB\openhab-addons\bundles\org.openhab.binding.shelly\${maven.multiModuleProjectDirectory}\.github\markdownlint.yaml'
07.06.2026, 05:26:23 CEST: [INFO]       at async open (node:internal/fs/promises:642:25)
07.06.2026, 05:26:23 CEST: [INFO]       at async Object.readFile (node:internal/fs/promises:1279:14)
07.06.2026, 05:26:23 CEST: [INFO]       at async readOptionsOrConfig (file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:157:17)
07.06.2026, 05:26:23 CEST: [INFO]       at async main (file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
07.06.2026, 05:26:23 CEST: [INFO]       at async file:///C:/Users/xxxxx/AppData/Local/npm-cache/_npx/3c2a9ea6c4b6e0a2/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
07.06.2026, 05:26:23 CEST: [INFO]     errno: -4058,
07.06.2026, 05:26:23 CEST: [INFO]     code: 'ENOENT',
07.06.2026, 05:26:23 CEST: [INFO]     syscall: 'open',
07.06.2026, 05:26:23 CEST: [INFO]     path: 'C:\\Repos\\Java\\openHAB\\openhab-addons\\bundles\\org.openhab.binding.shelly\\${maven.multiModuleProjectDirectory}\\.github\\markdownlint.yaml'
07.06.2026, 05:26:23 CEST: [INFO]   }
07.06.2026, 05:26:23 CEST: [INFO] }
07.06.2026, 05:26:23 CEST: [INFO] Building jar: C:\Repos\Java\openHAB\openhab-addons\bundles\org.openhab.binding.shelly\target\org.openhab.binding.shelly-5.2.0-SNAPSHOT.jar

It's obvious that the ${maven.multiModuleProjectDirectory} variable is unknown when the build is running, so that it's not substituted with whatever value it was supposed to have.

markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Jun 13, 2026
* Fix Markdown

Related to openhab#19010

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Jun 13, 2026
Related to openhab#19010

Signed-off-by: Wouter Born <github@maindrain.net>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Jun 13, 2026
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Jun 13, 2026
Regression from openhab#19010.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
olemr pushed a commit to olemr/openhab2-addons that referenced this pull request Aug 8, 2026
Related to openhab#19010

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: olemr <olemr@olemr.com>
olemr pushed a commit to olemr/openhab2-addons that referenced this pull request Aug 8, 2026
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: olemr <olemr@olemr.com>
olemr pushed a commit to olemr/openhab2-addons that referenced this pull request Aug 8, 2026
Regression from openhab#19010.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: olemr <olemr@olemr.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Build system and Karaf related issues and PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[General Documentation] Could/Should we add a markdownlint config?

9 participants