-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor: remove deprecated url.parse()
method
#7751
Conversation
Thanks for opening this pull request!
|
Thanks for opening this pull request!
|
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## alpha #7751 +/- ##
==========================================
+ Coverage 93.95% 93.97% +0.01%
==========================================
Files 183 183
Lines 13660 13655 -5
==========================================
- Hits 12834 12832 -2
+ Misses 826 823 -3
Continue to review full report at Codecov.
|
@davimacedo while working on this PR, I cleaned up the The problem I ran into is the extra reconfiguration of the server: parse-server/spec/ParseServerRESTController.spec.js Lines 348 to 349 in 191d80b
seems to override the one configuration that uses the parse-server/spec/ParseServerRESTController.spec.js Lines 171 to 183 in 191d80b
When I remove the extra reconfigure and use the 1) ParseServerRESTController transactions should generate separate session for each call
- Expected false to equal true.
- Expected false to equal true.
- Expected false to equal true.
- Expected false to equal true. Note that removing the extra reconfigure on this test seems to work: parse-server/spec/ParseServerRESTController.spec.js Lines 189 to 190 in 191d80b
My initial thoughts are the extra reconfigure shouldn't be there and the tests might be catching an actual bug. I don't know enough about Mongo to know if separate sessions are required for transactions. Also, it looks like the exact set of transaction tests are in parse-server/spec/batch.spec.js Lines 170 to 590 in 4c29d4d
|
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.
This PR seems to be contain many changes that are unrelated to "feat: support postgresql in database uri". This could make debugging difficult in the future. Could you focus this PR on what the issue and PR describe (the "postgresql" protocol) and move unrelated changes to a separate PR?
The postgresql addition is literally a one liner for a fall through case statement. The additional part of the PR removes the deprecated If you look at the codecov diff, it's easier to see the changes to the server files. The testcases are easier to see looking at the GitHub Files Changed |
Even better if it's a one-line then we can merge it easily. Mixing unrelated issues in a single PR is something we really want to avoid. We are asking every contributor to follow that because in case of bugs it becomes much more difficult and time intensive for everyone to investigate. I know it can seem to be a nuisance sometimes. |
You have also been asking every contributor to help with upgrading the tests to async/await. I've already split the PR's I've worked on into 4 to make it easier. Removing the one liner will still make this PR look almost the same, which will require a similar 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.
I appreciate the work you put into fixing the tests. Could you please remove unrelated changes from this PR. The basic practice we ask everyone to follow is to not mix unrelated issues in one PR for obvious reasons. Remember that we are also using release automation now that is based on distinct PR scopes.
If you have to modify a couple of test cases for a PR anyway and in the same go you refactor them using async/await, that should be fine. If you modify a lot of tests or unrelated tests, then you could do that in a separate PR, like has been done in #7564. This PR contains a lot of different things, like this new test it('validateAuthData invalid public key http url', async () => {
where it is difficult to say what it relates to and why it was added.
url.parse()
method
@@ -89,6 +89,28 @@ describe('batch', () => { | |||
expect(internalURL).toEqual('/classes/Object'); | |||
}); | |||
|
|||
it('should return the proper url with bad url provided', () => { |
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.
These tests are added because the design of batch.makeBatchRoutingPathFunction
attempts to handle this, but these two added test fail with the url.parse
implementation of the code.
I guess let's merge all other split-off PRs first and then see the diff here, to make sure this PR has the right scope. |
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.
Looks good!
🎉 This change has been released in version 5.0.0-alpha.17 |
🎉 This change has been released in version 5.0.0-beta.10 |
🎉 This change has been released in version 5.1.0 |
New Pull Request Checklist
Issue Description
The server uses the deprecated url.parse() method. Close #7762
Related issue: #7762
Approach
I switched all of the server to use
new URL()
and updated relevant tests.TODOs before merging
url.parse
tonew URL