Fixes issue #2 - eliminate getAllDeploymentProjects lookup with autocomplete against rest api

#2 Open
Repository
atlassianlabs
Branch
master

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

git checkout master
git remote add eddiewebb/bamboo-after-deployment-trigger https://bitbucket.org/eddiewebb/bamboo-after-deployment-trigger.git
git fetch eddiewebb/bamboo-after-deployment-trigger
git merge --no-ff -m 'Merged in eddiewebb/bamboo-after-deployment-trigger/issue-2-non-admin-performance (pull request #2)' remotes/eddiewebb/bamboo-after-deployment-trigger/issue-2-non-admin-performance
Author
  1. Eddie Webb
Reviewers
Description

Fixes issue #2 by eliminating getAllDeploymentProjects lookup with autocomplete against rest api

  • Uses bamboos quicksearch api to dynamically load deployment project as user types

  • removed deploymentProjects list from configurator class, but now passes existing name if set to pre-load dropdown on edit.

  • With these changes I saw no distinction between needs of ..ForEdit and ..ForView, so they both call the same shared methods to populate project ID & Name, and Environment list &ID

roundtrip.gif

(I also updated to bamboo 6.3 so I could use specs to pre-populate large volume of deploys, and eliminated fastdev/cli in favor of new quickreload approach, but neither is important to the functionality at hand)

  • Issues #2: Performance degradation for non-admin users new
  • Dependencies Checking for dependencies...
  • Dependents Checking for dependents...

Comments (8)

    1. Alexey Chystoprudov

      Thank you, I'll ask our legal department to confirm CLA signed before proceeding.

      Asterisk import is known issue, we have to change default IntelliJ configuration as part of onboarding process 🙂

    1. Eddie Webb author

      Yes, your right, it will. I can add JS side logic to filter it out while your legal team confirms. It still proved faster to use the lucene index than using the DeploymentProjectDao's string search.

      The validation errors when a build is picked (since it can't find environments) and also on save as invalid project ID.

      Edit . Fixed, see comment below

      1. Eddie Webb author

        @Alexey Chystoprudov there is no pagination as it stands. Because we are using the quicksearch REST api we are limited to the single method exposed by https://docs.atlassian.com/atlassian-bamboo/6.3.1/com/atlassian/bamboo/index/quicksearch/QuickSearchSearcher.html which returns 12 results for the current term matching user permissions. (waits for at least 3 characters, searching every change thereafter)

        I took a look at leveraging the https://docs.atlassian.com/atlassian-bamboo/6.3.1/com/atlassian/bamboo/index/IndexerService.html but would end up duplicating so much of the code from quicksearcherimpl. The other option is to use the deploymentProjectDao and query directly against the DB, exposing our own summary results but both seemed to outweigh the benefit of infinite scrolling when the user can just keep modifying their entry to get a more targeted list

        Anyway, let me know your thoughts and I can poke down either path as you see fit.