How to view google cloud build results grouped by repository - google-cloud-build

In Google Cloud Build history, there is by default a list of build which have been run recently. With this view, the status of the different builds are not visible.
How to get some "Jenkins-like" view, where I can see all builds grouped by repositories with their last run (or last few runs) and status? Is there such a feature?

Yes you can thanks to the filter field. However, it's not really userfriendly. Enter this in the filter field source.repo_source.repo_name= "github_guillaumeblaquiere_bqtoftp" for filter all repo source displayed like this in the GUI: GitHub guillaumeblaquiere/bqToFtp.
It's not very intuitive, but that works!
Then, you can compose your query as you want, with AND/OR parenthesis, = or !=. Thereby, you will be able to easily filter your status. Here an example
Last word. When your filter works on the GUI, it's the same in command line. If you need to script something, it could help!

Related

Cypress test fails but works when tested manually

I am trying to test the ability to retrieve results from a database. When running a test that logs in, navigates to the search tab and searches a word, I am getting a 401. If I go to the website, use the same log in information and do the exact same steps, it works perfectly. Here's the last few steps of the test:
cy.contains('Search').click(); //open tab
cy.contains('Search by').click();
cy.contains('Name').click();
cy.get('.search-field').type('Jane');
cy.get('.search-btn').click();
There's a drop down menu for what you want to search by, a textfield for the search word and a search button. I can't share all of the code but I can see from the video that logging in and all the following steps are performed as supposed to. What kind of things can cause a cypress test to return different results as opposed to manually performing the action? I added wait(2000)'s in between the steps but it made no difference.
Maybe there is an event that needs to be triggered before the page is able to search.
Take a look at the element you are typing into in the devtools, under the Event Listeners tab.
For example, the StackOverflow search box has an event for s-popover:show listed there - if testing that you would .trigger('s-popover:show') to fire that event and display the instruction tooltip.
So try something like this
cy.get('.search-field')
.type('Jane')
.trigger('change') // or .trigger('input')
Cypress deletes localStorage in between tests. In this case that deleted the authorization token which is why I was getting the 401. I installed this package: https://www.npmjs.com/package/cypress-localstorage-commands
After the log in I use
cy.saveLocalStorage();
And before making search
cy.restoreLocalStorage();

Collect output of script and publish it to confluence in Jenkins

I have a shell script that logs on to the given server, finds all the wars running on the same and prints their name and versions to the console.
I need to take this output and display it on a page in confluence.
I went through this plugin for Jenkins and can connect and print static stuff on the page I provide.
The output that my script creates is dynamic, how do I, say store it in a variable and use it in the: Post-build Actions -> Publish to confluence -> Wiki Markup Replacements.
I have googled around and played with Jenkins to get these results, to no avail. I have seen '/env-vars.html' page, but none of these are of use to me, for my data is dynamic.
I referred this to accomplish this task.

How can I use team city rest api to show only one build per branch for all branches in project?

I have multiple branches that are being tested under a single project and I'm currently using following command to show build statuses:
"/guestAuth/app/rest/builds?locator=project:<Project_Name>,running:any,branch:branched:any,count:20
Can limit the rest api to show just one build per branch?
Can you please be more specific? If you give us some example (e.g. "I have build configuration with builds A(steps a,b,c), B(steps d,e) , C(step f). A is from branch branch_A, B from branch_B" and so on so we have some clue how your setup looks like and what do you want to achieve.
You can check a permalinks for "latest successful build".
You can also ask for specific build status, not a whole project.

how to write queries in Hive Web Interface

I was playing around with hwi, I got it started.Now I can see the different schemas which are present. But I don't know how to query them. I tried to check hive wiki (https://cwiki.apache.org/confluence/display/Hive/HiveWebInterface) but they dont seem to have much information put over there. There seems to be a Running a query section in Walk through but it says image not found.
Anybody who has used HWI to query please suggest a way to use it.
Try these steps :
Open HWI : http://localhost:9999/hwi/index.jsp
Click on Authorize in the left pane. This will open the Change User Info section. Enter the username and hit submit to complete the authorization process. Upon successful authorization you'll see Authorization is complete at the top of your page.
Now click on Create Session, enter some session name and hit Submit.
Once you submit the session name you'll get the Manage Session screen. This is the place where all the action will take place. Come down to the Session Details section and enter a file name, say /Users/tariq/res.txt, in the Result File box. This is the file where the result of your query will get stored. If you expect your result to be very huge you can just enter /dev/null over there. Remember the result file is local to the web server. Similarly enter the error file if you wish.
Now come down to the Query box and write the query you want to execute.
Come down further to the Start Query drop down list, click on it and elect YES and hit Submit.
You should be able to see the file /Users/tariq/res.txt by now containing the result of your query. You can also view the result by clicking on View File option which will appear next to the Result File box upon the successful completion of your query.
HTH
Take a look at Hue - http://cloudera.github.io/hue/
This project is bundled with the Cloudera installation and seems to work rather well.
Best,
Sukrit

Automatically email the recent changes for a particular build in Hudson

Is there any way to send an email in Hudson which has the list of recent changes in that build?
For example
Trigger a build and if you go recent changes there we have some recent changes. Once it is success, the email should have the list of the changes that happened in that particular build. After this, say the next build fails (build fail email will be triggered), but it records the changes and these change lists also should be included in next successful build.
You'll first need to install the Email-ext plugin for Hudson.
Inside the project configuration, under Post-build Actions click the Email Notification and Editable Email Notification checkboxes. Instead of having the Content be $PROJECT_DEFAULT_CONTENT you'll want to use a different token. Those are described when you click the help icon (?) for Content Token Reference.
Specifically to your example, add (or edit if it exists) the trigger for Success. Change the Content of the success email to use the token ${CHANGES_SINCE_LAST_SUCCESS, reverse, format, showPaths, changesFormat, pathFormat}. The different options are explained in the reference. If you just want the defaults, simply use ${CHANGES_SINCE_LAST_SUCCESS}

Resources