Skip to content
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

[GdScript] Templates for GdScript (Godot 4) #19267

Draft
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

Goutte
Copy link

@Goutte Goutte commented Jul 30, 2024

See #13719

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.6.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Goutte and others added 30 commits July 30, 2024 08:08
This does not really work yet, but it's a start.
Results are not denormalized, no support for enums nor datetimes,
and thousands of other features are missing.

I still don't know how we are going to denormalize JSON+LD
without writing a whole GDScript lib for it…
I've also provided the small python script I used to generate the list.
Whilst I'm racking my brains trying to figure out integration testing…
(plain ol' godot object)

One: I don't know how they work under-the-hood.
Two: I'm very confused over-the-hood.
Tri: We do not need them.
I know I'm making a lot of commits for not much,
but now I'm opening the sample files with Godot as well,
and doing unholy things with filesystems,
so I'm not taking any chances.

It's all going to be squashed anyway.  :)
It works !  I can now write integration tests in GDScript.
The real work starts now.

/spend 25h
The test suite is now past its first hurdle, the 415 HTTP status code,
and went straight into an unexpected error 500.

I suspect the server does not like me trying to set the pet id at 0,
because that's what we're trying to do right now.

Godot is crashing a lot, mostly because I don't know how to make Callable.NOOP
and my current solution hints at optional on_success and on_failure,
yet if we omit them the engine will ragequit.
Now we'll get a nice error when we forget to set a required property.

The demo is now able to:
- connect
- create a user
- login as that user
- create a pet
This makes our usage of `class_name` a little more acceptable.
This will crutch namespacing well enough for most uses.
- minLength
- maxLength
- minItems
- maxItems
- minimum
- maximum
- pattern (no flags)
We also support serializing to application/x-www-form-urlencoded now.

Next up: DateTimes !
There's no timezone support in Godot for DateTimes.
Those are Arrays, not custom collection objects.
We don't need no factories nor singletons ; config is enough.
…gure features

We can now generate a client for an OAS server running ApiPlatform (PHP).
(but I can't find the `description` template handler)
Too late to amend >.<
dangsarnit
saatsazov and others added 24 commits July 30, 2024 08:08
There's still a lot of holes, TODOs and FIXMEs.
The inline response objects are still not supported.
{{#if defaultValue}} evaluates to true for null if we call super here.
Now we pass the config and the client via the constructor.
This reduces the area of the public surface a bit, for the better I think.
This commit also cleans up the class name shenanigans.
… addon

Since there is no singleton in the generated client, the addon need not be enabled in the project configuration to be usable.

The --headless mode is broken for now, as things changed in Godot 4 since the beta.
We used the latest stable GUT, but a feature we're going to need was merged today, so we'll need to update it either to master or to the next release at some point.
Also moving core templates to their own subdir, for clarity.

/spend 10m
Hire me while I'm available !  :D
I'd rather code than make a CV.
Also adding some more assertions,
and using our own OAS file now.

/spend 3h
@Goutte Goutte changed the title Templates for GdScript (Godot 4) [GdScript] Templates for GdScript (Godot 4) Jul 30, 2024
@Goutte
Copy link
Author

Goutte commented Jul 30, 2024

Should I add myself to the tech committee for GdScript ?

@Goutte
Copy link
Author

Goutte commented Jul 30, 2024

I rebased on main, and the test suite now fails.

java.lang.IllegalAccessException: class com.github.jknack.handlebars.context.FieldValueResolver$FieldMember cannot access a member of class java.util.HashMap (in module java.base) with modifiers "transient"

com.github.jknack.handlebars.HandlebarsException: model.handlebars:3:3: java.lang.IllegalStateException: Shouldn't be illegal to access field 'size' model.handlebars:3:3

I'll hunt some more in the coming days.


Of interest : jknack/handlebars.java#940
and : #510

@wing328
Copy link
Member

wing328 commented Jul 30, 2024

Should I add myself to the tech committee for GdScript ?

yes please

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.

3 participants