cypress-io / cypress-documentation

Cypress Documentation including Guides, API, Plugins, Examples, & FAQ.
https://docs.cypress.io
MIT License
938 stars 1.04k forks source link

Contentful hook caused failded build #2104

Closed KateAbramova closed 3 years ago

KateAbramova commented 4 years ago

I'm submitting a...

[X] Bug report
[ ] Content update
[ ] Process update (build, deployment, ... )

Type of bug / changes

Contentful webhook gets 201 response and circle-ci build fails.

https://circleci.com/gh/cypress-io/cypress-documentation/15933

KateAbramova commented 4 years ago

@amirrustam according to the activity log in Contentful 2019-10-10 16 37 43

the webhook is working and triggers CircleCI deploy process, but the pipeline fails because the required 'Enable pipeline' settings are incomplete and this is what we get:

https://circleci.com/gh/cypress-io/cypress-documentation/16281

And we do not have those settings available within given permissions. We are not aware of the correct flow within cy_scripts that's why requested Gleb's input.

bahmutov commented 4 years ago

pipelines are enabled for this project, so it is probably the second reason in the error

* Cannot find a job named `build` to run in the `jobs:` section of your configuration file.
If you expected a workflow to run, check your config contains a top-level key called 'workflows:'

circle.yml does have the job named build and workflows: key, so the error makes no sense to me. What about previous workaround: instead of triggering CircleCI workflow from API (which to me still seems completely broken and not working) why not use empty commit to master branch approach?

KateAbramova commented 4 years ago

@Gleb @amirrustam

The main goal was automatization of deploy process and that's what we tried to reach. If we simply use empty commit to master branch approach, there will be no automatization and someone with the permission (we do not have such) will need to run the command instead of pressing the button to deploy in CircleCI.

amirrustam commented 4 years ago

@KateAbramova if you trigger the Contentful again what's the latest response from Circle? I'm thinking these Circle errors are transient issues on their end.

KateAbramova commented 4 years ago

@amirrustam the latest response from Circle is 201

here is a link where you can see the whole response body: https://app.contentful.com/spaces/o4py2sm8hjzh/settings/webhooks/0Xs8eX9rb5LlAMeakdZzHF/call/6XnndiDHgc2a4EGc6KEwyY

amirrustam commented 4 years ago

Please include on the CircleCI build status and other details here. It's not efficient for me to go hunt all the details as you iterate.

KateAbramova commented 4 years ago

@amirrustam @bahmutov Presumably this is the core issue for build failure
https://circleci.com/docs/2.0/api-job-trigger/ Note: Triggering jobs from the API is not supported with v2.1

We created a test hexo project, connected to circle and made API call, got the same error. Downgrade to version 2 in circle.yml made it work, so the question is wether any specific 2.1 version features are being used (orbs, etc.). If no, than the easiest solution is to downgrade the version, if yes - we'll think about another workaround solution.

bahmutov commented 4 years ago

Why an empty commit solution would not work? It would trigger build on master

Sent from my iPhone

On Oct 18, 2019, at 10:59, Kate Abramova notifications@github.com wrote:

 @amirrustam @bahmutov Presumably this is the core issue for build failure https://circleci.com/docs/2.0/api-job-trigger/ Note: Triggering jobs from the API is not supported with v2.1

We created a test hexo project, connected to circle and made API call, got the same error. Downgrade to version 2 in circle.yml made it work, so the question is wether any specific 2.1 version features are being used (orbs, etc.). If no, than the easiest solution is to downgrade the version, if yes - we'll think about another workaround solution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

KateAbramova commented 4 years ago

yes, it would, but it won't be automatization

@gleb @amirrustam

The main goal was automatization of deploy process and that's what we tried to reach. If we simply use empty commit to master branch approach, there will be no automatization and someone with the permission (we do not have such) will need to run the command instead of pressing the button to deploy in CircleCI.

bahmutov commented 4 years ago

I don't understand how making an empty commit would not trigger a CircleCI full build?

KateAbramova commented 4 years ago

@bahmutov @amirrustam As far as we are concerned, empty commits can be made via make-empty-github-commit package that was added to the project and GitHub account with the permission to merge to master and develop branches.

This can be conducted manually via the terminal in the current project or running some server/lambda function with this package with the necessary process.env.TOKEN acquired.

But manually would not be an automation, and lambda inside Netlify/Amazon account with general access to many people is insecure, because env variable TOKEN with such level of GitHub rights will be shown to all who have access to Netlify/Amazon account.

Circle-ci api v2.1 doesn't work for external web hooks, that's why making commit using it as well as starting jobs or workflows, is impossible. API fails on request, so the issue is not in a job and most obviously there won't be a possibility to run a separate job via empty commit and execute it.

If there's some possible secure rebuild automation option missing, please share.

jennifer-shehane commented 3 years ago

Closing due to inactivity.