https://www.chiliproject.org/2011-02-04T16:58:40+01:00ChiliProjectChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=98472011-02-04T16:58:40+01:00Derek Montgomerydeurk@deurk.net
<ul><li><strong>Start date</strong> set to <i>2011-02-04</i></li><li><strong>Estimated time</strong> deleted ()</li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>Normal</i></li><li><strong>Project</strong> set to <i>ChiliProject</i></li><li><strong>Target version</strong> set to <i>1.1.0 — Bell</i></li><li><strong>Assignee</strong> set to <i>Felix Schäfer</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>0</i></li><li><strong>Subject</strong> set to <i>Allow underscores in project identifiers</i></li><li><strong>Category</strong> deleted ()</li><li><strong>Tracker</strong> set to <i>Feature</i></li><li><strong>Due date</strong> deleted ()</li><li><strong>Subproject of</strong> deleted ()</li><li><strong>Description</strong> set to <i>If there is no specific reason to disallow underscores, can you please allow ...</i> <a href="/journals/9847/diff/description" class="lightbox-ajax">More</a></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=8282011-02-04T20:30:50+01:00Derek Montgomerydeurk@deurk.net
<ul><li><strong>Target version</strong> set to <i>1.1.0 — Bell</i></li><li><strong>File</strong> <i><i>CP_underscore_in_identifier.patch</i></i> added</li><li><strong>Assignee</strong> set to <i>Eric Davis</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Ready for review</i></li></ul><p>Added patch file (thanks thegcat)</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=8292011-02-04T20:50:15+01:00Holger Justchiliproject@meine-er.de
<ul></ul><p>We use that patch in different production sites for some time now. No issues whatsoever. I vote go.</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=8302011-02-04T20:52:29+01:00Holger Justchiliproject@meine-er.de
<ul><li><strong>Target version</strong> deleted (<strike><i>1.1.0 — Bell</i></strike>)</li><li><strong>Assignee</strong> deleted (<strike><i>Eric Davis</i></strike>)</li><li><strong>Status</strong> changed from <i>Ready for review</i> to <i>Needs more information</i></li></ul><p>Oh, forgot, we still need a test for that. So I withdraw my vote until we have a test failing without the patch and passing with it.</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=8422011-02-05T01:29:50+01:00Eric Davis
<ul></ul><p>Should we allow an identifier to start with an underscore also?</p>
<p>I also think there is a locale string that needs to be changed, identifier has a text hint:</p>
<pre>
text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed.<br />Once saved, the identifier can not be changed.'
</pre>
<p>Holger: should we set the Status to Open? Needs more information is used if the request isn't clear.</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=8442011-02-05T01:41:44+01:00Holger Justchiliproject@meine-er.de
<ul><li><strong>Status</strong> changed from <i>Needs more information</i> to <i>Open</i></li></ul><p>Eric Davis wrote:</p>
<blockquote>
<p>Holger: should we set the Status to Open? Needs more information is used if the request isn't clear.</p>
</blockquote>
<p>Probably better, yes.</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=8492011-02-05T11:02:23+01:00Felix Schäferfelix+chili@oh14.de
<ul></ul><p>Eric Davis wrote:</p>
<blockquote>
<p>Should we allow an identifier to start with an underscore also?</p>
</blockquote>
<p>I can't think of a reason not too.</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=11702011-02-20T17:25:36+01:00Felix Schäferfelix+chili@oh14.de
<ul><li><strong>Assignee</strong> set to <i>Felix Schäfer</i></li></ul><p>Holger Just wrote:</p>
<blockquote>
<p>Oh, forgot, we still need a test for that. So I withdraw my vote until we have a test failing without the patch and passing with it.</p>
</blockquote>
<p>I'll give it a try. Is this small enough for 1.2.0?</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=11802011-02-20T22:35:19+01:00Toshi MARUYAMA
<ul></ul><p>Please see.</p>
<ul>
<li><a class="external" href="http://www.redmine.org/issues/6253">http://www.redmine.org/issues/6253</a></li>
<li><a class="external" href="http://www.redmine.org/issues/7493">http://www.redmine.org/issues/7493</a></li>
</ul> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=11812011-02-20T22:39:12+01:00Toshi MARUYAMA
<ul></ul><p>You need to change config/routes.rb.</p>
<p><a class="external" href="https://github.com/brentsowers1/redmine/blob/master/config/routes.rb#L198">https://github.com/brentsowers1/redmine/blob/master/config/routes.rb#L198</a></p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=11882011-02-21T20:45:20+01:00Felix Schäferfelix+chili@oh14.de
<ul><li><strong>Target version</strong> set to <i>1.1.0 — Bell</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Ready for review</i></li></ul><p>Proposed patch:</p>
<pre><code class="diff syntaxhl"><span class="CodeRay"><span class="line-numbers"> 1</span><span class="line comment">diff --git a/app/models/project.rb b/app/models/project.rb</span>
<span class="line-numbers"> 2</span><span class="line comment">index 8315a48..eb0da23 100644</span>
<span class="line-numbers"> 3</span><span class="line head"><span class="head">--- </span><span class="filename">a/app/models/project.rb</span></span>
<span class="line-numbers"> 4</span><span class="line head"><span class="head">+++ </span><span class="filename">b/app/models/project.rb</span></span>
<span class="line-numbers"> 5</span><span class="change"><span class="change">@@</span> -75,7 +75,7 <span class="change">@@</span></span> <span class="keyword">class</span> <span class="class">Project</span> < <span class="constant">ActiveRecord</span>::<span class="constant">Base</span>
<span class="line-numbers"> 6</span> validates_length_of <span class="symbol">:homepage</span>, <span class="symbol">:maximum</span> => <span class="integer">255</span>
<span class="line-numbers"> 7</span> validates_length_of <span class="symbol">:identifier</span>, <span class="symbol">:in</span> => <span class="integer">1</span>..<span class="constant">IDENTIFIER_MAX_LENGTH</span>
<span class="line-numbers"> 8</span> <span class="comment"># donwcase letters, digits, dashes but not digits only</span>
<span class="line-numbers"> 9</span><span class="line delete"><span class="delete">-</span> validates_format_of <span class="symbol">:identifier</span>, <span class="symbol">:with</span> => <span class="regexp"><span class="delimiter">/</span><span class="content">^(?!</span><span class="char">\d</span><span class="content">+$)[a-z0-9</span><span class="char">\-</span></span><span class="regexp"><span class="content">]*$</span><span class="delimiter">/</span></span>, <span class="symbol">:if</span> => <span class="constant">Proc</span>.new { |p| p.identifier_changed? }</span>
<span class="line-numbers"><strong>10</strong></span><span class="line insert"><span class="insert">+</span> validates_format_of <span class="symbol">:identifier</span>, <span class="symbol">:with</span> => <span class="regexp"><span class="delimiter">/</span><span class="content">^(?!</span><span class="char">\d</span><span class="content">+$)[a-z0-9</span><span class="char">\-</span></span><span class="eyecatcher"><span class="regexp"><span class="content">_</span></span></span><span class="regexp"><span class="content">]*$</span><span class="delimiter">/</span></span>, <span class="symbol">:if</span> => <span class="constant">Proc</span>.new { |p| p.identifier_changed? }</span>
<span class="line-numbers">11</span> <span class="comment"># reserved words</span>
<span class="line-numbers">12</span> validates_exclusion_of <span class="symbol">:identifier</span>, <span class="symbol">:in</span> => <span class="string"><span class="delimiter">%w(</span><span class="content"> new </span><span class="delimiter">)</span></span>
<span class="line-numbers">13</span>
<span class="line-numbers">14</span><span class="line comment">diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb</span>
<span class="line-numbers">15</span><span class="line comment">index 8eb79fd..936008b 100644</span>
<span class="line-numbers">16</span><span class="line head"><span class="head">--- </span><span class="filename">a/test/unit/project_test.rb</span></span>
<span class="line-numbers">17</span><span class="line head"><span class="head">+++ </span><span class="filename">b/test/unit/project_test.rb</span></span>
<span class="line-numbers">18</span><span class="change"><span class="change">@@</span> -101,6 +101,7 <span class="change">@@</span></span> <span class="keyword">class</span> <span class="class">ProjectTest</span> < <span class="constant">ActiveSupport</span>::<span class="constant">TestCase</span>
<span class="line-numbers">19</span> to_test = {<span class="string"><span class="delimiter">"</span><span class="content">abc</span><span class="delimiter">"</span></span> => <span class="predefined-constant">true</span>,
<span class="line-numbers"><strong>20</strong></span> <span class="string"><span class="delimiter">"</span><span class="content">ab12</span><span class="delimiter">"</span></span> => <span class="predefined-constant">true</span>,
<span class="line-numbers">21</span> <span class="string"><span class="delimiter">"</span><span class="content">ab-12</span><span class="delimiter">"</span></span> => <span class="predefined-constant">true</span>,
<span class="line-numbers">22</span><span class="line insert"><span class="insert">+</span> <span class="string"><span class="delimiter">"</span><span class="content">ab_12</span><span class="delimiter">"</span></span> => <span class="predefined-constant">true</span>,</span>
<span class="line-numbers">23</span> <span class="string"><span class="delimiter">"</span><span class="content">12</span><span class="delimiter">"</span></span> => <span class="predefined-constant">false</span>,
<span class="line-numbers">24</span> <span class="string"><span class="delimiter">"</span><span class="content">new</span><span class="delimiter">"</span></span> => <span class="predefined-constant">false</span>}
<span class="line-numbers">25</span>
</span></code></pre>
<p>As this doesn't break backwards compatibility, I'd even put it in 1.1, feel free to reschedule if you don't agree.</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=12072011-02-22T19:18:05+01:00Eric Davis
<ul></ul><p>Felix:</p>
<p>Need to change the i18n strings too. See <a href="https://www.chiliproject.org/issues/146#note-4" class="external">note 4</a> above</p> ChiliProject - Feature #146: Allow underscores in project identifiershttps://www.chiliproject.org/issues/146?journal_id=12122011-02-22T20:52:25+01:00Felix Schäferfelix+chili@oh14.de
<ul><li><strong>Status</strong> changed from <i>Ready for review</i> to <i>Closed</i></li></ul><p>I didn't want to spam with the locale changes :-) Committed in <a href="https://www.chiliproject.org/projects/chiliproject/repository/revisions/9ed2d8ed77906c21f6df8331008aad2adcf23148" class="changeset" title="Allow underscores in project identifiers. #146">9ed2d8ed77906c21f6df8331008aad2adcf23148</a>.</p>