-
Notifications
You must be signed in to change notification settings - Fork 55
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
add minetest
to builtin standards
#108
Conversation
Can use this for testing https://hub.docker.com/r/mineunit/luacheck but isn't supposed to stay or maintained afterwards so just if it might make testing simpler. |
I think the luajit failure in CI is unrelated to this PR, but I also don't see any tests being added in this PR for the new functionality. At least one to check that the new preset value is being recognized and put in effect would be nice to see. Otherwise this seems to be coming along fine. Obviously I can't judge the correctness of the API info you've entered so some feedback from other users would be useful there, but architecturally it seems like you're on the right track. |
as a user skimming over this, the api's look correct |
can you point me to a location where such a test would fit in (there's quite a lot of test-stuff 😲)
I'll arrange something 👍 |
I actually didn't see any where to point you towards such a test, so I made one myself. We're getting the builtin standards function tested in a few round a bout ways by testing various config parsing and rockspec lints etc., but nothing was very direct. I just pushed a commit here with a test like I was imagining should exist. I don't see much point in trying to flesh out the sample to test every possible rule since setting that up would likely just propagate any errors you made in the API surface from the std definitions to tests anyway. If we had some sort of reference document from a different source to test against that would be cool but not required. As far as I'm concerned this local test is enough to verify that the std set is getting applied and also isn't breaking anything else. What exact rules are being applied is much more up to you and the minetest community. |
Few things (it is likely that there's still many similar missing things, list is just grabbed from random luacheck run):
|
A question from the minetest-discord:
@appgurueu not sure about that, i think collecting the api-changes over major releases and creating a PR here would be a reasonable approach
@alerque thanks for that 🎉
i created a PoC PR in on of our mod-reporitories: mt-mods/pipeworks#109 we usually just pull in the luacheck-action directly but i changed it there to use @S-S-X docker image with the modifications from here
@S-S-X Right, i think there are a few more constants that aren't in the official docs (yet?) will add that the next few days 👍 |
Not sure how things that are not in official docs should be handled. I mean there's a lot of stuff that is technically available but isn't meant to be part of official public API. I think those probably should either be first fixed on Minetest side (added to docs) or not added to spec here. Has happened before that some things that weren't documented been silently dropped from core because it wasn't part official API so no reason for deprecation process. |
Yes. I would definitely suggest:
By the way you can probably save all of the shenanigans to get a working GH Action in @S-S-X's branch just by tweaking the action.yml file to point at this branch's Dockerfile rather than a pre-compiled container. We would just need to revert that commit before merging this. |
This comment was marked as outdated.
This comment was marked as outdated.
Actually I forgot one simple thing, luacheck does already read config from cwd by default. This simple fact makes it completely unnecessary to rewrite/modify runner config for anything besides marketplace, and for custom marketplace listing there wouldn't be any real benefits as it would still be exactly same job. Simply put, that image I've added was meant only for easy local command line testing and still should be used only for that (until it gets deleted / this pr done). |
Agreed 👍
The only undocumented and included api's are those here: https://github.com/minetest/minetest/blob/master/builtin/game/constants.lua
I already switched the proof-of-concept PR to @S-S-X's action.
I'm marking this PR as "ready" now, feel free to ping me up if something is missing 👍 |
Updated my dev/validation action so it is based on action definition and stripped down dockerfile provided by lunarmodules/luacheck here. |
Please open a PR for that so they actually do. Odd, the LuaJIT regression test using busted is segfaulting, but I think that's not the fault of this PR. The luajit in that action should probably be upgraded to a self-compiled latest master. I vaguely remember having segfaults with older luajit versions + busted too, but I never got to tracking them down. |
Tried mtg, looks good to me. Complains about |
I don't think this is correct behavior. Quoting
(the documentation unfortunately forgets to mention that an Anyways, I've made the following PR to fix this: BuckarooBanzay#1 Edit: Looks like we're inconsistent about the s's. My PR should be fixed now. I'll open an issue on Minetest. |
I still don't understand why all the convoluted multi-repository approaches to setting a CI test. As I mentioned about it should be a one-liner to make THIS ACTUAL PR the test, not some other repository with possibly different Lua setups, different action names, and modified config handling. Can we adjust some/all of the proof of concept tests to be exactly like they would be in production, just substituting |
(And thanks for the help @appgurueu and @S-S-X, it is nice that this is getting a workout before release rather than after.) |
Yeah why not, proposed that as a change suggestion on first PoC PR already but then noted it would need an update here so decided to just throw it in another repo as that's easiest and fastest way for me personally.
Yes that's true too, I've just seen these as a things not yet meant to fully be a part of official public API. I guess reading |
Well, regardless of what they are meant to be, they are documented as part of the public API. The API does not state whether these tables are readonly, however.
Good point, however: Not inserting a callback into (Technically, use patterns are possible which mutate
Well, the
Frankly, I think When you get a crash, you get a stacktrace. This may or may not involve multiple mods. If anything, we should infer (possibly) responsible mods (plural) from the stacktrace, rather than always blaming the mod which registered the callback. |
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.
I'll rebase this to fix commit messages and drop the temporary action runner commit after the ongoing discussion re hook tables is resolved.
This should be resolved now, let me know if there is something missing or if i can help with something regarding the merge/rebase. |
The question is: Are you targeting 5.8 or 5.9 here? I just see a link to "master" in the current sources, so I assume this is based on 5.9-dev, in which case we should probably wait until 5.9 releases (which will also give us some time to resolve the hook issue)? If this were for 5.8, this should be good as-is. Even if the docs are inaccurate, this matches what the code does (and hence what you will find in correct mods). We will not be able to break any of these "hook" table names before 6.0, though we may deprecate some names in favor of new names in 5.9. |
From my standpoint targeting the last stable release plus anything that is widely considered de facto is probably best, then put out an update when there is a new target available with official changes that coders ought to be taking under advisement anyway. But I also don't know how the release cycle and workflows look like for minetest, so I'll deffer to community consensus/what people are willing to contribute. |
@appgurueu yes, that's the idea, waiting for the next minetest release is not an option IMO: no one knows when that will be and if the naming issue will be closed by then.
@alerque this is my plan, i'll whip up another PR if the minetest api should change |
Does that mean ya'll are done with this PR? |
yeah, i think this should be ok 👍 |
For the record, I've opened a PR to document the current state of affairs properly on the Minetest side of things: minetest/minetest#14509 |
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.
I think pulling out development debug remnants is the last thing to do here.
0622592
to
227f01d
Compare
This PR adds the
minetest
lua api to the builtin standardsfixes #107
Open tasks:
luacheck
maintainer(s))minetest
to builtin standards #108 (comment)