<h3 dir="auto">Description</h3>
<p dir="auto">PR improves using of note's description / author_id / author_ip by:</p>
<ol dir="auto">
<li>Adding new fields to notes table for storing these 3 values</li>
<li>Copying values from first note's comment to notes table</li>
<li>Replacing using note's description / author / author_id from first note's comment with from note's table directly</li>
</ol>
<p dir="auto">A few comments:</p>
<ul dir="auto">
<li>We left adding description to body when creating new note - it looked dirty to add blank string ("") or similar, also, left comments body intact during data-migration for improving performances,</li>
<li>We kept backward compatibility of generated XML / JSON / .. by inserting note's description as a first comment's text,</li>
<li>We added more robust version of data-migration script for retrying migration of failed notes.</li>
</ul>
<h3 dir="auto">How has this been tested?</h3>
<p dir="auto">By running automated tests and by semi-manual testing (semi-manual generating notes, doing migration and applying changes, manually checking rendered notes and new memory variables content).</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5485'>https://github.com/openstreetmap/openstreetmap-website/pull/5485</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/commits/035f25bf38e1b99fc7b534e35eef7b49b9311b09" class="commit-link">035f25b</a> Added description, user_id and user_ip to notes</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/commits/f32fca8d4af03419ff3bd3f4cb06ae8432da0c4f" class="commit-link">f32fca8</a> Improved note's creation to use Note.description</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/commits/b3171b9aebdea3081b57b4155203e8ee5497cc92" class="commit-link">b3171b9</a> Improved note's displaying to use Note attributes</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/commits/3273d25576dd81a17c7e86170665aedec43a7867" class="commit-link">3273d25</a> Updated j(builder) files to use Note.description</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/commits/1d5badeafc68dc7ff886e0f081d716a616747c0d" class="commit-link">1d5bade</a> Updated tests to work with the latest changes</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/commits/3981e9e02daec8441340bda6572111c795df82cb" class="commit-link">3981e9e</a> Enhance backfill migration script with logging, retries, and conversion fixes</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files">16 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-6e9fe051c0ef757618e376ffe731dfca8d4960ef0838b7d6a05609b46ba0fad1">app/controllers/api/notes_controller.rb</a>
(35)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-08ddccf408b18937e98b422e555eaf851c2a02c3ba815c5aeb8bc00efe65ecab">app/models/note.rb</a>
(37)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-18be84c122e5d758164e201f2446cae5a1d2cd1f11380185299133daba685877">app/views/api/notes/_comment.html.erb</a>
(10)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-a14835243072d71830ba15ff480de24e3146811fabdf73b7e35670af209fbf05">app/views/api/notes/_note.json.jbuilder</a>
(9)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-143dab9bcdf18ed43c02d5c815e4fb922faf69c55a45c4c8af8c7cb07af310e9">app/views/api/notes/_note.xml.builder</a>
(9)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-84d04c9c37a8be927ab1870e6b3c1940f670585b77b8e88c32d6ded35cf87dc7">app/views/notes/show.html.erb</a>
(2)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-c7550b509060a5a1f9fc051629dd33738c2365eade2ed091183adce2b9b88fe7">db/migrate/20250104140952_add_description_to_notes.rb</a>
(9)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-c93618bcf92b6865021114d39c71051f924e7599a844810f3872a6399a0c7ffb">db/migrate/20250105154621_validate_foreign_key_on_notes.rb</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-e32cc8156bb1e0e1482e405b32ed678025a517cba758a647e4ae008a951d89f2">db/migrate/20250106160355_backfill_note_descriptions.rb</a>
(169)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-1dd5a8f580b9615769ddc19a64a98f455d9d20eb149c443f41d9d3c797d39b12">db/structure.sql</a>
(16)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-b4cc80ae5a4279eef2a7494cb8c489220ce03acaf36932b2042247df9d316908">test/controllers/api/notes_controller_test.rb</a>
(12)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-e5faca18e5e52daf20d8ffd5f110da070f121d1a9d07794e08f4522ffe45c6a5">test/factories/notes.rb</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-b93fe6b2fae5309f99ba81772f10cf26c2d05ce9eb923b430a03de6121951964">test/models/note_test.rb</a>
(16)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-74c3414af0a76b3935f1a316c51c37b9415ded1fd811d596ba523d38e7c1489b">test/system/index_test.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-8358a7e67a0668bb274231cf66a04040514feaf99359175ea3b51a8306979081">test/system/report_note_test.rb</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485/files#diff-57c59e735efb356e2a24b9fb26199792d98a0749cf882be51d34ba637c9ebcfa">test/system/report_user_test.rb</a>
(4)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5485.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5485.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5485.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5485.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5485">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLID7SOUXONGY5IU4B32JVPZ5AVCNFSM6AAAAABU2OLO2WVHI2DSMVQWIX3LMV43ASLTON2WKOZSG43TKOJWHAZTCOA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLL3IQU33IZHXQ6VOPL2JVPZ5A5CNFSM6AAAAABU2OLO2WWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHKK5PKHY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5485</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5485",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5485",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>