Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-39988] Build Management Tools - Thresholding #8

Open
wants to merge 10 commits into
base: development-2.0.0
Choose a base branch
from

Conversation

tlenaic
Copy link

@tlenaic tlenaic commented Apr 13, 2017

No description provided.

@JordanGS
Copy link
Member

So this is my question, how do we change this feature so that's it's a Post-Build Action. Does it make more sense to make it a Post-Build Action or Keep it as a Build Action. In my mind, it should be a robot framework plugin, just like the robot framework plugin. That way future additions to the Project Status page would have access to relevant information.

Thoughts @tlenaic @thc202 ?

@JordanGS JordanGS added this to the zap-1.1.0 milestone Apr 13, 2017
@tlenaic
Copy link
Author

tlenaic commented Apr 13, 2017

@JordanGS
I join you, and my first idea was to do it as a post build action. But I needed a function quickly. so i do it like that.
And on Manage threshold i rewrite the function. Let me know if you prefer the new one or the oldest in the previous PR #4

@JordanGS
Copy link
Member

JordanGS commented Apr 13, 2017

@tlenaic i like the new code in PR#8 more 👍 It is much cleaner! do not go back to the old code ;)

I've opened a Google Group discussion

Let's see what the Jenkins developers say, if there is an easy way for Build Action and Post-Build Action to easily communicate. I do not want a new zap process in Post Build, but there are a lot of benefits to having Build Management Thresholds as a Post-Build, let's wait and see what they say, is that okay?

@JordanGS JordanGS changed the title new Manage Threshold Build Management Tools - Thresholding: JENKINS-39988 Apr 13, 2017
@JordanGS
Copy link
Member

@tlenaic Would you mind trying to create it as a Post-Build action, as per the Google Group discussion? I can try to help as best as i can and we can work on it together if you like.

@JordanGS
Copy link
Member

JordanGS commented Apr 20, 2017

@tlenaic Also please let me know if you'd like to be added to the Contributors page

I'll need your Jenkins userid as well as your email.

@tlenaic
Copy link
Author

tlenaic commented Apr 20, 2017

yes i will look at it, as soon as possible -> next week. i am busy now

@tlenaic
Copy link
Author

tlenaic commented Apr 25, 2017

@JordanGS i am back from holiday. jenkins userid = ngola_boy mail = [email protected]
i will create a group discussion and look at it thursday and friday

@tlenaic
Copy link
Author

tlenaic commented Apr 26, 2017

Hi, like will see i have take a look on it.
it is just the begining. i have try to understand how both jenkins and zap worked and for now i am here.
https://groups.google.com/forum/#!topic/zaproxy-jenkins/_27wC7ujsls

@tlenaic
Copy link
Author

tlenaic commented Apr 28, 2017

@JordanGS i have a question in the group discussion.

@JordanGS
Copy link
Member

JordanGS commented Apr 28, 2017 via email

@tlenaic
Copy link
Author

tlenaic commented May 3, 2017

@JordanGS have you review manage threshold ? or take a look at postbuild action ? sooner it will be done, better it will be. now i can remember what i've done, but i am not sure that in on month, it will still be the case.

@tlenaic
Copy link
Author

tlenaic commented May 3, 2017

if you are busy, maybe we could first review UI, help and condition of stability of a build. once we agree on that may be merged.
and take time later to look deeper on post action, if my way does not match.
i think post build step is not only an issue for mange threshold, but jira feature too

@JordanGS
Copy link
Member

JordanGS commented May 3, 2017 via email

@JordanGS
Copy link
Member

JordanGS commented May 4, 2017

@tlenaic reading and catching up now.

Updated your contact information: https://wiki.jenkins-ci.org/display/JENKINS/List+of+Contributors

@JordanGS
Copy link
Member

JordanGS commented May 5, 2017

@thc202 @tlenaic Not uploading any code yet for thresholding as a Post Build. I have one question for you guys. As more items more to Post Build step, that's there i think JIRA Creation and Report Generation should be as well. What do you guys think would be the best approach

  1. Pass in values from the build step to the Post Build, this could have a LOT of parameters and values passed. Not sure as to the jenkins implications. Could be limited to one parameter passed if we create a config file and just pass the name, then read in the values from the config file in the post build step.
    PROs: Single Parameter passed
    CONs: Export Report and JIRA would have to stay in the main Build Step as well as any other future third party tools. Limits how much i can minimize the UI in the future since everything ZAP related would be in the Build Step ONLY.

  2. Start and Shutdown ZAP in the build step to do all the scanning and then Start and Shutdown ZAP again in the Post Build step, while it loads the session from the Build Step.
    PROs: Single string passed (the name of persisted session)
    CONs: The session would have to be loaded twice, the second load would potentially be of a very large session. Forces users to use the compact session feature.

