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

Default behaviour for auto_inactive doesn't work as expected #92

Closed
NickGraham101 opened this issue Mar 16, 2022 · 7 comments
Closed

Default behaviour for auto_inactive doesn't work as expected #92

NickGraham101 opened this issue Mar 16, 2022 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@NickGraham101
Copy link

After upgrading from v0.6.2 to v1 we encountered a rate limiting issue with the default settings of, I've discussed this further here.

We attempted to resolve this by changing override to false and relying on the default setting of true for auto_inactive however this was only partially successful. We no longer get rate limited because there are no API calls being made to update the inactive deployments. However the status of the previous deployments are not getting updated, I believe this is because all deployments are now created with transient_environment: true.

As per the docs:

When you set the state of a deployment to success, then all prior non-transient, non-production environment deployments in the same repository with the same environment name will become inactive.

I created a simple pipeline here which shows the multiple active deployments here.

Is it possible to make transient_environment a configurable value again?

@hudovisk
Copy link

Sharing the problem we are facing here:

Error: unexpected error encountered: HttpError: Validation Failed: {"resource":"DeploymentStatus","code":"custom","message":"This deployment has reached the maximum number of statuses."} - see logs for more information

I believe this is due to how override works, it is fetching for all deployments of a given environment and updating its status:

: found 100 existing deployments for env
: setting deployment (***************) state to "inactive"
..... (100 more lines)

I think the solution @NickGraham101 mentioned would work for our use case also.

@nilampatel-engineer
Copy link

what is the solution, could you please share? as I m also facing similar issue

@CumpsD
Copy link

CumpsD commented Apr 6, 2022

We are hitting this This deployment has reached the maximum number of statuses. error too. Had to disable this action for now.

@groundfloorwebb
Copy link

groundfloorwebb commented Apr 14, 2022

Thanks for the suggestion @NickGraham101 , I was hitting the same issues and disabling override on my finish actions appears to have done the trick. You saved my a whole pile of confusion, appreciate it.

@nilampatel-engineer here's what my solution looked like in the end, i hope this clarifies things for you.

      - name: update deployment status
        uses: bobheadxi/deployments@main
        if: always()
        with:
          step: finish
          token: ${{ secrets.GITHUB_TOKEN }}
          status: ${{ job.status }}
          deployment_id: ${{ steps.deployment.outputs.deployment_id }}
          env: ${{ steps.classify.outputs.environment_key }}
          env_url: "https://${{ steps.GET_TF_OUTPUT.outputs.DOMAIN }}"
          desc: "Pull request env update"
          override: false

Just to be clear the fix was adding override: false.

@kroehre
Copy link

kroehre commented Apr 19, 2022

I'm also seeing this issue. override: false stops the errors but all previous deployments remain active. It seems as though the action tries to mark all past deployments inactive, including the many that are already inactive.

@bobheadxi
Copy link
Owner

Hey everyone, unfortunately, I haven't been able to take a look at this and probably won't have the bandwidth to actively maintain this project for the time being. If someone finds a good way forward I would appreciate a PR!

If anyone is open to helping me maintain this project I'd be super grateful and happy to chat, please reach out to me via twitter, email, or #103! 🙏

@bobheadxi bobheadxi added bug Something isn't working help wanted Extra attention is needed labels May 10, 2022
bobheadxi added a commit that referenced this issue Jun 22, 2022
#92 Mentions errors regarding deployments having the max number of statuses already set.

This PR avoids this from happening, by only setting the status if the status isn't already "inactive".

Co-authored-by: Robert Lin <[email protected]>
@vhatsura
Copy link

fixed with #104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants