Skip to content

Comments

Multiple configurations per project & version replacement variable#38

Open
danielvijge wants to merge 18 commits intoiridakos:masterfrom
eurailcom:version-qeueu
Open

Multiple configurations per project & version replacement variable#38
danielvijge wants to merge 18 commits intoiridakos:masterfrom
eurailcom:version-qeueu

Conversation

@danielvijge
Copy link
Contributor

Projects can work with versions. If a version is finished it can be released. In many situations a version has multiple releases: first to a test environment, then to an acceptance environment, and finally to a production environment. Most of the time these releases are the same, but sometimes an issue is removed for some reason.

I wanted to use this plugin, and made two enhancements to it:

  1. It can now support multiple release configurations per project. Before this, a project had to be unique in the release log configuration. Now (project,queue) has to be unique. With this, it is possible to make release queues for the releases to the different environments. Different mail recipients can already be configured depending if it is an test environment release, or a release to production, which is very nice. When creating a new release log, there is a dropdown to chose the release queue. If the release has no title template, there is a title field for a manual title, if it has a title template the title bar is hidden.
  2. To make working with versions easier, there is a new replacement variable {{version}}. When this is used in the title template, a dropdown for the open (shared) version is shown. By choosing the version and the release queue, it is possible to quickly create a release for a specific environment. There is no integration with the issues in the release, i.e. choosing a version will not fill the issues for that release.

At the moment the code works but I wouldn't advice merging it just yet. I first wanted to discuss to see if such functionality would fit with your idea of what this plugin should do, and how to work with release queues and configurations. I tested it for a complete new setup. It is required to first create a release queue, then a configuration. Also it doesn't deal with the migration of existing queues/configurations to this new functionality. So it's a bit rough, but most functionality is there. If you think this fits with your idea of release logs, I can work on it a bit more and send a complete pull request later.

@danielvijge danielvijge changed the title Multiple queues per project & version replacement variable Multiple configurations per project & version replacement variable Apr 15, 2016
@archonwang
Copy link
Contributor

archonwang commented May 27, 2016

Great! I will test the branch later. Thanks so much.
and I have some ideas about the release notes.

  1. I think it should contain the target version as an option, and if it could load issues of some trackers in the target version would be much better. The feature should be controlled by an option that could load issues or not.

@archonwang
Copy link
Contributor

it seems there's something error when I create a new release log, the error information is

