<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:10:17 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-68246] change calls to `boost::optional` members `is_initialized` and `get` (via clang-tidy)</title>
                <link>https://jira.mongodb.org/browse/SERVER-68246</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Update all occurrences of &lt;tt&gt;boost::optional&lt;/tt&gt;&apos;s &lt;tt&gt;is_initialized&lt;/tt&gt; or &lt;tt&gt;get&lt;/tt&gt; members.&lt;/p&gt;

&lt;p&gt;(comes out of Skunkworks July 2022)&lt;/p&gt;

&lt;p&gt;We should prefer using the API that&apos;s common between boost::optional and std::optional where we can, and we can in these cases.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;boost::optional&lt;/tt&gt; has deprecated the &lt;tt&gt;is_initialized&lt;/tt&gt; member, in favor of the &lt;tt&gt;std::optional&lt;/tt&gt;-compatible name &lt;tt&gt;has_value&lt;/tt&gt;. Change all occurrences of &lt;tt&gt;is_initialized&lt;/tt&gt; to &lt;tt&gt;has_value&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;boost::optional&lt;/tt&gt; has a &lt;tt&gt;get&lt;/tt&gt; member, and &lt;tt&gt;std::optional&lt;/tt&gt; does not. The common subset has two choices to &lt;tt&gt;get()&lt;/tt&gt; calls: &lt;tt&gt;operator*()&lt;/tt&gt; and &lt;tt&gt;value()&lt;/tt&gt;.  &lt;tt&gt;operator*()&lt;/tt&gt; does exactly what &lt;tt&gt;get()&lt;/tt&gt; does, but has a weird name and may not actually represent the intent of the caller. &lt;tt&gt;get&lt;/tt&gt; has undefined behavior if the object is empty. Change these to &lt;tt&gt;value&lt;/tt&gt;, which is supported by &lt;tt&gt;std::optional&lt;/tt&gt; and throws on empty, making it a safer default choice. &lt;tt&gt;get()&lt;/tt&gt; can be changed to &lt;tt&gt;operator*()&lt;/tt&gt; if the &lt;tt&gt;value()&lt;/tt&gt; behavior is inappropriate.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Future recurrences will be hard to lint on, but easy to clang-tidy on when we can load plugins into clang-tidy. This conversion is done by a clang-tidy plugin in the first place. In the meantime, the clang-tidy plugin can be compiled in.&lt;/p&gt;

&lt;p&gt;The plugin: &lt;a href=&quot;https://github.com/BillyDonahue/mongo_std_optional_migration&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/BillyDonahue/mongo_std_optional_migration&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2097692">SERVER-68246</key>
            <summary>change calls to `boost::optional` members `is_initialized` and `get` (via clang-tidy)</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="billy.donahue@mongodb.com">Billy Donahue</assignee>
                                    <reporter username="billy.donahue@mongodb.com">Billy Donahue</reporter>
                        <labels>
                    </labels>
                <created>Sat, 23 Jul 2022 21:22:15 +0000</created>
                <updated>Wed, 6 Dec 2023 19:05:12 +0000</updated>
                            <resolved>Thu, 28 Jul 2022 00:56:30 +0000</resolved>
                                                    <fixVersion>6.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4726761" author="billy.donahue" created="Wed, 3 Aug 2022 21:00:11 +0000"  >&lt;p&gt;The tool was pretty effective but actually missed a number of cases. Don&apos;t know why yet.&lt;br/&gt;
Maybe the clang ast couldn&apos;t be generated for some reason on some .cpp files.&lt;br/&gt;
Maybe it doesn&apos;t work on headers. Something like that. Mystery for next time, maybe.&lt;/p&gt;</comment>
                            <comment id="4710386" author="billy.donahue" created="Wed, 27 Jul 2022 22:50:02 +0000"  >&lt;p&gt;Well, I&apos;ve mowed the lawn once, pretty much.&lt;br/&gt;
I still need to change IDL so that it doesn&apos;t produce .get and .is_initialized calls (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-68376&quot; title=&quot;IDL: don&amp;#39;t emit optional get and is_initialized calls &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-68376&quot;&gt;&lt;del&gt;SERVER-68376&lt;/del&gt;&lt;/a&gt;).&lt;br/&gt;
The tool will continue to be available to rerun at will.&lt;br/&gt;
Hopefully we can add it to the clang-tidy in Evergreen CI.&lt;/p&gt;</comment>
                            <comment id="4710380" author="xgen-internal-githook" created="Wed, 27 Jul 2022 22:46:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Billy Donahue&apos;, &apos;email&apos;: &apos;billy.donahue@gmail.com&apos;, &apos;username&apos;: &apos;BillyDonahue&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-68246&quot; title=&quot;change calls to `boost::optional` members `is_initialized` and `get` (via clang-tidy)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-68246&quot;&gt;&lt;del&gt;SERVER-68246&lt;/del&gt;&lt;/a&gt; rewrite calls to boost::optional get and is_initialized&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/10gen/mongo-enterprise-modules/commit/a24ec7e8ce3cb4821f1abcfcb479a50428c655f0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-enterprise-modules/commit/a24ec7e8ce3cb4821f1abcfcb479a50428c655f0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4709899" author="xgen-internal-githook" created="Wed, 27 Jul 2022 19:38:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Billy Donahue&apos;, &apos;email&apos;: &apos;BillyDonahue@users.noreply.github.com&apos;, &apos;username&apos;: &apos;BillyDonahue&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-68246&quot; title=&quot;change calls to `boost::optional` members `is_initialized` and `get` (via clang-tidy)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-68246&quot;&gt;&lt;del&gt;SERVER-68246&lt;/del&gt;&lt;/a&gt; rewrite calls to boost::optional get and is_initialized&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/958ad9abfc80861d3f43f44da694e83464b01e1d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/958ad9abfc80861d3f43f44da694e83464b01e1d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4707636" author="billy.donahue" created="Wed, 27 Jul 2022 04:27:57 +0000"  >&lt;p&gt;Woot! Finally got it. Thanks to the guy on the LLVM Discord #clang-tidy chat room who gave me some tips. This is pretty damn elegant considering what it&apos;s doing under the hood.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/BillyDonahue/mongo_std_optional_migration/blob/master/tool/lib/MongoStdOptionalMigration.cpp&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/BillyDonahue/mongo_std_optional_migration/blob/master/tool/lib/MongoStdOptionalMigration.cpp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using it to generate a PR now.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2101123">SERVER-68376</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2097697">SERVER-68247</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="322313">SERVER-26542</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2093290">SERVER-68121</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 27 Jul 2022 15:29:36 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 27 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 27 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i13kfr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0mdzk:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6380">Service Arch 2022-08-08</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i136l3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>