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

[WP#]Fix random deactivation of automatically managed folders #656

Merged
merged 8 commits into from
Jul 31, 2024

Conversation

SagarGi
Copy link
Collaborator

@SagarGi SagarGi commented Jun 28, 2024

Description

The main reason for the random deactivation of the Automatically managed project folder seems to be happening because the special user "OpenProject" was logged in and the password for that user was changed which deleted the application password for that user. In addition to that, as of now we generate temporary application password for user "OpenProject" which also gets deleted when the user "OpenProject" password is changed.

This PR fixes the random deactivation of the Automatically managed project folder.

  • Adds changes that makes the application password Permanent (does not get deleted after user password is changed)
  • Adds a migration step in order to make the temporary application password for the "OpenProject" to permanent for all the user already having application password.

Note : The app password token is by default permanent for NC-26, NC-27 but we have option to make it temporary or permanent from NC>=28

Related Issue or Workpackage

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@SagarGi SagarGi changed the title [WP#]Change token type to permanent [WP#]Change token type to permanent and migration step Jun 28, 2024
@SagarGi SagarGi changed the title [WP#]Change token type to permanent and migration step [WP#]Fix random deactivation of automatically managed folders Jun 28, 2024
@SagarGi SagarGi self-assigned this Jun 28, 2024
@SagarGi SagarGi marked this pull request as ready for review July 1, 2024 09:15
@SagarGi
Copy link
Collaborator Author

SagarGi commented Jul 1, 2024

@nabim777 this also needs a manual test. May be you can do it.

Copy link
Collaborator

@individual-it individual-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be covered by tests?
Also I think it should be merged to 2.6 branch, so that we will not need to backport it

Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the changeTokenTypeToPermanent branch from fa18c02 to 52d612b Compare July 31, 2024 03:38
Copy link

JS Code Coverage

Coverage after merging changeTokenTypeToPermanent into master will be
87.66%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   adminSettings.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   bootstrap.js0%0%0%0%1, 1–7
   dashboard.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   fileActions.js0%0%0%0%1, 1, 10–17, 2–9
   personalSettings.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   projectTab.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–66, 7–9
   reference.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60, 7–9
   utils.js71.43%33.33%50%73.85%10–14, 17–26, 6–9
src/components
   AdminSettings.vue96.07%93.75%95%96.44%1016–1019, 1055–1057, 1077–1080, 510–511, 638, 650–652, 664, 664, 664–669, 672–673, 677–678, 681–682, 686–687, 697–702, 762–764, 776–779, 792–794, 979–981
   OAuthConnectButton.vue91.54%75%100%92.98%59–64, 67–71
   PersonalSettings.vue90.16%94.44%85.71%89.88%100, 110–115, 118–127, 99
src/components/admin
   FieldValue.vue100%100%100%100%
   FormHeading.vue100%100%100%100%
   ProjectFolderError.vue100%100%100%100%
   TermsOfServiceUnsigned.vue100%100%100%100%
   TextInput.vue100%100%100%100%
src/components/icons
   ClippyIcon.vue100%100%100%100%
   OpenProjectIcon.vue100%100%100%100%
src/components/settings
   CheckBox.vue100%100%100%100%
   SettingsTitle.vue96.74%85.71%100%97.53%46–48
src/components/tab
   EmptyContent.vue98.90%95%100%99.35%92–93
   SearchInput.vue95.27%92.96%94.74%95.73%134–135, 188, 199–204, 263–265, 281–283, 287–292
   WorkPackage.vue86.07%72.50%93.33%87.46%102–111, 124–126, 137–141, 151–153, 171–177, 215, 215–220, 220, 220–231, 76–77
src/filesPlugin
   filesPlugin.js0%0%0%0%1, 1, 10, 100–104, 11–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–99
   filesPluginLessThan28.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–78, 8–9
src/utils
   workpackageHelper.js93.77%93.33%88.89%94.15%153–154, 18–20, 49, 49–51, 94–99
src/views
   CreateWorkPackageModal.vue93.93%83.95%90.91%95.18%370–372, 407–410, 415–420, 425–430, 436–439, 442, 458, 458, 498–502, 512–514, 533–535, 565–567, 589–591, 600–604
   Dashboard.vue77.40%80.39%61.90%78.01%103–108, 115, 119–120, 125, 128, 131–134, 139–141, 182–188, 194–197, 199–209, 238–246, 259–273, 51, 63, 88–91, 98–99
   LinkMultipleFilesModal.vue100%100%100%100%
   ProjectsTab.vue94.91%94.23%93.33%95.07%113–116, 142, 153–154, 188–198, 246–248

Copy link

PHP Code Coverage

Coverage after merging changeTokenTypeToPermanent into master will be
59.77%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
server/apps/integration_openproject/lib
   Capabilities.php0%100%0%0%19, 26–35
server/apps/integration_openproject/lib/AppInfo
   Application.php7.41%100%25%6%101, 103–106, 108, 110, 112, 116–119, 121–132, 134, 137, 141, 145–147, 74–76, 79–83, 85–90, 92–93, 96
server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%42, 44–46, 55–56
server/apps/integration_openproject/lib/Controller
   ConfigController.php64.76%100%50%65.37%135, 152–153, 155, 157–159, 161–164, 167–168, 170, 212, 222, 226–228, 292–296, 406–408, 410–412, 417–420, 461, 549–552, 554–555, 558, 566–570, 581, 595–598, 606–607, 611–614, 628–632, 634–635, 637–653, 670–675, 677–678, 680–682, 685, 687–703, 716–723, 725–728, 730–734, 743–748
   DirectDownloadController.php0%100%0%0%36–38, 53–55, 57–64
   DirectUploadController.php68.97%100%100%68.09%140–142, 186–188, 199, 203–206, 208, 218, 225, 241–243, 245–246, 249–254, 257, 259, 267–269, 275–277, 279–281, 283–285, 300–302, 321, 326, 332
   FilesController.php72.95%100%83.33%72.41%181–182, 244, 249–252, 254, 256–269, 272–273, 275–276, 280–283, 286, 292
   OpenProjectAPIController.php85.60%100%80%85.92%139, 180, 204, 230–233, 236–243, 245–249, 251, 263, 272, 290, 299, 367, 369, 419, 421, 441, 443, 490, 492, 518–521, 524–528, 530, 735–739, 96
server/apps/integration_openproject/lib/Dashboard
   OpenProjectWidget.php0%100%0%0%101, 108, 115–116, 118, 120–137, 69–73, 80, 87, 94
server/apps/integration_openproject/lib/Exception
   OpenprojectErrorException.php100%100%100%100%
   OpenprojectFileNotUploadedException.php100%100%100%100%
   OpenprojectGroupfolderSetupConflictException.php100%100%100%100%
   OpenprojectResponseException.php100%100%100%100%
   OpenprojectUnauthorizedUserException.php0%100%0%0%16
server/apps/integration_openproject/lib/Listener
   BeforeGroupDeletedListener.php0%100%0%0%48, 56–57, 60–63, 65
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%41–43, 47–50, 52, 54, 57–58, 60, 62–65, 67–70, 72–74
   BeforeUserDeletedListener.php0%100%0%0%48, 55–56, 58–61, 63
   LoadAdditionalScriptsListener.php0%100%0%0%17, 20–21, 24–26, 28
   LoadSidebarScript.php0%100%0%0%100, 102, 104–105, 107, 109, 111, 113–122, 75–91, 96–97, 99
   OpenProjectReferenceListener.php0%100%0%0%53–54, 57–58, 61–62, 64–67
   TermsOfServiceEventListener.php0%100%0%0%59–60, 65–66, 68–69, 71–73, 76–80
   UserChangedListener.php0%100%0%0%52, 59–60, 63–68, 71
server/apps/integration_openproject/lib/Migration
   Version2001Date20221213083550.php0%100%0%0%47, 57–65, 67–75, 77–79, 81
   Version2310Date20230116153411.php0%100%0%0%46, 49–52, 54–79, 81–82, 84
   Version2400Date20230504144300.php0%100%0%0%47, 57–60
   Version2640Date20240628114301.php0%100%0%0%52, 64–66, 69–70, 73
server/apps/integration_openproject/lib/Reference
   WorkPackageReferenceProvider.php51.67%100%25%58.33%102, 108–111, 114–116, 119, 123, 157, 165–166, 174, 52, 59, 66, 73–75
server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%103–104, 107–118, 121–122, 124–125, 128–137, 139–143, 66–69, 76, 83, 91, 93, 96
   OpenProjectSearchResultEntry.php100%100%100%100%
server/apps/integration_openproject/lib/Service
   DatabaseService.php42.31%100%60%40.43%100–102, 125–129, 131, 80–93, 95–99
   DirectDownloadService.php88.46%100%100%87.50%65–66, 68
   DirectUploadService.php42.86%100%66.67%40%112, 118, 79–82, 84–92
   OauthService.php0%100%0%0%109–116, 45–47, 56–66, 68, 70–72, 74–80, 89–98
   OpenProjectAPIService.php74.97%100%75.93%74.89%1006–1008, 1010–1012, 1015–1019, 1021–1023, 1032–1035, 1038–1040, 1042, 1045–1050, 1054–1055, 1086–1089, 1108–1115, 1124–1125, 1132–1134, 1136–1139, 1143, 1152, 1170, 1172–1175, 1177–1182, 1324, 1336, 1339, 1361, 1364, 1374–1379, 1498–1500, 1502–1503, 1507–1508, 1510, 1512, 179–183,

Copy link
Collaborator

@nabim777 nabim777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@SagarGi SagarGi merged commit 6657608 into master Jul 31, 2024
25 checks passed
Copy link

github-actions bot commented Aug 8, 2024

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@SagarGi SagarGi deleted the changeTokenTypeToPermanent branch August 16, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants