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

Fix CI workflow runs using manually created virtual environments #10601

Merged
merged 3 commits into from
Dec 29, 2021

Conversation

m-vdb
Copy link
Collaborator

@m-vdb m-vdb commented Dec 28, 2021

Proposed changes:

  • Create virtual environments manually in all workflows that need one (mimic'ing what we do for unit tests)
  • Update change_filters.yml to also listen to changes in workflow files
  • Introduce PR labels to invalidate poetry cache if needed

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@m-vdb m-vdb requested a review from a team as a code owner December 28, 2021 16:51
@m-vdb m-vdb requested review from virtualroot and removed request for a team December 28, 2021 16:51
@m-vdb m-vdb force-pushed the fix-docs-workflow-run branch 2 times, most recently from 554b73f to 67057b4 Compare December 28, 2021 17:08
@m-vdb m-vdb removed the request for review from virtualroot December 28, 2021 17:09
@m-vdb m-vdb changed the title add dummy commit Debug docs workflow run Dec 28, 2021
@m-vdb m-vdb force-pushed the fix-docs-workflow-run branch from 67057b4 to 45519aa Compare December 28, 2021 17:11
@m-vdb m-vdb force-pushed the fix-docs-workflow-run branch from ef09aa6 to 7717373 Compare December 29, 2021 09:54
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ env.DEFAULT_PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }}
restore-keys: ${{ runner.os }}-poetry-${{ env.DEFAULT_PYTHON_VERSION }}

- name: Clear Poetry cache
if: steps.cache-poetry.outputs.cache-hit == 'true' && contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-docs-tests')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do we document PR labels like tools:clear-poetry-cache-docs-tests somewhere? I haven't created the label yet on github (same for other new labels introduced in this PR)

Copy link
Contributor

Choose a reason for hiding this comment

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

This notion page is the closest I can find

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤔 I guess I'll just create the labels in GitHub for now, and describe them here

@m-vdb m-vdb requested review from virtualroot and tayfun December 29, 2021 10:02
@m-vdb m-vdb changed the title Debug docs workflow run Fix CI workflow runs using manually created virtual environments Dec 29, 2021
@github-actions
Copy link
Contributor

🚀 A preview of the docs have been deployed at the following URL: https://10601--rasahq-docs-rasa-v2.netlify.app/docs/rasa


- name: Set up virtual environment
if: needs.changes.outputs.docs == 'true'
run: poetry config virtualenvs.in-project true
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it correct to set this in-project option to True? As far as I can see, poetry will create a new virtualenv itself with this option and it will be overwritten by python -v venv create .venv later on I'm guessing? If not set -which is the default- it will use existing venv if available (which will exist after manual creation and if it had not existed I think poetry would be creating a new venv by default and this is handled by virtualenvs.create option).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is bypassing the creation of the venv in poetry somehow, because this is what failed before

If set to true, the virtualenv wil be created and expected in a folder named .venv within the root directory of the project.

In the case the .venv already exists (which we now enforce), I'm guessing poetry doesn't do anything (expected in a folder named .venv)

@m-vdb m-vdb merged commit 1961a91 into main Dec 29, 2021
@m-vdb m-vdb deleted the fix-docs-workflow-run branch December 29, 2021 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants