Aws code build not using latest commit on pull request merge - github

I am using AWS CodeBuild to build a JAR file whenever a pull request is merged into the master branch.
I have configured the source provider to be github, source version to be the master branch and Event type to be PULL_REQUEST_MERGED. However, when I merge a feature branch into master, CodeBuild uses the latest commit from the feature branch instead of the latest commit from the master branch.
For example, the current state of the master branch is A -> B -> C, and the feature branch is A -> B -> D -> E. After merging, the master branch will be A -> B -> C -> F. CodeBuild is using commit E to build the JAR file instead of commit F from the master branch. What could be causing this issue?

Related

How to automate creating pull request for same fixes in multiple repositories

We have 5 repositories A, B, C, D, and E, each repository has a master branch. I want to add the word "fix" to the master branch of each repository from the single fix branch. How this can be automated to create a "fix" branch from the master branch for all repositories and add the word "fix" into the fix branch and then create a pull request for all repositories.

Merging branches with Pycharm using Github repo

What is the correct way to merge two branches of a Github project with Pycharm?
Suppose there is a branch in a Github project called master and I clone the repo with Pycharm. After that, I create a new branch dev by using Pycharm. The new branch is then shown correctly on Github and some commits are made to the branch.
Now, I want to merge the changes from the dev branch to the master branch.
For ordinary git (not Github) projects, I would checkout to the local master in Pycharm, click on dev in the local branch and select the merge context menu. As a result, dev would be merged to master such that it can be safely deleted.Though, even after I merge the local master with the remote master branch, no changes are shown on Github and both branches still exist.
I also tried to close Pycharm, do a pull request on Github, merge the branches there and restart Pycharm. Unfortunately, Pycharm doesn't even recognize that the remote dev branch has been deleted.
My subpar solution has been as follows:
Pycharm: Merge local dev to local master, delete local dev, merge local
master with remote master
Github: Create PR, merge branches, delete dev
Pycharm: Delete remote dev
Now, if I rebase onto the remote master in Pycharm, I get the correct merged branch. Unfortunately though, using the compare context menu, Pycharm still shows that the remote master compared to the local master doesn't have the commits from dev. Although a rebase from the remote master contains all the commits from dev...
Sadly, there's also no Pycharm manual for merging branches with Github (for normal git there is). Any idea?
The solution is to manually push your branch merge as it seems that pycharm doesn't do this, but it thinks it has.
I've noticed the same issue and it seems that the merge is not pushed from the local copy. In a command shell I checkout the master branch of my project and it tells me that I am ahead of online repository, so to resolve this I issue the git push command and then when I check github it has been uploaded.
(tf36) E:\git\alpha-zero-theputernerd>git checkout master
Already on 'master'
A src/alpha_zero/env/env_inherit_from.py
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
(tf36) E:\git\alpha-zero-theputernerd>git push
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/theputernerd/alpha-zero-theputernerd.git
bb60325..37c3c9d master -> master

Github: use my freshly commited new features while waiting for my pull requests to be merge

Contributing to a public project on Github, I made a fork.
Then I created a new branch (b1) to commit some features and I sent a pull request.
Then I did the same for completely different features: create a new branch (b2 from master), commit some modifications and send a pull request.
While I am waiting for my 2 pull requests to be accepted, I would like to use those modifications which are in branches b1 and b2.
What is the best/easy way to achieve that?
Merging b1 and b2 into master? But master won't be the same as upstream/master and if I create new branched they will include changes from b1 and b2
Create a new temporary branch to merge b1 and b2? But I need to keep this branch up to date with master until all my pull requests will be accepted
Create a new temporary branch to merge b1 and b2?
Yes: you should not modify a branch in use in the original repo, and always isolate your work in a dedicated branch.
If at any time you want to keep that new integration branch (for b1+b2) up-to-date compared to upstream/master, simply rebase it on top of a refreshed upstream/master:
cd /path/to/my/repo
git remote add upstream /url/of/original/repo
git checkout b1_b2
git fetch upstream
git rebase upstream/master

How to config Jenkins to build any branch whenever it committed to GitHub

I'd like to config jenkins that builds any branch whenever it committed to GitHub.
I did as below:
At Source Code Management, I chose Git and Branch Specifier was **
At Build Triggers, I chose Build when a change is pushed to GitHub
I tried to commit to branch (ex: fixBugAAA), but jenkins built all branches.
What did I do wrong? I just need to build only one branch I committed (ex: in this case fixBugAAA). How to do that?
Thanks.

Eclipse EGit Automerge commits to master to other branches

I'm working since a half year with Egit and Github, and it works quite well. My workflow works with many different Branches, where every new feature or Bugfix is a new branch which will be merged into the master branch when finished. My question is, is it possible to apply the changes in the master branch to all other active branches. Thanks.
Have you tried:
1) Switching to the branch in your local eclipse (right click project name -> Team -> switch to -> your branch)
2) Then doing a fetch from upstream (Team -> Fetch from upstream)
3) Then doing a merge from master (Team -> Merge -> click origin/ master)
This will merge all changes from master into your current checked out branch. Then you can just commit and push. Ultimately you can also replace steps 2 & 3 with a pull (Team -> Pull) as well if it is configured. I am not sure if there is an easier way, but you would do this for each branch you want updated.