 Welcome, it's the 5th of May, 2022. This is the Pipeline Help Shikot Africa Contributon Project. And we're limited on our time today, so we're going to focus on one specific item unless Afi or Sophia, are there questions that you have other than questions we had from the previous session? So how to find the locations that need more pipeline help seem to be the biggest challenge? And I think I've got an answer for that. So I wanted to give that answer. Are there other questions you wanted to ask before we get into that answer? No for me. Okay. All right, great. So here's the how to find locations that need more pipeline help and more importantly, how to insert that help into the location so it will be visible. Right, so that I think is the bigger problem. I was showing all sorts of challenges last time we met is, hey, how do we do this? And let's do that in a way that I can show immediately with a plugin that's very familiar to me. I'm a maintainer of the Git plugin. And so I can show that one pretty readily and talk about why it's inadequate and specifically how the two of you can help us with it. So let's start with the story. The story goes like this. A user asked a question. Actually, the user submitted a bug report in the Jenkins JIRA. And the bug report said, I can't, let's see, the bug report said something like, I can't see, I can see the username and password. So here's the bug report. The user says, I embedded the username and password into the URL of my repository in Jenkins. And now it's visible to everybody in the log files. And that's a correct statement. The user is absolutely correct. If you do that, where you put the username and password right into the URL, it becomes visible to anyone who reads the log files or a number of other places where it gets in the way. And my response was, hey, that's a really bad choice. Don't do that. You should use the Jenkins credential system. But then the embarrassment thing came in that we should have in the Git plugin documentation examples that show how to use this, how to do this. This is not an exotic operation. This is not something infrequent. People do this all the time. And yet, shamefully, the Jenkins Git plugin documentation, if we look at the documentation on the plugin site, so we're gonna look at Git. This is the plugin documentation. And if I look for the word credential, credentials ID, that's the keyword that's used for a Jenkins pipeline to use credentials to do a checkout and get it. It uses this credentials ID label or keyword. There are only three places where that occurs in. You notice the size of this scroll bar on this documentation. There's a lot of documentation on the Git plugin in this page, really, really a lot. And yet this crucial use case, how do you use credentials with Git is not covered. And if we look for checkout SCM, oh, it's even worse. There is not a single reference in the Git plugin's documentation to give you an example of how to use checkout SCM. So woefully inadequate, even with the pages and pages of documentation, I thought I'd done such a good job of documenting this plugin. And here the clear evidence is it's not nearly well enough documented to help users do what they want. So my proposal is that the two of you take your experience with exploring pipeline syntax generator. So this video here, the pipeline syntax video, you could look at it and see how it describes it and then use that to provide some examples of how to do checkout SCM for the Git plugin readme. And so the place where you'd be proposing this change is right here, you go to GitHub and the documentation for the plugin is in its readme file. So you'll end up putting in here a new section that we might call, I think we should even probably put it as a whole new dedicated section that is pipeline examples, where we say, look, here are some examples of how you use pipeline, that it's been done before for, let's look at an example here with, it's been done before for the Jenkins Git pipeline step, but not been done for checkout SCM. So shame on me, it should be done for checkout SCM. So if, for instance, on this particular Jenkins server, I look at pipeline syntax and I look at the Git statement, at the Git thing, here, there's actually lots of help available and this help, this kind of help where it gives examples of, ooh, here's the Git step with defaults. Here's the Git step with a private key credential. Here's the Git step with Git protocol and polling disabled. Each of these examples is in here. If you'd be willing to copy or create something similar for these, like these things, but put them in the readme file for the Git plugin, that will give people a way to find these examples. So here we've got this little tiny section on pipelines. What it really needs is a great big long section that talks about pipeline examples. So would it help the two of you if I started something like that and you would then see where to add your additional examples? Yes, please. Yeah, that would be great. Okay, so what I'm going to do is I'm gonna do the start the example thing from inside this repository and I'm gonna put it on a separate branch for now and you can submit your additional proposals even to that separate branch if you'd like or do it from your own fork, either is fine. So this is ASCII doc and therefore we look, okay, so here is pipelines. Okay, so we want to insert. So this is the first video that talks about how do you use the, how do you use a pipeline syntax generator? This is the second video that talks about how do you use multi-branch pipeline? So I think we want to put here pipeline examples. And now I'm gonna go grab some examples from other places in the source code and we'll paste those in just as a convenient way to get started. So let's find, where would I look for this? It would be in, sorry, I have to get out my better search tool because I'm not as comfortable using GitHub search. You could use GitHub search, but for me it's easier if I go this way. Okay, so get grabbed. And what we're looking for is something from here like, check out from that, there we go. That, we just need to know where that is in the source code. Okay, it's in get step help.html. Okay, source main resources. So we're going to go borrow that and jump to that. No, that wasn't the right navigation technique. It is something like go to file that. Okay, so this is the HTML formatted. I need this as something different. So I'm gonna just copy some of this text and we're going to use that as a starting point. So let's do how about one example? So pipeline, actually, you know what? Maybe I should make my examples more effective. So for instance, check out how about, let's use the examples that are here. So like this, we'll borrow these and use those words for something better. Okay, so instead, check out with defaults. Then another one, check out with a specific branch. Check out with a SSH and a private key credential. Check out with HTTPS and a username password credential. And yeah, that's a good beginning. Okay, so each of these examples is the examples below. Illustrate and now what we need is, yeah, examples below were created with, so we're gonna remind people that they should use the pipeline syntax generator and you're going to use the pipeline syntax snippet generated to do these. So the examples below were created with the pipeline syntax snippet generator. You can create your own check out statements, check out commands configured for your needs. And the idea here is let's insert some of that text like, like, yes, here we go, something like this. Check out from the Git plugin source repository using HTTPS protocol, no credentials and the master branch. And now we need source comma groovy and it's checkout SCM. And now guess what? I'm going to run the pipeline snippet syntax generator to do this. So instead of Git, we're going to use checkout. We're going to use Git as the SCM and the Jenkins GitHub repository or Git plugin repositories, this one, the master branch and generate the pipeline script. There it is. So in that example, and now this is where the two of you can help by saying, hey, I don't need this because it's empty and there is the command. Now we'll make this thing better if we can make its layout so it's not as wide when formatted in other places. So multi-line like that. So any questions so far on how I'm doing this step? Okay, all right. So what you do is then insert the same content, same kind of content for other things like checkout from the Git plugin from, and the examples here used a different location each time. So it would use some other repository and yeah, in this case, you use Jenkins Core. That may be a little big. How about we use the Git client plugin for the next example using and let's use a, and a different branch, non-default branch. So in this case, we go back to the syntax snippet generator. We insert Git client plugin and we need to go find a branch name that we wanna use. So I have to look at the repository and choose another branch. There will be several branches here. Let's pick stable-2.x like that. And there's my example. Okay, and the idea is you would do this same kind of thing with each of the examples below where you say, okay, this is how we're going to do, and I'm going to commit this onto, let's see. So add checkout SCM examples and there are many examples. See many different examples in marks in branches of Mark's Jenkins-Bugs repository. So I'm gonna create a new branch, add checkout SCM documentation examples. Comfortable so far. Sophia and Afi, on what next steps are for you that you'll add more examples like these? Yeah, okay, it's just that I'm a little bit confused because you are very familiar with the plugins so you know what examples you will be using. But for me, I really can't come up with the examples except maybe I kind of like study a lot. How about as part of this, let me put in headlines for the different examples that you could use. Would that be okay? Then you can highlight those and we can talk about which ones I think are most interesting and you could use the syntax generator to create those. Would that help with that question? I think it's a valid point. Yes, it's good. Okay, so for instance, checkout with git LFS enabled. Actually, let's use the expansion of the acronym, large file support enabled. So and this one, what you would do is you go to the snippet syntax generator and you click, where is the add? Oh, add additional behaviors. So it should as you add additional behaviors, you scroll down here and find git LFS pull after checkout and let's use exactly those words with git large file support enable git LFS pull after checkout create the snippet. So that's an important use case for companies that are doing, for people that are doing very large files git large file support is very, very important to them. Another could be add a repository browser. So let's put that example in. Oh, Mr. Wait. Okay, add a repository browser for my add a, actually yes, repository browser for bit bucket. Something less common than GitHub. And then what you would do is you would go here and in the snippet generator, it says, where is this? It says repository browser, you click bit bucket web and it will ask, okay, what's the URL for the bit bucket repository? You put it in something.bitbucket.com and that then becomes part of the example. So another highlight there, we could delete that one. So add a repository browser for bit bucket. Let's keep going through those if you're okay with that as different things that you can do like other important behaviors are things like the advanced clone behaviors to not fetch tags. Do not fetch tags. Check out without fetching tags. Advanced clone behavior. Check out with shallow clone to reduce data traffic. Check out with a, this one is quite important but you'll have to read some of the documentation in the plugin to see how to use it. So maybe this one is needs more reading. You may not wanna do that one yet. Continuing this exercise, we could look at clean, that one I don't want people using in pipeline. They'll continue. Here we go. How about, actually that's pretty much. Oh, prune. That's a good one. Check out with and prune stale remote branches. So that gives us at least a starting point for some common use cases that may help. Did that, does that help with your question, Sophia? Yes, it does. Okay. See also, if you wanna do a 10 or 15 minute see also the, let me get the URL for them because I've got some videos that I created a while ago that are five or 10 minute videos on improving Jenkins performance on large repositories that you might want to look at just as a way to see some other things that might be included just a moment. So, here we go. All right, so I'm gonna go ahead and commit this and this gives you a starting point. I apologize for having to end early but I've gotta go to this other meeting. I'm not gonna create, go ahead. Okay, I will go into the pulling from this branch. Yes, exactly. So you use this add checkout SCM examples branch as the starting point for your changes. Okay. So that means that initially because we were going to and continue like picking something, right? According to the document, I already cloned the HTTP ref. So I forked it so I'll go and fork this and improve from this branch and then, so should I push to this branch or should I just create? You just create your own copy of the same branch and you could push to your own repository. That way you don't have to have pushed permission to the central repository. Okay. All right. And let's check in with each other by Slack because this may still be too unclear and over the next day or two, we'll check in to see if it is. We could schedule another session to meet again to be sure that we get it clarified. I am sincerely sorry for having to do this so quickly. Thanks for your patience. All right. Thank you. Thank you.