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

Pivotal ID # 185361632: Avoid Files Modification On Public Studies #855

Merged
merged 8 commits into from
Jul 25, 2024

Conversation

jhoanmanuelms
Copy link
Contributor

https://www.pivotaltracker.com/story/show/185361632

  • Create a new stage to validate file changes
  • Add new permission to allow file modifications on public studies
  • Mark the submission as invalid in case the file validation fails
  • Add integration tests

- Create a new stage to validate file changes
- Add new permission to allow file modifications on public studies
- Mark the submission as invalid in case the file validation fails
- Add integration tests
@jhoanmanuelms jhoanmanuelms self-assigned this Jul 12, 2024
@jhoanmanuelms jhoanmanuelms requested a review from Juan-EBI July 12, 2024 16:00
Copy link
Contributor

@Juan-EBI Juan-EBI left a comment

Choose a reason for hiding this comment

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

Looking good please check comments

}

@Test
fun `5-8 authorized user updates public submission files`() =
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need 3 more scenarios.

  1. Allow pagetab files to be modified (without specific permisions).
  2. Allow file list metadata to be modified (without specific permisions).
  3. File list files can not be modified

Copy link
Contributor Author

@jhoanmanuelms jhoanmanuelms Jul 16, 2024

Choose a reason for hiding this comment

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

Number 1 is already there

Number 2 was added to the latest commit

Number 3 was added to an existing test case

I also added a new test to avoid removing the file list altogether

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we shoud use @nested as all this cases are related to the same scenario.

- Detect changes in pagetab files and keep count
- Fix the logic used to detect changes in the submission files
- Improve integration tests
- Improve code readability
- Remove unused code
Copy link
Contributor

@Juan-EBI Juan-EBI left a comment

Choose a reason for hiding this comment

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

LGTM please consider minor changes before merge

@@ -5,6 +5,7 @@ enum class AccessType {
ATTACH,
UPDATE,
DELETE,
UPDATE_PUBLIC,
Copy link
Contributor

Choose a reason for hiding this comment

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

in the future I think we may split this change in two tickets:

  1. Prevent non page tab files to be deleted
  2. Allow delete files annotation.

}

@Test
fun `5-8 authorized user updates public submission files`() =
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we shoud use @nested as all this cases are related to the same scenario.

@jhoanmanuelms jhoanmanuelms marked this pull request as ready for review July 23, 2024 15:38
@jhoanmanuelms jhoanmanuelms merged commit 8d99502 into master Jul 25, 2024
1 check passed
@jhoanmanuelms jhoanmanuelms deleted the feature/pivotal-#185361632-files-validation branch July 25, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants