Jenkins having problems when building github pull requests - scala

I have Jenkins setup for a scala/sbt project on github.
Everything seem to be working fine, except that the build being shown for Pull Request is done for the master branch (not for the branch which might be be merged).
Anyone has faced this problem before? Any advice / suggestions?
PS. Unfortunately the repo is not public and I can't provide direct link. Although I can add logs and more details, if you think its gonna be useful.
Note: The PR I was referring to was the PRs from forks.

Related

Docusaurus Build and Deployment with GitHub Actions

I made a GitHub action in order to build and deploy my docusaurus site on a GitHub page following the docusaurus documentation.
When I make a modification in one of my project file, the GitHub action works well, the pipeline works, the branch master has been updated and the gh-pages branch too, but when I refresh my GitHub page, the modification is not displayed.
Does someone know what could be the issue? I saw that the issue could come from the use of GITHUB_TOKEN?

Why is Github not picking up my contributions once I've connected my application to Netlify?

I've deployed an app on Netlify through continuous deployment by linking a single Github repo. I had previously been making commits to the project locally, and my contributions were being tracked for this repo. However, now that I've linked the repo to Netlify, it seems no commits or contributions I make are picked up by Github. The commits can still be seen in the Github repo and commits are updated, but the contributions no longer are tracked despite them working previously.
For some context I've checked the Github help page on contributions:
https://help.github.com/en/github/setting-up-and-managing-your-github-profile/why-are-my-contributions-not-showing-up-on-my-profile
And cannot see what rule I've violated; I'm working on this on my own, it's a standalone repo, etc etc. considering they were being tracked before for the same repo, I'm confused as to what has changed now that Netlify has been integrated.
Any help/guidance appreciated
So it had nothing to do with Netlify, but my work Mac did not have me globally installed as the commit author with my email. After that, all previous authors were wrong as being my local computer email.
To get around this I followed this tutorial to replace all previous commits with the correct author: How do I change the author and committer name/email for multiple commits?

My GitHub repository is updated but my published GitHub page won't update. Why is this?

Similar questions have been asked but I haven't been able to find my answer:
My site is fine locally and all the correct files seem to be on my GitHub, but my published site (https://username.github.io/project) is still only showing my first intitial push.
Can someone direct me to troubleshoot?
From "Configuring a publishing source for GitHub Pages"
make sure you have enabled GitHub Pages to publish your site from master or gh-pages
or that you are one a master branch, subfolder docs.
Then you might need to wait a minute or two before seeing those pages rendered.

How to create a Production branch from a Git repo

We have a GitHub project (master), every member of the team have a Fork of the project into their own repository.
Once a developer fixed something he create a new branch inside his local forked repo and commit that into remote repository and after that they request a Pull Request so that change go into the master reposiroty.
We publish to production "manually" once a week but we have had issues in production because accidentaly developer had committed to their forked repository and other developer with higher privilegies accept the changes and merge that into master repo, then someone else publish to production and he didnt knew that those new changes didn't passed to QA process.
So, what I want is to create like a Production Repository, so when we have the code in master repo that we know is stable and working then create like a Production branch so if by mistake something is commited and merge into master repo then the code for production publish is not affected.
Any clue or best practice to do this?
Not sure I'm understanding the question correctly, but you can add as many remote repositories as you like. There is a section in the Pro Git book called Working with Remotes that discusses this thoroughly.
In my experience, separating development and production code is typically done with a branching model such as git-flow. You can create separate repositories to solve this problem if you like, but doing so is unnecessary. This is because if developer A submits a PR that's merged by developer B, then developer C will get a non-fast-forward error when they try to commit upstream. This is called a subversion-style workflow. Per the docs:
Git will not allow you to push if someone has pushed since the last time you fetched, so a centralized model where all developers push to the same server works just fine.
If commits to the upstream branch are not being fetched and merged appropriately before pushing, then someone has likely taken it upon themselves to rewrite history.
Your git workflow is good enough to take care of this issue.
First, to fix the issue:
Treat unintended code push as bug and fix it as you would fix any other bug. Best person to perform this activity would be the developer who pushed that code. Developer can just fix it in their fork and submit a pull request. Try not to add any other unrelated code with this pull request.
About Production Branch or Repo:
I don't think you need another Production Branch/Repo (you already have one). As it happened with your current PROD repo, accidental code push can make it to new Branch/Repo too.
Instead use tags/releases feature in GitHub. Whenever state of code in master repo is prod ready, tag it and use the tag for production publish.

GitHub issues as separate repo?

There's already an API for GitHub issues, but has anyone succeeded in making it two-way? That is:
git clone git#github.com:user/repo.issues.git # Like for wiki
editor repo.issues/1.json
git push -u origin master
And voilĂ , a new/updated issue #1!
It could use a pre-receive hook to validate before accepting any pushes, so invalid formatting shouldn't be a problem.
In other words, is there some way to handle the issues of a GitHub project as another GitHub repo?
Aside from using the API, I don't see how this can be done cleanly.
You could put together a (custom) monstrosity that updates a separate GitHub repo with all the issues in said repo at a predefined interval (using the API), but given the effort involved, this better be worth it to you :)