Skip to main content

How to use URLs with Apache Yetus.

Another great advantage of Yetus is we can check files from it’s URL. 
 I have explained how to use Apache Yetus for checking local patch files in my previous article.
(https://goo.gl/7ZxrNA).
For example we have a patch file in https://patch-diff.githubusercontent.com/raw/apache/incubator-rya/pull/45.patch and we can check it directly with Yetus.

In this article I’m going to explain how to how to use URLs with Apache Yetus.

First we have to set-up Yetus in our pc (as explained in my previous article).
For Yetus we have to use Github projects always. Otherwise we get an error message,
ERROR: /your/project/location is not a git repo.

So when we check patch files, we have to download/clone the particular project from Github. Here I’m using Apache Rya project.  
After this checking process some text files and log files automatically get saved in our pc. So we have to specify a location for this. Otherwise they will be saved in our our home directory and look like a mess.
Selection_021.png

Now ,
  • the github project is in “/home/amila/rya/new-rya-builds3/incubator-rya/”
It is not safe to test the files from your working repository. So i recommend that you use another project location for testing.

  • patch file url-  https://patch-diff.githubusercontent.com/raw/apache/incubator-rya/pull/45.patch
  • The extracted Yetus files are in “/home/Installs/yetus-0.4.0/”
  • The directory for outputs “/home/amila/incubator-rya”
Now all is set for testing the first patch file.
  • Open the terminal
  • cd /home/Installs/yetus-0.4.0/bin
  • Run the command
./test-patch --basedir=/home/amila/rya/new-rya-builds3/incubator-rya --patch-dir=/home/amila/incubator-rya https://patch-diff.githubusercontent.com/raw/apache/incubator-rya/pull/45.patch

Here   --basedir refers to the directory of github project and after that the directory of the patch file.
         --patch-dir  refers to the directory of output files.
Selection_022.png

In this the program checks only the compilation of the patch file. No xml issues or whitespace issues are indicated. So the output will be Success.Selection_023.png

But if we check the patch fill with --plugins=all  the program will check the patch file with it’s xml issues as well.
So we need to add the --plugins=all option to the previous command.
New command is
./test-patch --basedir=/home/amila/rya/new-rya-builds3/incubator-rya --patch-dir=/home/amila/incubator-rya --plugins=all   https://patch-diff.githubusercontent.com/raw/apache/incubator-rya/pull/45.patch

The output is as follows. It specifies all the areas of the patch file.
Selection_024.png

Comments

Post a Comment

Popular posts from this blog

Introduction

Hi all, I'm Amila Madushan Wijayarathna from Galle, Sri Lanka. I'm currently studying  as an IT student at Faculty of Information Technology, University of Moratuwa. I like to build up my career in Software field, because I found it very interesting and challenging. My future ambition is to be a talented professional in Software field and serve my country and world. In this blog I hope to share my ideas about this field and much more.

Apache Yetus for pre-commit checks

What is a pre-commit check? Pre-commit check is a procedure from which the source code or any other patch file can be analysed before pushing it to the main development branch, without having to publish the results on any server. We can get a quick feedback on our modifications from this method. Apache Yetus Apache yetus is an open source toolkit