New SCMSource trait: filtering old git references

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

New SCMSource trait: filtering old git references

Javier Delgado
Following this comment, I was planning on creating a new scm trait for excluding references according to a date threshold.

The idea after the trait would be leaving out from an analysis branches considered deprecated or unmantained. This way, a new github organization or bitbucket team project wouldn't create jobs for the whole references sitting at the repository but just for the recent ones.

With this, the implementation seems it could be easy as hell, define a class extending from SCMSourceTrait that would add a (pre)filter according the defined threshold value. Here comes my question and request for help:

* Does anyone feel this would be an invaluable feature or doable in other way?

I cant seem to be able to look for a commit creation date. I can get the SHA1 for a branch tip via org.kohsuke.github.GHBranch$Commit and  com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch. From where could I extract the modification time of this commit? 

What seems true is that I cant apply a SCMSourceContext prefilter so this trait wont avoid trips to the Github API

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New SCMSource trait: filtering old git references

stephenconnolly
On 30 August 2017 at 01:03, Javier Delgado <[hidden email]> wrote:
Following this comment, I was planning on creating a new scm trait for excluding references according to a date threshold.

The idea after the trait would be leaving out from an analysis branches considered deprecated or unmantained. This way, a new github organization or bitbucket team project wouldn't create jobs for the whole references sitting at the repository but just for the recent ones.

With this, the implementation seems it could be easy as hell, define a class extending from SCMSourceTrait that would add a (pre)filter according the defined threshold value. Here comes my question and request for help:

* Does anyone feel this would be an invaluable feature or doable in other way?

I know there are users who would buy you beers if you implemented it for them.

There are other users who couldn't care less, which is why this will need to be an extension plugin not part of the core plugins
 

I cant seem to be able to look for a commit creation date. I can get the SHA1 for a branch tip via org.kohsuke.github.GHBranch$Commit and  com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch. From where could I extract the modification time of this commit? 

What seems true is that I cant apply a SCMSourceContext prefilter so this trait wont avoid trips to the Github API

Yep I think you will be hitting round-trips.

I am fine with adding supporting changes to the GitHub Branch Source plugin to add lazy caches to the request object... my rule is 

* Core plugin PRs that enable extension plugins are yes. Stuff that could be an extension plugin should not go in core. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMywZLLHpnL%3DBfciKYPM3WhD4z6QzjvcBSvybMdy4yAuwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New SCMSource trait: filtering old git references

