Skip to content

Fix poetry not found issue in mise in Duo Workflow service

Tan Le requested to merge tl-fix-workflow-poetry-in-mise into main

Fix poetry not found issue in mise when setting up Duo Workflow service.

Running cd in non-interactive mode doesn't call the required mise shell hooks. This results in poetry command which is managed by mise to fail.

$ make duo-workflow-service/poetry-install

--------------------------------------------------------------------------------
Installing mise tools from /Users/tanle/code/gitlab/gdk/duo-workflow-service/.tool-versions
--------------------------------------------------------------------------------
cd /Users/tanle/code/gitlab/gdk/duo-workflow-service && mise install -y
mise all runtimes are installed

--------------------------------------------------------------------------------
Building duo-workflow-service/poetry-install version main
--------------------------------------------------------------------------------
support/asdf-exec duo-workflow-service poetry install
support/asdf-exec: line 23: poetry: command not found
make: *** [support/makefiles/Makefile.duo-workflow-service.mk:68: duo-workflow-service/poetry-install] Error 127

How to set up and validate locally

  1. Ensure GitLab Duo Workflow service is enabled by adding the below configuration in gdk.yml:
    ---
    duo_workflow:
      enabled: true
    mise:
      enabled: true
  2. Check out to this merge request's branch.
  3. Run gdk reconfigure to check if regenerating all configuration is successful.
  4. Run the following command to update gitlab-ai-gateway and confirm the error no longer shows.
    $ make duo-workflow-service/poetry-install                                                      
                                                                                                    
    --------------------------------------------------------------------------------                
    Installing mise tools from /Users/tanle/code/gitlab/gdk/duo-workflow-service/.tool-versions                                                                                                     
    --------------------------------------------------------------------------------                
    cd /Users/tanle/code/gitlab/gdk/duo-workflow-service && mise install -y                         
    mise all runtimes are installed                                                                                                                                                                 
                                                                                                    
    --------------------------------------------------------------------------------                
    Building duo-workflow-service/poetry-install version main                                                                                                                                       
    --------------------------------------------------------------------------------                
    support/asdf-exec duo-workflow-service mise exec -- poetry install                              
    Creating virtualenv duo-workflow-service in /Users/tanle/code/gitlab/gdk/duo-workflow-service/.venv                                                                                             
    Installing dependencies from lock file                                                          
                                                                                                    
    Package operations: 103 installs, 1 update, 0 removals                 
    --snip--

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Tan Le

Merge request reports

Loading