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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for project, project-permissions services hook refactor #8989
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
barankyle
force-pushed
the
project-hooks
branch
from
October 12, 2023 00:43
3daeb62
to
484722c
Compare
barankyle
approved these changes
Oct 12, 2023
Made checking for project permissions only apply to external calls
barankyle
force-pushed
the
project-hooks
branch
from
October 13, 2023 21:09
80deea1
to
9786e89
Compare
barankyle
approved these changes
Oct 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
馃 Generated by Copilot at 21bdbe9
This pull request refactors and updates several files and modules related to the project, project permission, scene, and route services, as well as some scripts and tests. The main purpose is to improve the compatibility, security, consistency, and readability of the code, and to fix some errors and issues. The changes include using public methods instead of internal methods of the
projectPath
andprojectPermissionPath
services, extending theKnexService
class instead of theKnexAdapter
class, adding and modifying hook functions and validations, and adjusting some method signatures and parameters.References
#8871
Explanation
馃 Generated by Copilot at 21bdbe9
update
method calls of theKnexAdapter
andprojectPath
services to pass an empty string as the first argument, instead of thedata
object, to avoid errors and match the expected format (link, link, link, link, link, link)ProjectPermissionService
andProjectService
classes to extend theKnexService
class instead of theKnexAdapter
class, to leverage its features and be consistent with other services (link, link)app
property and the constructor that assigned it from theProjectPermissionService
andProjectService
classes, as they were unnecessary and inherited from theKnexService
class (link, link)_
methods to use the public methods instead, to ensure that the hooks and validations are applied (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)ensureInviteCode
,checkExistingPermissions
,checkUser
, andcheckPermissionStatus
hook functions to theproject-permission
hooks file, to validate and adjust the project permission data and queries (link, link, link, link)createAndUploadProject
,updateProjectFiles
,removeProjectFiles
,addDataToProjectResult
,checkProjectExists
,checkProjectWriteAccess
,checkProjectGithubUrl
, andcheckProjectAutoUpdate
hook functions to theproject
hooks file, to perform various tasks related to creating, updating, deleting, and querying projects (link)before
andafter
hooks of theproject
andproject-permission
services, according to the logic and order of the operations ( link)needsRebuild
andreset
fields of theProjectBuildUpdateItemSchema
optional, to allow more flexibility and compatibility (link)INVITE_CODE_REGEX
andUSER_ID_REGEX
constants from theIdConstants
module, and theGITHUB_URL_REGEX
constant from theGitHubConstants
module, to validate the invite code, user id, and GitHub URL fields in the hooks (link, link)projectPath
constant from theproject.schema
module, and thefs
andpath
modules, to access theproject
service and manipulate the file system and paths in the hooks (link, link)placeholder
parameter from theupdate
method of theProjectService
class, and reordered the other parameters, to match the signature of theupdate
method of theKnexService
class (link)projectPath
import from theProjectPermissionService
class, as it was not used (link)installAllProjects
function call in theinstall-projects
script file, as it was unnecessary and inconsistent (link)install-projects
script file, as it was unnecessary and inconsistent (link)install-projects
script file alphabetically, as it was a code style preference (link)patch
andfind
method calls in parentheses and cast them as the expected types, to avoid TypeScript errors and make the code work (link, link, link)馃 Generated by Copilot at 21bdbe9
QA Steps
List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.
Checklist