<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:53:09 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-83787] Make shell helpers throw by default - removing need for wrapping in assert.commandWorked</title>
                <link>https://jira.mongodb.org/browse/SERVER-83787</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;insert() and insertMany() are the worst offenders, which occur in most tests and are always expected to work. I think helpers like &apos;createIndex&apos; are also great candidates. &lt;/p&gt;

&lt;p&gt;We may want to split this into multiple commits or even multiple tickets.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2514065">SERVER-83787</key>
            <summary>Make shell helpers throw by default - removing need for wrapping in assert.commandWorked</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-integration">Backlog - Query Integration</assignee>
                                    <reporter username="memento@mongodb.com">Memento Slack Bot</reporter>
                        <labels>
                            <label>make-server-testing-joyful</label>
                            <label>quick-tech-debt</label>
                    </labels>
                <created>Fri, 1 Dec 2023 16:04:13 +0000</created>
                <updated>Thu, 4 Jan 2024 19:54:04 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5950965" author="gregory.noma" created="Thu, 14 Dec 2023 14:31:34 +0000"  >&lt;p&gt;If we do this in conjunction with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-78457&quot; title=&quot;Remove assert.commandFailed() and assert.throws()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-78457&quot;&gt;SERVER-78457&lt;/a&gt; (and/or &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28567&quot; title=&quot;assert.throws should validate that the correct exception was thrown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28567&quot;&gt;SERVER-28567&lt;/a&gt;) then hopefully we won&apos;t have to worry about the `assert.throws`&lt;/p&gt;</comment>
                            <comment id="5950956" author="max.hirschhorn@10gen.com" created="Thu, 14 Dec 2023 14:28:31 +0000"  >&lt;blockquote&gt;
&lt;p&gt;insert() and insertMany() are the worst offenders, which occur in most tests and are always expected to work.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;FWIW, insertMany() does automatically throw a JavaScript error when a write error or write concern error occurs.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bf039e1c05da6b5bdd3339e8f9c8d14947ee8081/src/mongo/shell/crud_api.js#L325-L326&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bf039e1c05da6b5bdd3339e8f9c8d14947ee8081/src/mongo/shell/crud_api.js#L325-L326&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bf039e1c05da6b5bdd3339e8f9c8d14947ee8081/src/mongo/shell/bulk_api.js#L968-L971&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bf039e1c05da6b5bdd3339e8f9c8d14947ee8081/src/mongo/shell/bulk_api.js#L968-L971&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In particular, all DBCollection methods which were introduced as part of the CRUD API (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17953&quot; title=&quot;Implement Driver CRUD API Spec in shell&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17953&quot;&gt;&lt;del&gt;SERVER-17953&lt;/del&gt;&lt;/a&gt;) throw JavaScript errors on write errors and write concern errors. The existing DBCollection methods had been left as&amp;#45;is to avoid changing the semantics for any scripts (both within the mongodb/mongo codebase and externally). Now that the &lt;tt&gt;mongo&lt;/tt&gt; shell is no longer a released product, we have a lot more flexibility around changing the behavior of the existing DBCollection, etc. methods.&lt;/p&gt;

&lt;p&gt;Flipping the default so JavaScript errors are thrown by default on error seems ok to me. However I would be sad if the result increased the number of usages of assert.throws() in testing. assert.throws() passes when any JavaScript exception occurs and means it can be somewhat easy to pass for the wrong reason (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28567&quot; title=&quot;assert.throws should validate that the correct exception was thrown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28567&quot;&gt;SERVER-28567&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="5918690" author="gregory.noma" created="Fri, 1 Dec 2023 16:51:57 +0000"  >&lt;p&gt;I think it definitely make sense to make the behavior consistent among shell helpers. Currently some always return the command response whereas other throw upon a non-ok response. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="493834" name="Screenshot 2023-12-01 at 11.38.44 AM.png" size="545206" author="charlie.swanson@mongodb.com" created="Fri, 1 Dec 2023 16:40:50 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25467"><![CDATA[Query Integration]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 1 Dec 2023 16:51:57 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 weeks, 6 days 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_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>brenda.rodriguez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-integration</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>memento@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i32t2n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2klik:</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_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|i32f7z:</customfieldvalue>

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