Javier Delgado
Of course, I was expecting this trait to be included in a separate plugin (WIP already on https://github.com/witokondoria/git-aged-refs-trait-plugin)

Those caches arent already implemented? What I feel I'm lacking is the commit date (and might be solved via the bitbucket and github api components)

El miércoles, 30 de agosto de 2017, 13:10:00 (UTC+2), Stephen Connolly escribió:
On 30 August 2017 at 01:03, Javier Delgado <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="TjTGEftQAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">witoko...@...> wrote:
Following <a href="https://groups.google.com/forum/#!forum/jenkinsci-dev" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/forum/#!forum/jenkinsci-dev&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!forum/jenkinsci-dev&#39;;return true;">this comment, I was planning on creating a new scm trait for excluding references according to a date threshold.

The idea after the trait would be leaving out from an analysis branches considered deprecated or unmantained. This way, a new github organization or bitbucket team project wouldn't create jobs for the whole references sitting at the repository but just for the recent ones.

With this, the implementation seems it could be easy as hell, define a class extending from SCMSourceTrait that would add a (pre)filter according the defined threshold value. Here comes my question and request for help:

* Does anyone feel this would be an invaluable feature or doable in other way?

I know there are users who would buy you beers if you implemented it for them.

There are other users who couldn't care less, which is why this will need to be an extension plugin not part of the core plugins
 

I cant seem to be able to look for a commit creation date. I can get the SHA1 for a branch tip via org.kohsuke.github.GHBranch$Commit and  com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch. From where could I extract the modification time of this commit? 

What seems true is that I cant apply a SCMSourceContext prefilter so this trait wont avoid trips to the Github API

Yep I think you will be hitting round-trips.

I am fine with adding supporting changes to the GitHub Branch Source plugin to add lazy caches to the request object... my rule is 

* Core plugin PRs that enable extension plugins are yes. Stuff that could be an extension plugin should not go in core. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TjTGEftQAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/f497407d-c330-47a2-968a-06eede877c11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New SCMSource trait: filtering old git references

stephenconnolly

On Thu 31 Aug 2017 at 08:37, Javier Delgado <[hidden email]> wrote:
Of course, I was expecting this trait to be included in a separate plugin (WIP already on https://github.com/witokondoria/git-aged-refs-trait-plugin)

Those caches arent already implemented? What I feel I'm lacking is the commit date (and might be solved via the bitbucket and github api components)

I am not sure if the info you need is in one of the cached objects or not.

If it is already present, WIN!

If not present, I am happy to review PRs  on the "core" plugins that enable the feature.



El miércoles, 30 de agosto de 2017, 13:10:00 (UTC+2), Stephen Connolly escribió:
On 30 August 2017 at 01:03, Javier Delgado <[hidden email]> wrote:
Following this comment, I was planning on creating a new scm trait for excluding references according to a date threshold.

The idea after the trait would be leaving out from an analysis branches considered deprecated or unmantained. This way, a new github organization or bitbucket team project wouldn't create jobs for the whole references sitting at the repository but just for the recent ones.

With this, the implementation seems it could be easy as hell, define a class extending from SCMSourceTrait that would add a (pre)filter according the defined threshold value. Here comes my question and request for help:

* Does anyone feel this would be an invaluable feature or doable in other way?

I know there are users who would buy you beers if you implemented it for them.

There are other users who couldn't care less, which is why this will need to be an extension plugin not part of the core plugins
 

I cant seem to be able to look for a commit creation date. I can get the SHA1 for a branch tip via org.kohsuke.github.GHBranch$Commit and  com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch. From where could I extract the modification time of this commit? 

What seems true is that I cant apply a SCMSourceContext prefilter so this trait wont avoid trips to the Github API

Yep I think you will be hitting round-trips.

I am fine with adding supporting changes to the GitHub Branch Source plugin to add lazy caches to the request object... my rule is 

* Core plugin PRs that enable extension plugins are yes. Stuff that could be an extension plugin should not go in core. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/f497407d-c330-47a2-968a-06eede877c11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMx8EE0OqphdHL6%2BR4Zv4s0JpmcMg_M_OpqyDViGsBS1TQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New SCMSource trait: filtering old git references

Javier Delgado
Stephen, could you pay a visit to https://github.com/witokondoria/branch-source-aged-refs-traits, to go on with the traits work? Have finaly gone through the path of one repo per trait, a module for each implementation (even there will be dummy releases when adding a new implementation)

Some of my concerns are related to the maven-enforcer checks (adding unrelated dependencies seems weird) and the "tests" (they just perform form load validation?) copied from the bitbucket-branch-source-plugin

El jueves, 31 de agosto de 2017, 10:16:40 (UTC+2), Stephen Connolly escribió:

On Thu 31 Aug 2017 at 08:37, Javier Delgado <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="_MbKRBqWAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">witoko...@...> wrote:
Of course, I was expecting this trait to be included in a separate plugin (WIP already on <a href="https://github.com/witokondoria/git-aged-refs-trait-plugin" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fwitokondoria%2Fgit-aged-refs-trait-plugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGtptipncwcGzKiC60m9ZJ2GttdrQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fwitokondoria%2Fgit-aged-refs-trait-plugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGtptipncwcGzKiC60m9ZJ2GttdrQ&#39;;return true;">https://github.com/witokondoria/git-aged-refs-trait-plugin)

Those caches arent already implemented? What I feel I'm lacking is the commit date (and might be solved via the bitbucket and github api components)

I am not sure if the info you need is in one of the cached objects or not.

If it is already present, WIN!

If not present, I am happy to review PRs  on the "core" plugins that enable the feature.



El miércoles, 30 de agosto de 2017, 13:10:00 (UTC+2), Stephen Connolly escribió:
On 30 August 2017 at 01:03, Javier Delgado <[hidden email]> wrote:
Following <a href="https://groups.google.com/forum/#!forum/jenkinsci-dev" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/forum/#!forum/jenkinsci-dev&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!forum/jenkinsci-dev&#39;;return true;">this comment, I was planning on creating a new scm trait for excluding references according to a date threshold.

The idea after the trait would be leaving out from an analysis branches considered deprecated or unmantained. This way, a new github organization or bitbucket team project wouldn't create jobs for the whole references sitting at the repository but just for the recent ones.

With this, the implementation seems it could be easy as hell, define a class extending from SCMSourceTrait that would add a (pre)filter according the defined threshold value. Here comes my question and request for help:

* Does anyone feel this would be an invaluable feature or doable in other way?

I know there are users who would buy you beers if you implemented it for them.

There are other users who couldn't care less, which is why this will need to be an extension plugin not part of the core plugins
 

I cant seem to be able to look for a commit creation date. I can get the SHA1 for a branch tip via org.kohsuke.github.GHBranch$Commit and  com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch. From where could I extract the modification time of this commit? 

What seems true is that I cant apply a SCMSourceContext prefilter so this trait wont avoid trips to the Github API

Yep I think you will be hitting round-trips.

I am fine with adding supporting changes to the GitHub Branch Source plugin to add lazy caches to the request object... my rule is 

* Core plugin PRs that enable extension plugins are yes. Stuff that could be an extension plugin should not go in core. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/5c30e3f7-7acb-4268-9d6c-c6bd91103304%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="_MbKRBqWAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/f497407d-c330-47a2-968a-06eede877c11%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/f497407d-c330-47a2-968a-06eede877c11%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/f497407d-c330-47a2-968a-06eede877c11%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/f497407d-c330-47a2-968a-06eede877c11%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
--
Sent from my phone

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/995f7d76-b243-40eb-8144-46fe6732f19b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.