<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:35:13 JST 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>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[INSTRM-1415] Add visit0 logic to IIC</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-1415</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;We want the SPS, FPS/MCS, and AGC visits to be synchronized by PFI convergence: for the visit used for the `fps moveToPfsDesign` command to be the one which starts that field&apos;s SPS and AGCC visits.&lt;/p&gt;</description>
                <environment></environment>
        <key id="18278">INSTRM-1415</key>
            <summary>Add visit0 logic to IIC</summary>
                <type id="3" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10518&amp;avatarType=issuetype">Task</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="arnaud.lefur">arnaud.lefur</assignee>
                                    <reporter username="cloomis">cloomis</reporter>
                        <labels>
                            <label>EngRun</label>
                    </labels>
                <created>Fri, 22 Oct 2021 21:12:07 +0000</created>
                <updated>Thu, 13 Jan 2022 18:32:53 +0000</updated>
                            <resolved>Thu, 13 Jan 2022 18:32:53 +0000</resolved>
                                                                    <component>ics_iicActor</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                <comments>
                            <comment id="23367" author="arnaud.lefur" created="Fri, 22 Oct 2021 22:26:06 +0000"  >&lt;p&gt;This logic has also to take into account that contrary to fps, other lightSource config change(dcb bundles, sunss pointing) is not necessarily associated with a visit. &lt;br/&gt;
it gets a visit0 when someone ask for a sps exposure basically.&lt;/p&gt;</comment>
                            <comment id="25064" author="arnaud.lefur" created="Sun, 14 Nov 2021 20:16:54 +0000"  >&lt;p&gt;okay, so that&apos;s 90% done, but I&apos;m hitting an opdb issue that cannot be worked around.&lt;br/&gt;
basically between &lt;em&gt;iic_sequence&lt;/em&gt; and &lt;em&gt;visit_set&lt;/em&gt; table.&lt;br/&gt;
&lt;em&gt;iic_sequence&lt;/em&gt; has a unique &lt;em&gt;visit_set_id&lt;/em&gt; and &lt;em&gt;visit_set&lt;/em&gt; has &lt;em&gt;pfs_visit_id&lt;/em&gt; as primary key which means that a given &lt;em&gt;pfs_visit_id&lt;/em&gt; can &lt;b&gt;only&lt;/b&gt; be associated with one &lt;em&gt;visit_set_id&lt;/em&gt;, which made sense with independent visits.&lt;/p&gt;

&lt;p&gt;But since we&apos;re sharing &lt;em&gt;pfs_visit_id&lt;/em&gt; among fps,sps,agc, and have a &lt;em&gt;visit_set_id&lt;/em&gt;,  for one of those, you want to insert several sequence for a given visit which break the constraint.&lt;/p&gt;

&lt;p&gt;One solution is to &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;add a &lt;em&gt;visit0&lt;/em&gt; column to &lt;em&gt;iic_sequence&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;change &lt;em&gt;visit_set_id&lt;/em&gt; to &lt;em&gt;visit0&lt;/em&gt; in &lt;em&gt;visit_set&lt;/em&gt; (without back-populating).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This way, you keep the unicity of &lt;em&gt;pfs_visit_id&lt;/em&gt;,&lt;em&gt;visit0&lt;/em&gt; in &lt;em&gt;visit_set&lt;/em&gt; but different &lt;em&gt;iic_sequence&lt;/em&gt; can share the same &lt;em&gt;visit0&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this case, renaming &lt;em&gt;visit_set_id&lt;/em&gt; to &lt;em&gt;sequence_id&lt;/em&gt; would probably make more sense, but do we care ? I&apos;m not sure.&lt;/p&gt;</comment>
                            <comment id="25065" author="arnaud.lefur" created="Sun, 14 Nov 2021 21:18:13 +0000"  >&lt;p&gt;okay last proposal after discussions with &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=cloomis&quot; class=&quot;user-hover&quot; rel=&quot;cloomis&quot;&gt;cloomis&lt;/a&gt; and &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=rhl&quot; class=&quot;user-hover&quot; rel=&quot;rhl&quot;&gt;rhl&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;rename iic_sequence.visit_set_id to iic_sequence.sequence_id&lt;/li&gt;
	&lt;li&gt;add iic_visit0 table with iic_sequence.sequence_id as primary key, and visit0&lt;/li&gt;
	&lt;li&gt;rename visit_set.visit_set_id to visit_set.visit0&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;m pulling opdb table from the summit and preparing a script to do those schema changes which I will hand off to &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=kiyoto.yabe&quot; class=&quot;user-hover&quot; rel=&quot;kiyoto.yabe&quot;&gt;Kiyoto Yabe&lt;/a&gt; when I&apos;m sure it&apos;s doing the right thing.&lt;/p&gt;</comment>
                            <comment id="25079" author="kiyoto.yabe" created="Mon, 15 Nov 2021 08:10:34 +0000"  >&lt;p&gt;That seems to be probably reasonable to me.&lt;/p&gt;

&lt;p&gt;`sequence_id` is totally different from `status_sequence_id` right? Can we make it as `iic_sequence_id` to avoid any confusion?&#160;&lt;/p&gt;

&lt;p&gt;A script for the schema change would be very helpful, but I prefer to make the actual change through the alembic mechanism after fixing `models.py`.&lt;/p&gt;

&lt;p&gt;This change probably affects the `obslog` so I took the liberty of inviting &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=michitaro&quot; class=&quot;user-hover&quot; rel=&quot;michitaro&quot;&gt;michitaro&lt;/a&gt;&#160;for further discussion.&lt;/p&gt;</comment>
                            <comment id="25088" author="arnaud.lefur" created="Mon, 15 Nov 2021 20:59:41 +0000"  >&lt;p&gt;in the end, that scheme was again not quite right, we&apos;re confusing the official visit0 with the first visit of the visit_set which is sometimes equivalent but sometimes not.&lt;/p&gt;

&lt;p&gt;the final proposal is actually much less disruptive than the previous one which is always good.&lt;/p&gt;

&lt;p&gt;we&apos;re adding a &lt;em&gt;field_set&lt;/em&gt; table :&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;visit_set_id = Column(Integer, ForeignKey(&apos;iic_sequence.visit_set_id&apos;), primary_key=True)&lt;/li&gt;
	&lt;li&gt;visit0 = Column(Integer, ForeignKey(&apos;pfs_config.visit0&apos;))&lt;/li&gt;
&lt;/ul&gt;



</comment>
                            <comment id="25089" author="arnaud.lefur" created="Mon, 15 Nov 2021 21:07:02 +0000"  >
&lt;p&gt;I also add to add a unique constraint on pfs_config.visit0 otherwise it&apos;s complaining the foreign key is not unique :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;ProgrammingError: (psycopg2.errors.InvalidForeignKey) there is no unique constraint matching given keys for referenced table &quot;pfs_config&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I check a bit more, it&apos;s true that currently there is no explicit unique contraint :&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;  CONSTRAINT pfs_config_pkey PRIMARY KEY (pfs_design_id, visit0),
  CONSTRAINT pfs_config_pfs_design_id_fkey FOREIGN KEY (pfs_design_id)
      REFERENCES public.pfs_design (pfs_design_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;compared to &lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;  CONSTRAINT pfs_config_pkey PRIMARY KEY (pfs_design_id, visit0),
  CONSTRAINT pfs_config_pfs_design_id_fkey FOREIGN KEY (pfs_design_id)
      REFERENCES public.pfs_design (pfs_design_id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT pfs_config_visit0_key UNIQUE (visit0)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m a bit confused about using _&lt;em&gt;table_args&lt;/em&gt;_ to pass contraints, it&apos;s look like it&apos;s not completely equivalent to declare a column unique.&lt;br/&gt;
&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=kiyoto.yabe&quot; class=&quot;user-hover&quot; rel=&quot;kiyoto.yabe&quot;&gt;Kiyoto Yabe&lt;/a&gt;, you have a better expertise than I do about sqlAlchemy, I will ask you to review this ticket.&lt;/p&gt;</comment>
                            <comment id="25100" author="kiyoto.yabe" created="Tue, 16 Nov 2021 22:14:10 +0000"  >&lt;p&gt;Changes look fine to me.&lt;/p&gt;</comment>
                            <comment id="25157" author="hassan" created="Thu, 18 Nov 2021 15:52:14 +0000"  >&lt;p&gt;Yabe-san has approved the changes.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="18285">INSTRM-1422</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|02qpqj:m</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10100" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Reviewers</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>kiyoto.yabe</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="123">PreEngRun4</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        </customfields>
    </item>
</channel>
</rss>