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

Feature directAccess without tests #8808

Open
4 tasks done
mtrezza opened this issue Nov 16, 2023 · 1 comment · May be fixed by #8807
Open
4 tasks done

Feature directAccess without tests #8808

mtrezza opened this issue Nov 16, 2023 · 1 comment · May be fixed by #8807
Labels
type:ci CI related issue

Comments

@mtrezza
Copy link
Member

mtrezza commented Nov 16, 2023

New Issue Checklist

Issue Description

The directAccess feature defaults to being enabled since Parse Server 6. This was a decision made after the feature has been in an experimental state for years (introduced in 2017) and used by developers in production environments. The goal was to make the feature broadly available to mature it faster and fix any bugs reported.

However, it seems that the feature itself is not tested - at all - in our CI. In fact, not a single test runs with directAccess enabled. The test suite does not allow to use the ParseServerRESTController because the test helper always sets the normal REST controller:

Parse.CoreManager.setRESTController(RESTController);

This overrides the server config for tests which is deliberately set to enable direct access:

directAccess: true,

So even if calling await reconfigureServer({ directAccess: true }); in a test, the normal REST controller will be used.

That override was added in #8232. From the past discussions around officially releasing the directAccess feature it seems this was added to make the tests pass, as the refactor would have been to vast to run all the tests once with directAccess enabled and once with directAccess disabled.

The fact that the tests run without directAcess enabled while at the same time directAcess is enabled by default in Parse Server is a contradiction that can easily lead to - especially Cloud Code related - bugs not being discovered by the CI. For example #8806.

Removing the REST controller override to run tests with directAccess: true causes 403 tests to fail, see #8807.

Solution

We should probably run the CI with directAccess enabled and disabled. Running every CI job twice would consume a lot of resources. Instead, depending which of the two the CI should focus on, at least 1 job could run with directAccess enabled and the rest of the jobs with directAccess disabled, or vice-versa.

Copy link

parse-github-assistant bot commented Nov 16, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza changed the title Feature directAccess immature and without tests Feature directAccess without tests Nov 16, 2023
@mtrezza mtrezza linked a pull request Nov 16, 2023 that will close this issue
@mtrezza mtrezza added the type:ci CI related issue label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:ci CI related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant