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

Keep workflows active #293

Open
delucchi-cmu opened this issue Sep 26, 2023 · 4 comments
Open

Keep workflows active #293

delucchi-cmu opened this issue Sep 26, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@delucchi-cmu
Copy link
Contributor

Github will disable workflows for inactive projects, and a project goes inactive after 60 days with no commits.

This will stop smoke tests from detecting breaking changes from upstream package updates.

One solution (which I don't like, but I'm just leaving here to show there are automated solutions): https://github.com/marketplace/actions/keepalive-workflow

Alternatively, you have to pay attention to the github notifications and re-activate workflows each time you get an alert that they're being de-activated. From @DinoBektesevic:

Every 60 days or so without a commit, you just have to go to the actions tab and press "Enable worfklow" again. The issue I have with the automatic disable isn't that it happens it's that the notifications are by default enabled just for the person that made the workflow - not all "admins" or "maintainers" of the repo. This is how sometimes these things go by unnoticed unfortunately because people don't subscribe or watch the action (which I don't think you can do). There's an email GA that can be used as a replacement I believe.

@drewoldag
Copy link
Collaborator

Long term maintainability is one of the selling points for using the Python Project Template. We should really try to find a way to keep the smoke test active in the long term.

@drewoldag
Copy link
Collaborator

@drewoldag
Copy link
Collaborator

I've looked around, and it seems like the correct path forward that would allow users to be pretty long term hands off would be use a github action that pushes an empty commit to the repo.

The github action mentioned in the first comment seems to be the most popular one that I've been able to find after searching around in the marketplace. Though to be fair, it's hard to find anything there.

I've run some tests in my personal repo, and it seems ok. It does require the user to set a particular repository setting, which is just one more thing that a user has to do to get up and running.

Aside from that though, inserting it into the smoke-test.yml file would be fairly straightforward.

name: Unit test smoke test

on:

  # Runs this workflow automatically
  schedule:
    - cron: 45 6 * * *
    
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.8', '3.9', '3.10']

    steps:
    - uses: actions/checkout@v3
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        sudo apt-get update
        python -m pip install --upgrade pip
        pip install .
        pip install .[dev]
        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
    - name: List dependencies
      run: |
        pip list
    - name: Run unit tests with pytest
      run: |
        python -m pytest
    - uses: gautamkrishnar/keepalive-workflow
      with:
        commit_message: Keeping project active with empty commit
        committer_username: keep-alive-bot
        committer_email: {user_email} # taken from the copier answers

@delucchi-cmu delucchi-cmu removed this from the Release tag 2.0 milestone Feb 2, 2024
@hombit
Copy link
Contributor

hombit commented Feb 4, 2024

GitHub sends an email before disabling smoke tests, and this email has a big green link to a page with "Continue running workflow" button. Of course it is still easy to miss the email, but I believe it is not as bad as we expected it to be

@drewoldag drewoldag removed their assignment Feb 9, 2024
@delucchi-cmu delucchi-cmu added the enhancement New feature or request label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants