Multibranch pipeline job not showing open pull requests - github

I have configured a multibranch pipeline job in Jenkins linked to our GitHub repo which is working nicely, feeding back the status of checks to the pull request in our GitHub so we know if the branch is good for merging in.
What I don't see are any open pull requests listed against the Job in Jenkins:
We also have the Blue Ocean plugin in installed and no PR's are shown there either.
Anyone know why this is the case? Am I missing another plugin\config?

I had this issue as well. I tried what joey suggested, but that did not work. I found out that if you add PR-.+ (or PR-* as a wildcard) to your regex filter for branches to include, the pull requests "magically" appear. The documentation of this was found here. It's very frustrating that the "official" documentation for this plugin does not explain this (at least from what sparse documentation I could find). The configuration for my project, which works, is here:
I'm not sure if this is a recommended way to use this plugin for this use case, but Jenkins never seems to have ample documentation.

I was getting the same issue. But this time within Blue Ocean UI as shown below
The fix was to switch from using Git to GitHub Branch Source at the job level and configure GitHub Branch Source. The job type was Multibranch pipeline.

One possible cause could be that GitHub is unable to connect to Jenkins directly due to a firewall. This is likely the case if GitHub never reports the status check as completed, in other words, it hangs forever.
In this case, polling is an easy solution. Go to http://_jenkins_ip_:8080/job/_job_name_/configure and select the "Scan Repository Triggers" tab. Tick the "Periodically if not otherwise run" checkbox and select an interval. I have 15 minutes on mine.
The first time this is done, there should be an immediate scan and it should detect the pull request, otherwise, there might be something else going on. Check the "Scan Repository Log" page on the job, as it might have useful info.
By the way, I did not install the "GitHub Pull Request Builder Plugin" as the page says that it has a security issue. Instead, the "GitHub Branch Source Plugin" is being used. Some other related plugins installed:
Git client plugin
Git plugin
GitHub API Plugin
GitHub Authentication plugin
GitHub Integration Plugin
GitHub plugin
I'm also using Blue Ocean, but this is not required, it simply provides a different UI.

I know that this is an old topic, but I had the same issue while I was trying to visualize my Pull Requests from Bitbucket and I hope this answer will help other people in need. In my case, I was using Bitbucket Push and Pull Request Plugin, which is pretty similar to other GitHub Plugins for Jenkins.
My problem came from the fact that I selected Git instead of Bitbucket in Branch Sources >> Add Source section. I suspect the same thing happened in this case, where the two options Git and GitHub are even easier to confuse.

Related

Confused first/only time github user - do I need local copy/ies to conduct the following (msg body details)

I am not a programmer/software/dev to need to get too many git[hub] tools installed, or use anything locally, if someone could please answer for me a very simple question.
Background: the only way I could ask for some modifications for an environment I need to work on, non-software-dev related, is via what it is being described to me as a request I need to produce as described below:
go to this GitHub URL (I have a login for that)
create a branch
modify files X, Y and Z (apparently some orchestration configs) you need, as described in other instructions
commit
push
create a PR, and someone will check, approve and trigger the orchestration tool with the configs you modified, and get you what you need
Is all of the above possible using the web interface to GitHub, via my browser, without the [almost all instructions I found, so far, online, pointing to] installation of git (desktop or CLI) on my laptop, creation of a local copy of the main/master repository, then branching locally, then ... ?!?
Yes, you can do all of those things you listed out via the browser as long as you follow the steps correctly.
If you open the file in the browser you can click edit and edit the file. After you are done editing, you can type a commit message and create a pull request on a new branch.
Here you can click on create a new branch and start a pull request. It will do those things automatically.
If you have no write access of the repository it will actually directly create a fork on your account with the changes and start a pull request...

Github actions failed to deploy Jekyll website on Github pages

I have setup a local Jekyll site that is configured to deploy to Github pages. I used the "Chirpy" theme (see https://github.com/cotes2020/jekyll-theme-chirpy) and followed the instructions successfully to get it to deploy the first time.
I am trying to get my 2nd commit w/ updates to deploy but the process is failing when the Github action runs. I see this output:
This is my first attempt at any of this so don't have any perspective on what is going on w/ any of these technologies.
Thanks for any help and LMK what else might make things clearer!
It seems like after you run test.sh, you tried to switch branches. I suspect that is the problem because it doesn't appear that you tried to git reset or anything like that. I believe your test.sh ran (see these lines) so there are unstaged changes.
If you don't want those changes, you might try a git stash to easily reset. Just a thought.
So the issue was that I checked in the _site and .jekyll-cache directories. Here is the proper .gitignore entries to have the standard gh-pages branch build w/o this problem.
https://github.com/github/gitignore/blob/master/Jekyll.gitignore

View GitHub PR comments locally in PhpStorm

I generate a pull request in the company repo on GitHub. My colleagues login to GitHub, review my changes and add comments.
Is there a way from me to pull those comments (or that PR) from GitHub so I can read and, ideally respond to their comments locally from within the latest PhpStorm (version 2017.3.4) or for that matter, from the CLI?
I can see how to generate PRs in PhpStorm and push them up to GH, but not the other way around.
You might try this plugin: https://plugins.jetbrains.com/plugin/10448-github-code-reviews-plugin. In general, this is not yet supported in PhpStorm out of the box, you can vote for that feature request at https://youtrack.jetbrains.com/issue/IDEA-85079 and try out some of the suggestion listed there (e.g. the plugin mentioned above).
I'm not sure if there's something for Github, but for Bitbucket you can use this plugin.

GitHub pages are not updating

I'm running into a weird issue with GitHub pages. I pushed a new commit to my personal pages page maltzj.github.io, but the new article isn't showing up there. When I execute the server locally, a post lives at localhost:4000/posts/the-price-of-inconsistent-code/. However, when I go to http://maltzj.github.io/posts/the-price-of-inconsistent-code I get a 404. I also added a new file which should live at http://maltz.github.io/test.html, but that also throws a 404.
Everything builds and runs locally. My Git repository is up to date, and there is nothing on the GitHub status page about problems with builds, so I'm at a little bit of a loss about where to go with this. How can I get my page to update with new content that I add?
For reference, the location of the repository which backs my page is http://github.com/maltzj/maltzj.github.io
None of these solutions solved it for me. The solution was to edit the index.html file in the GitHub website.
The website then updates on the web as expected.
Go to your index.html file through your site (example.github.io/index.html) and then reload the page. Then you can go back to (example.github.io) and it should have updated. You can do the same with the master.css file, etc.
If it doesn't work, try reloading (github.com/example/example.github.io/[blob/master/]index.html) instead and it will have updated.
For others, also check the dates of your posts. I just had this problem. I'm at UTC+11 and I'm pretty sure the server is at UTC. Thus if I date my posts with my local time, the server thinks they are in the future and won't build them. Using UTC avoided this for me.
As mentioned by joao cenoura in the comments below:
you can tell jekyll to show "future" posts by adding future: true to your _config.yml
and/or add timezone: TIMEZONE to specify your timezone.
See https://jekyllrb.com/docs/configuration/ for more info.
I had an empty CNAME file. Check that if you're having a similar issue.
I had this fault today with a static page - the cause was actually a service failure at GitHub Pages itself. You can check for service messages at https://www.githubstatus.com/.
I had the problem of having an unverified email. The update worked for the first time, but it failed after that. A verified email is needed to trigger a GitHub pages build. Also a deploy key cannot be used for this, as it won't trigger a build.
Source: http://web.archive.org/web/20140712011932/https://help.github.com/articles/troubleshooting-github-pages-build-failures/
Disclaimer: this was the case in 2014. Don't know if it's still required.
I had an unclosed <a> tag which caused the build to be pending forever. Fixing that solved the issue.
It makes sense that GitHub would verify your links.
I got it to work.
Mine was a simple problem. It was a browser cache problem.
I opened my link on a different browser and it showed me the updated push.
In my case, none of above solutions works. Finally I find out the reason is: there is "relative_permalinks" option in my _config.yml. This option is recently deprecated in Jekyll 3.0.
Refer to:
https://help.github.com/articles/removing-relative-permalinks/
I know this might sound simple, but make certain you are on the right branch and in the right file.
In my case, I made a GitHub page and tried to commit from my local repository on the master branch. Also, I was updating my filename instead of index.html. These were my errors. I had to switch to the GitHub page branch and update in the index.html commit, push and then everything worked fine.
For me, I just waited ~5 minutes, and it was updated.
If someone has made the branch gh-pages from scratch (manually) the problem is that you need a file call params.json to make it work.
I don't have this params.json file, but it still works...
In my case, it happened to be that I mentioned a relative path to refer to an image, something like - ./test.png.
It seems that it's not allowed, and it may be a security issue or what. Whatever, if you've done something like that, remove it and refer to it as test.png.
In my case the problem was because of my repository was private. After I made it public, the problem has gone.
The weird part of story is that I was able to create private repository and use GitHub pages with it. I did it in accordance with the official guide (http://take.ms/p2SS7). It worked fine for about 9 commits, but on the 10-th it became broken.
I ran into the same mysterious issue today. I pushed some new code to my github.io-repository, but the changes did not show up on the corresponding webpage. I inspected the page and did not see the new code in the source. I solved the issue by doing a hard reload. On Chrome, you can do a hard reload by opening up Dev Tools and right-clicking on the refresh-button and choosing Hard Reload.
Please refer to the Jekyll troubleshooting website, as there are multiple error sources: Troubleshooting Jekyll build errors for GitHub Pages sites
In my case a German umlaut ("ö") in a Markdown file caused the problem.
In my case, I forgot to define kramdown in _config.yaml
# Build settings
markdown: kramdown
This was caused when I was converting from a theme without to a theme with the kramdown requirement.
Make sure your run
npm run deploy
Clear your browser cache.
In my case, after trial and error on some solutions here, what fixed it was adding the encoding to the _config file like this
encoding: UTF-8
More troubleshooting options here
For me it was an issue with not properly having a .gitmodules file.
I was able to troubleshoot in the settings tab of my repository, under the GitHub pages section, which indicates build issues and was helpful for troubleshooting.
Oddly (and simply) enough I created a new branch, made that branch the "default" branch and pushed from there.
This worked for me.
My GitHub Pages was turned off under the Settings tab of the repository.
I don't remember turning it off, but there it was, and turning it back on was the fix.
In the repository settings, make sure the GitHub Pages is currently being built from the gh-pages branch.
In my case, my problem was after git push my GitHub file was updating but not showing my website on GitHub pages.
Note: I was creating Website by React
Also, on the HTML project, I faced the same problem. In that case, I just did first of all git pull and then git status | git add . | git commit -m"adding some content" | and git push. It worked for me.
But in the React project, it didn't work. I run this again on my cmd npm run deploy then my React web application is showing on GitHub pages.
My suggestion is to try everything showing on this post comments. Because the solution to this problem is not one.
In my case I left an empty parameter, url, in _config.yaml.
After I've specified url: example.github.io everything started to work.
I had this problem this week and no solution worked.
I don't use Jekyll, only pure static HTML.
It just sat three days refusing to update.
Here is what I had to do to get it to publish again.
Make a snapshot branch from master.
Reset the master branch to the last commit that is live. (Commits tab, green checkmarks indicate published commits)
Make a new commit with a smoke test. I made an HTML comment I could grep.
Force push master.
Check results curl https://example.com | grep SMOKETEST
Reset master again, removing the smoke test.
Cherry-pick each commit from the snapshot branch you need to get your unpublished changes back into master (cherry-picking gives the commits new ids/hashes, avoiding the risk of anything having cached them from before).
Force push master again.
Now you should get green checkmarks and published updates.
Note: It could be enough to force push to remove the commits that are stuck and getting them back again. The smoke test is almost certainly not required. Cherry-picking may not be required.
Github doesn't publish to github pages for me if I edit and commit files directly on github web site.
However, if I edit file locally and commit with GitHub Desktop, then change is published to site within seconds.
BTW, my email is verified, so this shouldn't be an issue. And I'm using same account.
Solution worked for me for an app created using create-react-app :
Go to GitHub Pages section under repository settings
Change source from gh-pages branch to master branch
Wait and check your custom domain website, should show master branch README.md file
Now change the source back to gh-pages
Wait couple minutes, now latest changes reflected on custom domain website
I had tried different solutions, none worked. Like a new commit, an empty commit, browser cache clear, wait for 5 - 10 minutes, delete gh-pages branch and push again, edit CNAME, create a new CNAME under on master branch etc
Note: My app has no _config.yaml file, no jekyll. I'm using custom domain with https (google domains). gh-page branch auto created by package.json script deploy: "gh-pages -d deploy"
In my case, I had made a couple of changes in the index.html and style.css files but those changes were not reflecting on the Github pages. But when I updated the Readme file by adding one line the Page got updated.
Maybe you can try this, as it might work for you just like it did for me.
If you are deploying some simple HTML codes, try this:
First, go to Actions > Deploy static content to Page:
Then, click the Run workflow:
My site failed to deploy today because of a transient failure in the GitHub Pages deploy actions. The action needed to be re-run through the Actions tab for the new version of my site to appear.
The story:
I pushed new content, on a site that's purely static and doesn't use Jekyll. After many fruitless Shift-Ctrl-R reloads on Chrome, I decided to investigate. I first visited Settings→Pages for the site’s repository, and saw that no recent deploy had taken place.
Why not, I wondered? After double-checking that my push had really gone through, I clicked the word “deployed”, and was taken to a GitHub Action that had failed!
Since the error message ECONNRESET looked like a generic network error internal to GitHub’s network, and not any problem with my site, I clicked the “Re-run” button in the upper right and asked GitHub Actions to re-run the failed task. Within a few seconds it had been re-tried and had succeeded!
Lessons:
Deploys are vulnerable to transient errors.
Deploys these days happen as normal GitHub Actions that you can inspect.
The deploys can be re-tried.

GitHuB repository to remote server

Is there anyway I can push changes from my Github Repository to a remote server automatically?
I would like to deploy changes in master branch in my github repository to a remote deployment server. If possible.
I think you could achieve what you want with a Git post-commit hook. whether or not this is a wise thing to be doing is another matter entirely.
Hrm. Somehow my link to http://kernel.org/pub/software/scm/git/docs/v1.3.3/hooks.html isn't showing up, but that's what you want to read.
Okay, I might have found a solution.
Capistrano might hold the answer, although my application is non ruby.
Here's a blog post I found, and I will try to implement it.
Automated deployment