Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NDEV-60 Status inconsistences in Analyses in secondary Analysis Requests #214

Merged
merged 4 commits into from
Aug 7, 2017

Conversation

xispa
Copy link
Member

@xispa xispa commented Aug 6, 2017

When an Analysis Request is created by reusing a previously generated Sample (Secondary Analysis Request), the Analyses remains in "sample_registered". Their status should be "sample_due" if sampling workflow is enabled or "to_be_sampled" if the sampling workflow is disabled:

ndev60

With this Pull Request, the function responsible of creating an Analysis Request based on the parameters set in the AR Add form checks if is a Secondary AR and in such case, the system tries to

  1. automatically transition the AR to the same state as the original Sample
  2. Create new Sample Partition(s) for the new AR (it doesn't make sense to reuse previous partition/s)
  3. automatically transition each Sample Partition (along with their analyses) to the state that matches better with the state of the previously created Sample.

With this PR, a bad behavior when trying to calculate the partitions for a given SampleType via ajax has been fixed. The system was trying to obtain a SampleType by using its title instead of the UID.

xispa added 3 commits August 6, 2017 13:12
In the funciton sample_set(arnum), the js calls to secondary_ar_sample_info
and it returns a dictionary (data) with the default values that must be
applied to the current Analysis Request. For some fields, there are duplicated
keys for the same object (<fieldname>_uid and <fieldname>), so the values are
not set correctly in the current state_set variable, causing that, for example,
when the system tries to get the information of partitions based on the Sample
Type, the system uses the SampleType name instead of its uid, making the system
fail to return that partition information.
spartnum = int(spart.getId().split(prefix)[1])
if spartnum > part_num:
part_num = spartnum

for n, partition in enumerate(partitions):
# Calculate partition id
partition_prefix = sample.getId() + "-P"
Copy link
Contributor

@nihadness nihadness Aug 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line (110) is just a repeat of the line # 102 ? Should we take 102 out of if condition and delete this line?

@nihadness nihadness merged commit 69a6bda into wip Aug 7, 2017
@xispa xispa deleted the NDEV-60-status-inconsistences-secondary-ar branch August 24, 2017 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants