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

The post-deploy webhook is currently only called on successful deploys #517

Open
smeder opened this issue Oct 18, 2017 · 1 comment
Open

Comments

@smeder
Copy link
Contributor

smeder commented Oct 18, 2017

Right now the post-deploy webhook is only called on successful deploys and the deploy state is not updated before calling the webhook. This causes the deploy state to always be RUNNING when the webhook is being called, so the deploy state variable substitution is currently meaningless.

@lilida
Copy link
Contributor

lilida commented Oct 18, 2017

@sbaogang While looking at the code, I think there are some inconsistencies here on how we handle the deploy event and webhooks.

  1. We notify webhook when succeeding the deploy

`

if (succeeded * 10000 >= sucThreshold * total) {
LOG.debug("Propose deploy {} as SUCCEEDING since {} agents are succeeded.", deployId, succeeded);
if (deployBean.getSuc_date() == null) {
newDeployBean.setSuc_date(System.currentTimeMillis());

            // Submit post-webhooks, if exists
            EnvWebHookBean webhooks = dataHandler.getDataById(envBean.getWebhooks_config_id(), WebhookDataFactory.class);

`

  1. In the outside function internalTransition, we trigger
    `

    if (shouldSendFinishMessage(state, newPartialDeployBean.getState(), deployBean.getSuc_date())) {
        jobPool.submit(new FinishNotifyJob(envBean, deployBean, newPartialDeployBean, deployBean.getBuild_id()));
    }
    

`

Should these two be in the same place? Should we send the notification for both succeeding and failing state?

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

No branches or pull requests

2 participants