-
Notifications
You must be signed in to change notification settings - Fork 173
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
feat: added constants for Error Types #724
base: master
Are you sure you want to change the base?
Conversation
- added logic in Swagger2.php to parse errors from APISpecs -> definitions->x-appwrite. - added Error enums in twig templates. Signed-off-by: Jay <jaykumar20march@gmail.com>
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.
Wow, this is amazing! Would you be able to add test cases as well? For reference, here's a PR with tests for Flutter/Dart.
This is what the generate enums will look like (Python code):
@stnguyen90 what kind of tests would we want for the generated enums, |
tests comparing the enum to the string value like:
This is exactly how the enums will be used by developers using the SDK.
Ya but they wouldn't be able to add tests for this because the enum code is in your PR. |
Heyyo :) Guy working on the tests here! I am only just getting started, and the tests are a bit of a pain to set up from the ground up. So if this is merged, I don't mind rebasing my stuff and potentially including them. Only thing that would help me would be a reference testcase or two in the dart / flutter SDK so I can port that to the other SDKs. I am currently on the Android front still and it's going to be some time until I get my hands on other SDKs. Just offering this up because adding testcases across all SDKs is otherwise going to take a bit and probably cause more chaos merging things than if this was merged and I just included the tests in my work. Thoughts @stnguyen90 ? |
- added new test folder in python. - added test for Python ErrorEnums Signed-off-by: Jay <jaykumar20march@gmail.com>
@stnguyen90 This is what I came up with, 061fea8, if it looks good i'll add for the rest of the sdks. |
@geisterfurz007, @35C4n0r can add these test cases since they should be self contained and shouldn't impact the other tests too much. |
@35C4n0r, btw, best practices for commit messages is to use imperative (i.e. use add rather than added). For more info, see https://cbea.ms/git-commit/ |
- add new gem test-unit Signed-off-by: Jay <jaykumar20march@gmail.com>
@geisterfurz007 what testing library are you planning to use for node runtime. |
@35C4n0r Whatever works for you for now is good, I think. So far I am only done-ish with Kotlin where I used kotlin-test / JUnit. Everything else is still pending for me. Should I pick another library anywhere for any good reason, I'd probably just migrate these tests over. |
- new tests for Node, Deno, web, swift, ruby, python, php, kotlin, dotnet, android Signed-off-by: Jay <jaykumar20march@gmail.com>
- new tests for Dart and Flutter Signed-off-by: Jay <jaykumar20march@gmail.com>
@stnguyen90 I've added the Tests, PR is up for review. |
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.
Great PR! 🤯 We left some comments during the review, please check them out.
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
@stnguyen90 I have made changes according to the comments. Kindly re-review |
@35C4n0r Thank you for update to the PR however, I'm still seeing so many tests fail, will you be able to investigate why? |
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
@lohanidamodar @stnguyen90 There were a minor issues that i've fixed. This is what i've added in my spec to test in the local.
Now, the remaining tests for Python, Dart and Java are failing, cause the spec passed to the SDK doesn't have any error types (under |
@lohanidamodar @stnguyen90 any thoughts on it? |
Ya, let's be defensive and handle the case so things don't break.
The specs used in the tests are here. They should probably be updated to include the x-appwrite stuff. |
- all the block of codes are wrapped within the if block. Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
@stnguyen90 I have changed the test Spec to this https://github.com/appwrite/sdk-generator/blob/c429aa0432aa70c3e987106b7e8bb42d12b4a903/tests/resources/spec.json There is still an issue where AppwrwiteException Class is already written in the src/exceptions.* and is again bieng generated in the Models/. because of this sdk-generator/tests/resources/spec.json Line 1138 in c429aa0
which is leading to ambiguos naming and import errors, see: https://github.com/appwrite/sdk-generator/actions/runs/6901109358/job/18775353731?pr=724#step:8:819, https://github.com/appwrite/sdk-generator/actions/runs/6901109358/job/18775352926?pr=724#step:8:248 How should we fix this. |
Can we have an exclude to exclude creating models for things that end in Exception? |
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
- add Exception generator to swift Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
Signed-off-by: Jay <jaykumar20march@gmail.com>
@stnguyen90 @lohanidamodar all tests pass, the PR is ready for review. |
@35C4n0r Awesome work, will work to get this merged as soon as possible. |
Signed-off-by: Jay <jaykumar20march@gmail.com>
Hey there! There were a lot of big PRs during this Hacktoberfest, and we wanted to give everyone ample time to collaborate with our engineering team. If you were able to merge your PRs during October, amazing. If it’s still not merged, don’t worry about it either. Either way, we’ve got your Hacktoberfest swag minted and ready to ship. Please comment with your Discord username here so we can contact you about your shipping information to deliver your Hacktoberfest swag. |
@gewenyu99, Here is my DiscordID: huntersoulz |
Reaching out soon! |
What does this PR do?
Related PRs and Issues
Closes #698