Personally, i'm leaning towards option 2, compacting a session has never been an issue for me. I've compacted large 40-50GB session files and then they load in 10-30 seconds once their filesize is compressed. What do you both think? 1 or 2?

The only thing is that if we go with 2, threshold will need to be put on hold for a little bit simply because i'll need to make the installation of zap more object oriented and less reliant on the ZAPDriver class which is already too bloated. With Option 1 on the other hand, all we would have to pass is 4 integer values which is really simple, they would be calculated in the ZAPDriver and passed as an Action Parameter, then read in the Post Build.

Update: https://github.com/JordanGS/zap-plugin/tree/development-1.1.0-thresholding has code for two instance of zap being started and stopped, it's just rough code and needs to be more object oriented and values properly parsed. I need more time to fix it. This is a starting point for Option 2

Option 1 on the other hand would just be:

ZAPBuilder perform method

        build.addAction(new MyAction());
        MyAction abs = build.getAction(MyAction.class);
        abs.setLow(zaproxy.getLowAlert());

Then the Post Build Class would just have

        MyAction abs = build.getAction(MyAction.class);
        System.out.println("LOW COUNT: " + abs.getLow());

The class MyAction can be automatically created by eclipse and would just require the getter/setter/constructor.

As i said, option 2 requires more time and is a bit harder but would be more beneficial in the long run i believe. Thoughts?

@tlenaic
Copy link
Author

tlenaic commented May 6, 2017

I shared your ideas on JIRA Creation, Thresholding and Report Generation.
Option 2 seems to be the best option.
that join my approach of having executezapPostbuild on zapdriver.
with zapManagement, we could relieve zapDriver.
we will have 2 class, one for build and an other for postbuild step and for new feature, it may be easier.
Option1 now looks easy to do, if postbuild step is limitate to thresholding

@tlenaic
Copy link
Author

tlenaic commented May 10, 2017

@JordanGS i have improve your project we are almost at the end. let me now if you have better result than me. i put my project on the google group discussion

@tlenaic
Copy link
Author

tlenaic commented Jul 7, 2017

@JordanGS @thc202 i join the latest version of the feature on the group ? any feedback ?
May be i should add to a branch and try to push it ?

@thc202
Copy link
Collaborator

thc202 commented Jul 7, 2017

I'll take a look at the latest code tomorrow morning. I think it's fine to push to this branch(?).

@JordanGS
Copy link
Member

@tlenaic I'll update tonight and get it merged tomorrow.

@JordanGS JordanGS closed this Jul 10, 2017
@JordanGS JordanGS changed the base branch from development-1.1.0 to development-2.0.0 July 10, 2017 21:12
@JordanGS JordanGS reopened this Jul 10, 2017
@tlenaic
Copy link
Author

tlenaic commented Jul 11, 2017

@JordanGS @thc202 i was sick this weekend. i see you have push previous work "NICE !"
If you want i can update the branch tonight

@JordanGS
Copy link
Member

JordanGS commented Jul 11, 2017 via email

@tlenaic
Copy link
Author

tlenaic commented Jul 12, 2017

@JordanGS Nice and thanks.

@JordanGS
Copy link
Member

@tlenaic working on development-2.0.0-action branch, once that is merged and finished i'll merge this. The reason for the delay being that i would like ZAP class to be a controller for both ZAPDriver and ZAPManagement, rather than having duplicated code in both. More OO and easier to maintain in the long run. I'll rush to finish that overhaul.

@JordanGS JordanGS self-assigned this Jul 13, 2017
@JordanGS JordanGS modified the milestones: zap-1.1.0, zap-2.0.0 Jul 13, 2017
@tlenaic
Copy link
Author

tlenaic commented Aug 8, 2017

@JordanGS hi, have you solved your issue ? do you need me to try to solved it ?
if not solved, i think the serialize issue must come from the name "ZAP.class" you should try "ZAPController.class".

@tlenaic
Copy link
Author

tlenaic commented Aug 21, 2017

@JordanGS @thc202 hi, hope you are having good vacation.
Just to let you know where i am on feature in my branch.
development-2.0.0-thresholding -> new feature on threshold
development-2.0.0-Controller -> launch zap by using class zap.java in zapmanegement.(i modified your work on development-2.0.0-action ) -> not yet finish zap.java only control zapmanagement
if you have time take a look a try them.
i also have an other branch LoadContext, the feature work and by the way i corrected a UI bug on authentification in this feature.

@tlenaic tlenaic changed the title Build Management Tools - Thresholding: JENKINS-39988 [JENKINS-39988] Build Management Tools - Thresholding May 14, 2018
@arslanjavaid1
Copy link

When this will be merged or any update on progress?

@arslanjavaid1
Copy link

Will this be merged anytime sooner?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants