Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-4420

Update Loraine Lab IGB app repos to use EMAIL, TOKEN repo variables

    Details

    • Type: Task
    • Status: To-Do (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Bitbucket wants us to migrate to using tokens with scoped permissions in our pipeline scripts.
      For this task, let's update all the IGB App repositories in the lorainelab workspace in bitbucket to use two new repository variables: TOKEN and EMAIL.

      The TOKEN should be a scoped bitbucket token with scope write:repository:bitbucket. The EMAIL should correspond to a user with write permissions for the Loraine Lab workspace. Currently, that is [~ann.loraine] only. Someone will need to update all the IGB App repositories' repository variables to have TOKEN and EMAIL.

      Strategy:

      For each repository:

      Note that bitbucket is changing it's forking rules. I don't know how this will affect our usual workflow of submitting PR's from forks.

        Attachments

          Issue Links

            Activity

            aloraine Ann Loraine created issue -
            aloraine Ann Loraine made changes -
            Field Original Value New Value
            Epic Link IGBF-2323 [ 18477 ]
            aloraine Ann Loraine made changes -
            Link This issue relates to IGBF-4419 [ IGBF-4419 ]
            aloraine Ann Loraine made changes -
            Description For example, see monster alignments app. Bitbucket wants us to migrate to using tokens with scoped permissions in our pipeline scripts.
            For this task, let's update all the IGB App repositories in the lorainelab workspace in bitbucket to use two new repository variables: TOKEN and EMAIL.

            The TOKEN should be a scoped bitbucket token with scope write:repository:bitbucket. The EMAIL should correspond to a user with write permissions for the Loraine Lab workspace. Currently, that is [~ann.loraine] only. Someone will need to update all the IGB App repositories' repository variables to have TOKEN and EMAIL.

            Strategy:

            For each repository:

            * Edit the bitbucket pipeline YML to use TOKEN and EMAIL
            * As an example, see: https://bitbucket.org/lorainelab/reads-without-large-gaps/src/main/bitbucket-pipelines.yml

            Note that bitbucket is changing it's forking rules. I don't know how this will affect our usual workflow of submitting PR's from forks.

            Hide
            aloraine Ann Loraine added a comment -

            Can I use the bitbucket API to list all repositories in the IGB Apps project?

            Show
            aloraine Ann Loraine added a comment - Can I use the bitbucket API to list all repositories in the IGB Apps project?
            Hide
            aloraine Ann Loraine added a comment - - edited

            Yes.

            https://support.atlassian.com/bitbucket-cloud/kb/get-repository-list-within-project-by-using-api/

            Do this:

            curl 
              --request GET 
              --url "https://api.bitbucket.org/2.0/repositories/{workspaceID}q=project.key%3D%22{ProjectKey}%22"    
            --user <atlassian_account_email>:<api_token>
            
            Show
            aloraine Ann Loraine added a comment - - edited Yes. https://support.atlassian.com/bitbucket-cloud/kb/get-repository-list-within-project-by-using-api/ Do this: curl --request GET --url "https: //api.bitbucket.org/2.0/repositories/{workspaceID}q=project.key%3D%22{ProjectKey}%22" --user <atlassian_account_email>:<api_token>
            Hide
            aloraine Ann Loraine added a comment -

            IGB App project key: IAQ

            command:

            curl --request GET --user aloraine@gmail.com:ATATT3xFfGF03wVNLq-4gdtS1e2RBXkbY-p8yC3s_Lshq2euDXixlV-gB7ZyxCQurmVyErcT9BJMaxPNHbAr37rUrwIp0SPp7D-viJS4MToJ1D92YU877oWePqmuI4p_loegU34zh8WZRETfKO_XvvKnusqS_YncmL93dBuFGiwyZaVDC6g-ZnA=606EC42C --url "https://api.bitbucket.org/2.0/repositories/lorainelab?q=project.key%3D%22IAQ%22" > igb-app-repos-listing.json
            

            response: see attached file

            Show
            aloraine Ann Loraine added a comment - IGB App project key: IAQ command: curl --request GET --user aloraine@gmail.com:ATATT3xFfGF03wVNLq-4gdtS1e2RBXkbY-p8yC3s_Lshq2euDXixlV-gB7ZyxCQurmVyErcT9BJMaxPNHbAr37rUrwIp0SPp7D-viJS4MToJ1D92YU877oWePqmuI4p_loegU34zh8WZRETfKO_XvvKnusqS_YncmL93dBuFGiwyZaVDC6g-ZnA=606EC42C --url "https: //api.bitbucket.org/2.0/repositories/lorainelab?q=project.key%3D%22IAQ%22" > igb-app-repos-listing.json response: see attached file
            aloraine Ann Loraine made changes -
            Attachment igb-app-repos-listing.json [ 19153 ]
            aloraine Ann Loraine made changes -
            Description Bitbucket wants us to migrate to using tokens with scoped permissions in our pipeline scripts.
            For this task, let's update all the IGB App repositories in the lorainelab workspace in bitbucket to use two new repository variables: TOKEN and EMAIL.

            The TOKEN should be a scoped bitbucket token with scope write:repository:bitbucket. The EMAIL should correspond to a user with write permissions for the Loraine Lab workspace. Currently, that is [~ann.loraine] only. Someone will need to update all the IGB App repositories' repository variables to have TOKEN and EMAIL.

            Strategy:

            For each repository:

            * Edit the bitbucket pipeline YML to use TOKEN and EMAIL
            * As an example, see: https://bitbucket.org/lorainelab/reads-without-large-gaps/src/main/bitbucket-pipelines.yml

            Note that bitbucket is changing it's forking rules. I don't know how this will affect our usual workflow of submitting PR's from forks.

            Bitbucket wants us to migrate to using tokens with scoped permissions in our pipeline scripts.
            For this task, let's update all the IGB App repositories in the lorainelab workspace in bitbucket to use two new repository variables: TOKEN and EMAIL.

            The TOKEN should be a scoped bitbucket token with scope write:repository:bitbucket. The EMAIL should correspond to a user with write permissions for the Loraine Lab workspace. Currently, that is [~ann.loraine] only. Someone will need to update all the IGB App repositories' repository variables to have TOKEN and EMAIL.

            Strategy:

            For each repository:

            * Edit the bitbucket pipeline YML to use TOKEN and EMAIL, merged into the lorainelab repo
            * Add repository variables TOKEN and EMAIL to every repository
            * As an example, see: https://bitbucket.org/lorainelab/reads-without-large-gaps/src/main/bitbucket-pipelines.yml

            Note that bitbucket is changing it's forking rules. I don't know how this will affect our usual workflow of submitting PR's from forks.

            Hide
            aloraine Ann Loraine added a comment -

            Manually updating repository variables is going to be a huge pain in the neck, especially when or if I need to update the token! I looked for a way to automate this and found this:

            https://medium.com/@matiasquin/devops-wizardry-turning-bitbucket-variable-chaos-into-automation-bliss-18f392f89a70

            Show
            aloraine Ann Loraine added a comment - Manually updating repository variables is going to be a huge pain in the neck, especially when or if I need to update the token! I looked for a way to automate this and found this: https://medium.com/@matiasquin/devops-wizardry-turning-bitbucket-variable-chaos-into-automation-bliss-18f392f89a70

              People

              • Assignee:
                Unassigned
                Reporter:
                aloraine Ann Loraine
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: