AWS codebuild not building my github pull requests - amazon-web-services

I have set up the AWS codebuild to my github repo, but unfortunately my pull requests are not being built. Only the commits.
According to the AWS codebuild documentation, the pull request builds should be supported natively.
I have checked the option to run the build whenever the code changes.
Is this feature supposed to work seamlessly? I can see github actually sends webhooks upon PR with:
X-GitHub-Event: pull_request
but nothing happens on AWS codebuild side..
how can i troubleshoot this?

Can you look at the response you're getting from back from AWSCodeBuild this should be in Repository -> Settings -> Webhooks -> https://codebuild.#{region}.amazonaws.com/webhooks. From here you can scroll to the bottom of the page and look at Recent Deliveries.
Could you let me know the latest output from a PR.
John

Related

AWS full-stack react app. Build failed to complete successfully

I'm trying to make an SPA in React with AWS.
While I was going through the basic steps here (Step 3 ADD AUTHENTICATION ) :
I deployed the changes to the live environment, but the build failed.
I'm getting this error.
Can anyone please explain to me what caused this error?
This seems to be a known issue in the Amplify GitHub and can happen when the Amplify CLI version used by the Amplify Console is mismatched with the version you are using locally. Here is some more information: https://github.com/aws-amplify/amplify-cli/issues/6117#issuecomment-794176834
Compare your Amplify App -> Build Settings -> Build image settings -> Amplify CLI version with your version installed on your development machine by running amplify --version
Other than checking for version matching, I also have found out if amplify backend doesn't have a role attached to it, the built process is going to fail. to do that you follow the link bellow directions: https://docs.aws.amazon.com/amplify/latest/userguide/how-to-service-role-amplify-console.html
However, before that, go to the General tab under App settings to see if the role is empty or not. You might already have a role, if not follow that link.

Jenkins job status on GitHub

Scenario: When a PR is created in GitHub, it will trigger a Jenkins Multibranch pipeline to execute CI for the fork and will post the Jenkins job status on GitHub PR page for that fork.
Jenkins job is getting triggered automatically with the help of GitHub personal access tokens and Webhook. But Jenkins job status is not shown/posted anywhere on GitHub. Getting below error:
"Could not update commit status, please check if your scan credentials belong to a member of the organization or a collaborator of the repository and repo:status scope is selected
GitHub has been notified of this commit’s build result"
Tried to post status using "GitHub autostatus" plugin, as per console output, getting below:
Console output snippet
Tried ignoring GitHub Hooks problems and others. Note: I am admin of the repo, still facing this issue.
I'm the author of the Github Autostatus plugin.
I think the problem is that whichever user ID Jenkins is using to run the job needs to be added to your github repo as a collaborator. If you open "Configure" from the project in Jenkins representing your github org, you should have a user configured that has access to github, e.g.
That user needs access to your repo - the easiest way to do that is add them as a collaborator in github

Postman & Github Integration

I am using GitHub repositories to back up my Postman collections in the form of JSON format.But, I am unable to integrate GitHub & Jenkins directly. Please confirm, Is there any way by which latest code which I have committed in GitHub in the form of JSON , can automatically get executed through Jenkins ?
Yes you can.
All you need to do is configure Jenkins to listen to changes on your Github repository.
The you can follow this guide or read up any of the numerous ways in which teams are using Postman with Jenkins.

AWS CodePipeline recognizes my new GitHub commit fine - but how?

I am currently fiddling around with AWS CodePipeline for the first time and set up the Source and the Build step so far with a demo project.
I have connected the Source Step with a GitHub account (a system-account we use), with admin access to all Repos. As the documentation states, the OAuth-scopes admin:repo_hook and repo are required for this to use; which are granted and the connection is fine.
As the title of this question already states: The integration works just fine - when I push a new commit on master to GitHub, the Pipeline starts working and runs through smoothly.
My question however is: How? As the docs state here:
To integrate with GitHub, AWS CodePipeline uses OAuth tokens
however, when looking in my GitHub settings, I would have expected to find the application listed as an "OAuth application" directly on the Repository or on the organization "OAuth applications", but neither is the case!
Thus, I am wondering how CodePipeline recognizes my new commit. Is it polling the SCM or some other sort of magic? I did not find any WebHooks either.
Thank you in advance!
AWS CodePipeline is connected to GitHub via the new "Integrations" concept: https://github.com/integrations/aws-codepipeline
This concept was announced here: https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/
GitHub Integrations authenticate using JSON Web Tokens and private/public keys, so I'm not sure if AWS are technically correct in describing that as "OAuth" or not. Details here: https://developer.github.com/early-access/integrations/authentication/#as-an-integration

How do you sync Postman with a git repository

I'm wondering how you can sync your Postman config with a git repository.
I know you can export and import from Postman to a folder - which is OK - but I wondered if there was something more effortless.
I'm not exactly sure how you're trying to use this, but a few options would be:
First Option
to use their addon cli called newman. You can run collections from a URL or Local file with newman using
newman run http://some.url.here
Then if you make the remote url a part of a git repository it would obviously update/change with each commit/pull
Second Option
Try this with extreme caution and only if you feel comfortable with the process, also this may not be compliant with their terms of use so I don't suggest you try it without first some research
If you can find the directory in which the Postman collections are held, you could create a hard link with the command line from a git repository on your machine to the directory or specific file you need to link. Whenever you change the source file the one in the Postman config will change.
The way in which you accomplish this will depend on the system you use and version of Postman.
In addition to exporting and cloud syncing as mentioned in the other answers, there's some other options too.
Postman added a Git sync in Postman app v9 so you can manage version control with forking, merging, and pull requests.
There are also built-in integrations to sync your Postman collections with GitHub, with GitLab, and other services for version control. These integrations are for users on the paid plans.
Postman also has an API so you can GET and run the latest version of your collection, environment, or whatever using Newman or continuous integration tools or to build your own integration.
Postman is not designed for that case. They offer a cloud service which keeps you and your collaborators in sync. You can try their cloud plan for 30 days for free. Check here: https://www.getpostman.com/cloud_trial_faq
You can use Postman integrations (Home > Integrations) to link Postman to your remote git repository.
The following article explains how to integrate your gitlab repo to Postman:
https://learning.postman.com/docs/integrations/available-integrations/gitlab/
Also you can use Postman API versionning to do something similar:
https://learning.postman.com/docs/designing-and-developing-your-api/versioning-an-api/
For non-free plans, Postman now (version 9 and up) supports automatic sync of collections with a git repository on several popular git services.
(Again, it's currently only available for paid plans)
See the documentation for how to integrate Postman with GitHub, GitLab and Bitbucket.
The process is roughly:
create a dedicated repo on your git provider (e.g. my-postman-collections-repo)
create a personal access token for the provider (e.g. GitHub) with the expected scope (e.g. repo and user)
define an integration (using postman UI) for each collection you want to be kept in sync
I'm working with the GitHub integration and it works great.