FATAL -- : 
ActionView::Template::Error (undefined method `version_id' for #<ReleaseLog:0x0000000b3fb848>):
    22: 
    23:             <p>
    24:                 <%= form.select :version_id,
    25:                          options_from_collection_for_select(@versions, :id, :name, release_log.version_id) %>
    26:             </p>
    27: 
    28:             <p>
  plugins/release_logs/app/views/release_logs/_form.html.erb:25:in `block in _plugins_release_logs_app_views_release_logs__form_html_erb__1638464797826983132_94026740'
  app/helpers/application_helper.rb:1030:in `labelled_form_for'
  plugins/release_logs/app/views/release_logs/_form.html.erb:5:in `_plugins_release_logs_app_views_release_logs__form_html_erb__1638464797826983132_94026740'
  plugins/redmine_workflow_enhancements/lib/workflow_enhancements/patches/action_view_rendering.rb:53:in `render_with_workflow_enhancements'
  plugins/release_logs/app/views/release_logs/new.html.erb:2:in `_plugins_release_logs_app_views_release_logs_new_html_erb___628557551839321263_94227680'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

@archonwang
Copy link
Contributor

archonwang commented Jun 1, 2016

@danielvijge , Thanks.

I rake db migrate and then test it again.
but there's still something wrong. could you tell me how to fix it?

I tried to create a new release log in project with version, and when I want to save and preview the notification ,it occured an error,
the error message is

Started POST "/release_log_previews/project/demo/release_log/notifications/publish" for 10.1.200.180 at 2016-06-02 16:07:33 +0800
Processing by ReleaseLogPreviewsController#publish_notification as /
Parameters: {"utf8"=>"✓", "authenticity_token"=>"gaH6580ObeLgENT+x90x9B7JO92y3MFfPd2v9oU1Sod3jRYrsSscb7rJvnvzr1fazYgw+mR2t05nziWSfnUkiw==", "release_log"=>{"title"=>"", "version_id"=>"1", "release_log_queue_id"=>"1", "description"=>"afdaffasf\r\nadfaf\r\na\r\nfa\r\nfadf", "send_email_notification"=>"1", "release_upon_publish"=>"true", "release_log_entries_attributes"=>[{"id"=>"", "issue_id"=>"", "include_in_notification"=>"1", "note"=>""}]}, "release_date"=>"", "release_hour"=>"", "release_minutes"=>"", "project_id"=>"demo"}
Current user: admin (id=1)
Completed 404 Not Found in 13ms (ActiveRecord: 2.8ms)

ActiveRecord::RecordNotFound (Couldn't find ReleaseLogQueue with 'id'=):
plugins/release_logs/app/models/release_log.rb:132:in queue_title_for_release_log' plugins/release_logs/app/controllers/release_log_previews_controller.rb:26:inpublish_notification'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

F, [2016-06-01T23:27:27.139795 #12007] FATAL -- :
ActiveRecord::RecordNotFound (Couldn't find ReleaseLogQueue with 'id'=):
plugins/release_logs/app/models/release_log.rb:132:in queue_title_for_release_log' plugins/release_logs/app/controllers/release_log_previews_controller.rb:26:inpublish_notification'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

@danielvijge
Copy link
Contributor Author

If there are errors, I'll take a look at it of course. Please note that for now, this only works on a new installation. It doesn't correctly migrate old data to be compatible with this feature. I'm still planning to write that as well.

@archonwang
Copy link
Contributor

@danielvijge ,
I see.
yesterday, I tested it on the new installation environment and old data environment, and I found there's same issue about it, I will confirmed it later. Thanks so much.

@archonwang
Copy link
Contributor

@danielvijge ,
there's another issue about the plugin in this branch.
when I click send successful notification, it occured 500 error, the information as follows:

A NoMethodError occurred in release_logs#send_notification:

undefined method name' for nil:NilClass plugins/release_logs/app/models/release_log_queue.rb:23:inblock in class:ReleaseLogQueue'


Request:

  • URL : http://192.168.1.41/projects/web/release_logs/12/send_notification/successful_release
    • HTTP Method: PUT
    • IP address : 192.168.20.236
    • Parameters : {"_method"=>"put", "authenticity_token"=>"k4ILk+78HD5k5nfYgFHPBYjGSHypnBWJ/sTG3S9vAjxpi3TYC1ty9TYCy8DJGO7LheZj1lVDaIIff6G5d5F2Pg==", "controller"=>"release_logs", "action"=>"send_notification", "project_id"=>"web", "id"=>"12", "type"=>"successful_release"}
    • Timestamp : 2016-06-03 13:09:27 UTC
    • Server : jira
    • Rails root : /opt/redmine
    • Process: 19103

Session:

  • session id: "a14ea04530621b2c5cdb2db73c5ec364"
  • data: {"session_id"=>"a14ea04530621b2c5cdb2db73c5ec364",
    "user_id"=>35,
    "tk"=>"393a745b92f76d731a153b218f0976d5a51bf2a8",
    "_csrf_token"=>"+gl/S+WnbstS5LwYSUkhzg0gK6r8330L4btnZFj+dAI=",
    "recent_projects"=>[11, 10],
    "query"=>
    {:project_id=>11,
    :filters=>
    {"status_id"=>{:operator=>"=", :values=>["1", "2", "8"]},
    "fixed_version_id"=>{:operator=>"!*", :values=>[""]}},
    :group_by=>"assigned_to",
    :column_names=>nil,
    :totalable_names=>[:estimated_hours, :spent_hours]},
    "issues_index_sort"=>"priority:desc",
    "my_page_sort"=>"none"}

Environment:

  • CONTENT_LENGTH : 127
  • CONTENT_TYPE : application/x-www-form-urlencoded
  • GATEWAY_INTERFACE : CGI/1.2
  • HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
  • HTTP_ACCEPT_ENCODING : gzip, deflate
  • HTTP_ACCEPT_LANGUAGE : zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
  • HTTP_CONNECTION : keep-alive
  • HTTP_COOKIE : autologin=775556d14b46d507dc3cf73c85ae8e67a508273a; _redmine_session=R2QvZjVoTmxHcjE0MndodUpqbGlWZGlTNno5MDJGbkxmdWlPSlI1clFYM3lBd3U3RlV3QjdKVUprYzJpR1JlZ3kyOGNqOGFiTDNYTmk0UmhaNnRWWnBQQmcyL25yL0tUd1NoRnoycGtvVldBN2FBeDNIc2Q5RWFINnlEbmtaOWxBRlRJUEN4ZG5tbldZWktqYnhPUURQZ0sraGdYN0Q5RUZrb1R3U25iRjF4Tnd3SU9XNkc0UjZXS1Z5enBxMTFkVmdheWJjMkxXYWQwL0ovdHdxKzRzdEwzNzYyZ0V3Tk85NGh0SXlET0hmdUxMQW5qV2lTTStlZ3JjdXlodHIzRUtMYnF3MFJYbG5lbGxiWG4ySlZud1ZyQlhTTnJyUnducmE1ZFI1aGRJSFdvb0dreHBYTVFwVG5sRjhrQjF3Zm5VMTJoWS93NEVQUmMxdEJUVUllU3BvdlhKbTltdm1uOGNCZjN1aGU1Z0F1WG1sU2s3RW5jNlhYTnVhR1ZSekZGcVZUWVFyZzladWROSWM4elpZMjMrRlNWQWdBOXEvN3dVelZMZEdHSk5ncm5qRzVkVVUyQzNpMGlSSU5YRUFlVWoyNG1ZVFR0MDJ5U01pZ0ViRm1LSk41SFV4OVhqUSt5RzRvRXlSUTBrNFBKa0xhTzY0aC9MWEkyWC9SL0RPamdPc1RjNzRFbEVnbndZMlVDRURMd01XV2cvYldOVWsrWGlTT0RuTkorSVBaWVNjL1FKd2VMb2hYQlVEZElpSGxSN28za2ptQU82Tk5MRVAyV1NMUDBVMmRqNGlCWGFlZXZSbWVVK0JwSkh6T1pmWDBOYWxISzlWbkRhVmtSbmlIY2ZhV29keUs3ODgydGdHRkt0QmtmUk5ucUphRS9ieklUOEFxNHk1eFdGcUxWOTduL3E3bjBkZmUwYXJBcHM1cFR6cm5TaUQ1ZzlRTDBESmJ5bWFzQk05S1FuVVk2Q0x6ckZUa2NnbCs0S0VrPS0tRFpva0hxRXBTYU45NVVMNWFTbDRBUT09--c2b48028934179ad35a886cd30b0109541e5f3be
  • HTTP_HOST : 192.168.1.41
  • HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
  • HTTP_VERSION : HTTP/1.1
  • ORIGINAL_FULLPATH : /projects/web/release_logs/12/send_notification/successful_release
  • ORIGINAL_SCRIPT_NAME :
  • PATH_INFO : /projects/web/release_logs/12/send_notification/successful_release
  • QUERY_STRING :
  • REMOTE_ADDR : 192.168.20.236
  • REQUEST_METHOD : PUT
  • REQUEST_PATH : /projects/web/release_logs/12/send_notification/successful_release
  • REQUEST_URI : /projects/web/release_logs/12/send_notification/successful_release
  • ROUTES_40161120_SCRIPT_NAME :
  • SCRIPT_NAME :
  • SERVER_NAME : 192.168.1.41
  • SERVER_PORT : 80
  • SERVER_PROTOCOL : HTTP/1.1
  • SERVER_SOFTWARE : thin 1.7.0 codename Dunder Mifflin
  • action_controller.instance : #ReleaseLogsController:0x0000000cde8940
  • action_dispatch.backtrace_cleaner : #Rails::BacktraceCleaner:0x00000003ed28a0
  • action_dispatch.cookies : #ActionDispatch::Cookies::CookieJar:0x0000000cdba658
  • action_dispatch.cookies_digest :
  • action_dispatch.cookies_serializer :
  • action_dispatch.encrypted_cookie_salt : encrypted cookie
  • action_dispatch.encrypted_signed_cookie_salt : signed encrypted cookie
  • action_dispatch.http_auth_salt : http authentication
  • action_dispatch.key_generator : #ActiveSupport::CachingKeyGenerator:0x00000003d101c0
  • action_dispatch.logger : #Logger:0x00000004e5b790
  • action_dispatch.parameter_filter : [:password]
  • action_dispatch.redirect_filter : []
  • action_dispatch.remote_ip : 192.168.20.236
  • action_dispatch.request.content_type : application/x-www-form-urlencoded
  • action_dispatch.request.formats : [#<Mime::Type:0x00000001eb0d10 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html", @hash=2465596393821191934>]
  • action_dispatch.request.parameters : {"_method"=>"put", "authenticity_token"=>"k4ILk+78HD5k5nfYgFHPBYjGSHypnBWJ/sTG3S9vAjxpi3TYC1ty9TYCy8DJGO7LheZj1lVDaIIff6G5d5F2Pg==", "controller"=>"release_logs", "action"=>"send_notification", "project_id"=>"web", "id"=>"12", "type"=>"successful_release"}
  • action_dispatch.request.path_parameters : {:controller=>"release_logs", :action=>"send_notification", :project_id=>"web", :id=>"12", :type=>"successful_release"}
  • action_dispatch.request.query_parameters : {}
  • action_dispatch.request.request_parameters : {"_method"=>"put", "authenticity_token"=>"k4ILk+78HD5k5nfYgFHPBYjGSHypnBWJ/sTG3S9vAjxpi3TYC1ty9TYCy8DJGO7LheZj1lVDaIIff6G5d5F2Pg=="}
  • action_dispatch.request.unsigned_session_cookie: {"session_id"=>"a14ea04530621b2c5cdb2db73c5ec364", "user_id"=>35, "tk"=>"393a745b92f76d731a153b218f0976d5a51bf2a8", "_csrf_token"=>"+gl/S+WnbstS5LwYSUkhzg0gK6r8330L4btnZFj+dAI=", "recent_projects"=>[11, 10], "query"=>{:project_id=>11, :filters=>{"status_id"=>{:operator=>"=", :values=>["1", "2", "8"]}, "fixed_version_id"=>{:operator=>"!*", :values=>[""]}}, :group_by=>"assigned_to", :column_names=>nil, :totalable_names=>[:estimated_hours, :spent_hours]}, "issues_index_sort"=>"priority:desc", "my_page_sort"=>"none"}
  • action_dispatch.request_id : 781e8d27-814a-469c-8544-887d284fb15f
  • action_dispatch.routes : #ActionDispatch::Routing::RouteSet:0x00000004c99ec0
  • action_dispatch.secret_key_base : 0766de1a38458f6ed259d92d32f935a6d1ca6679e6bf4ee258716df9e83186497557be97146359d2
  • action_dispatch.secret_token :
  • action_dispatch.show_detailed_exceptions : false
  • action_dispatch.show_exceptions : true
  • action_dispatch.signed_cookie_salt : signed cookie
  • async.callback : #<Method: Thin::Connection#post_process>
  • async.close : #EventMachine::DefaultDeferrable:0x0000000ce00fb8
  • rack.errors : #IO:0x00000000665580
  • rack.input : #StringIO:0x0000000ce2a3b8
  • rack.methodoverride.original_method : POST
  • rack.multiprocess : false
  • rack.multithread : false
  • rack.request.cookie_hash : {"autologin"=>"775556d14b46d507dc3cf73c85ae8e67a508273a", "_redmine_session"=>"R2QvZjVoTmxHcjE0MndodUpqbGlWZGlTNno5MDJGbkxmdWlPSlI1clFYM3lBd3U3RlV3QjdKVUprYzJpR1JlZ3kyOGNqOGFiTDNYTmk0UmhaNnRWWnBQQmcyL25yL0tUd1NoRnoycGtvVldBN2FBeDNIc2Q5RWFINnlEbmtaOWxBRlRJUEN4ZG5tbldZWktqYnhPUURQZ0sraGdYN0Q5RUZrb1R3U25iRjF4Tnd3SU9XNkc0UjZXS1Z5enBxMTFkVmdheWJjMkxXYWQwL0ovdHdxKzRzdEwzNzYyZ0V3Tk85NGh0SXlET0hmdUxMQW5qV2lTTStlZ3JjdXlodHIzRUtMYnF3MFJYbG5lbGxiWG4ySlZud1ZyQlhTTnJyUnducmE1ZFI1aGRJSFdvb0dreHBYTVFwVG5sRjhrQjF3Zm5VMTJoWS93NEVQUmMxdEJUVUllU3BvdlhKbTltdm1uOGNCZjN1aGU1Z0F1WG1sU2s3RW5jNlhYTnVhR1ZSekZGcVZUWVFyZzladWROSWM4elpZMjMr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1WG1sU2s3RW5jNlhYTnVhR1ZSekZGcVZUWVFyZzladWROSWM4elpZMjMrRlNWQWdBOXEvN3dVelZMZEdHSk5ncm5qRzVkVVUyQzNpMGlSSU5YRUFlVWoyNG1ZVFR0MDJ5U01pZ0ViRm1LSk41SFV4OVhqUSt5RzRvRXlSUTBrNFBKa0xhTzY0aC9MWEkyWC9SL0RPamdPc1RjNzRFbEVnbndZMlVDRURMd01XV2cvYldOVWsrWGlTT0RuTkorSVBaWVNjL1FKd2VMb2hYQlVEZElpSGxSN28za2ptQU82Tk5MRVAyV1NMUDBVMmRqNGlCWGFlZXZSbWVVK0JwSkh6T1pmWDBOYWxISzlWbkRhVmtSbmlIY2ZhV29keUs3ODgydGdHRkt0QmtmUk5ucUphRS9ieklUOEFxNHk1eFdGcUxWOTduL3E3bjBkZmUwYXJBcHM1cFR6cm5TaUQ1ZzlRTDBESmJ5bWFzQk05S1FuVVk2Q0x6ckZUa2NnbCs0S0VrPS0tRFpva0hxRXBTYU45NVVMNWFTbDRBUT09--c2b48028934179ad35a886cd30b0109541e5f3be
  • rack.request.form_hash : {"_method"=>"put", "authenticity_token"=>"k4ILk+78HD5k5nfYgFHPBYjGSHypnBWJ/sTG3S9vAjxpi3TYC1ty9TYCy8DJGO7LheZj1lVDaIIff6G5d5F2Pg=="}
  • rack.request.form_input : #StringIO:0x0000000ce2a3b8
  • rack.request.form_vars : [FILTERED]
  • rack.request.query_hash : {}
  • rack.request.query_string :
  • rack.run_once : false
  • rack.session : #ActionDispatch::Request::Session:0x0000000cdeb708
  • rack.session.options : #ActionDispatch::Request::Session::Options:0x0000000cdeb528
  • rack.url_scheme : http
  • rack.version : [1, 0]

Backtrace:

plugins/release_logs/app/models/release_log_queue.rb:23:in block in <class:ReleaseLogQueue>' plugins/release_logs/app/models/release_log_queue.rb:57:incall'
plugins/release_logs/app/models/release_log_queue.rb:57:in block in generate_title' plugins/release_logs/app/models/release_log_queue.rb:56:ineach'
plugins/release_logs/app/models/release_log_queue.rb:56:in inject' plugins/release_logs/app/models/release_log_queue.rb:56:ingenerate_title'
plugins/release_logs/app/models/release_log.rb:132:in queue_title_for_release_log' plugins/release_logs/app/controllers/release_logs_controller.rb:88:insend_notification'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

@danielvijge
Copy link
Contributor Author

Can't reproduce it on my test environment. But I'll take a look at it once I get around testing it with old data

@danielvijge
Copy link
Contributor Author

Pushed some new commits that should fix backward compatibility issues with any release logs created using the old configuration. Old release logs are still displayed as a number in the overview, newer release logs are displayed by the release queue title.
Known issue is there is an error when creating a new release log where there are no Redmine versions at all for project.

@archonwang
Copy link
Contributor

@danielvijge , Thanks
I will test it later.

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.

4 participants