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

Trigger kde release #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Trigger kde release #24

wants to merge 4 commits into from

Conversation

jriddell
Copy link
Contributor

No description provided.

Copy link
Contributor

@hsitter hsitter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already reviewed this and didn't like the way it was duplicating code
#23 (review)

l.level = Logger::INFO
end

if release.nil? or not KDEProjectsComponent.respond_to?(release)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use || instead of or.
Use ! instead of not.

What you write there is the overly complicated variant of unless release && KDEProjectsComponent.respond_to?(release)

end.parse!

@log = Logger.new(STDOUT).tap do |l|
l.progname = 'retry'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't called retry is it?

opts.banner = <<-HELPTEXT
Triggers the watcher jobs for when a new release of Frameworks/Plasma/Applications is made.

Usage: jenkins_trigger_new_release_build.rb -r [plasma,applications,frameworks]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#{$0} instead of jenkins_trigger_new_release_build.rb

class << self

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing spaces
&
excess newline

@@ -18,13 +18,15 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.

# downloads and makes available as arrays lists of KDE projects which
# downloads and makes available as arrays lists of jobs which
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

def to_names(projects)
projects.collect { |project| project.split('/')[-1] }
def to_names(project_list)
project_list.collect! { |project| project.split('/')[-1] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This edits the caller's list. You probably should avoid this by not using collect! and assign a new variable instead. Editing a caller's object will almost certainly cause confusion further down the line.

# are part of Plasma, Applications and Frameworks

require 'httparty'

class KDEProjectsComponent
@projects_to_jobs = {'kirigami'=> 'kirigami2', 'discover'=> 'plasma-discover'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inside { missing.
Surrounding space missing for operator =>.
Space inside } missing.
This should probably be a constant, not a class instance variable.

projects.collect { |project| project.split('/')[-1] }
def to_names(project_list)
project_list.collect! { |project| project.split('/')[-1] }
@projects_to_jobs.each do |project_name, job_name|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire block is better expressed as

project_list.collect { |x| @projects_to_jobs.fetch(x, x) }

which re-collects the array, by running each value through the hash with both the value as key AND default value. i.e. fetch('foobar', 'foobar') = if 'foobar' is in the hash it will return the value it is mapped to, otherwise it will return 'foobar'

@log.info 'Setting system into maintenance mode.'
Jenkins.system.quiet_down

BlockingThreadPool.run do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dejavu

#23 (review)

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

Successfully merging this pull request may close these issues.

2 participants