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

Feat/717 Ensure unique filenames in eFormidling shipment #774

Merged
merged 5 commits into from
Sep 17, 2024

Conversation

bjorntore
Copy link
Contributor

Avoid duplicated filenames in eFormidling shipment.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@bjorntore bjorntore self-assigned this Sep 12, 2024
Copy link
Member

@ivarne ivarne left a comment

Choose a reason for hiding this comment

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

Looks good, and great tests.

I added a few tests for the unique function, and had to make a smal change to ensure everything passes.
Screenshot 2024-09-12 at 21 54 48

After writing the test I realised that it might be good to prefix attachments with filename arkivmelding with their data type.

@ivarne
Copy link
Member

ivarne commented Sep 13, 2024

After writing the test I realised that it might be good to prefix attachments with filename arkivmelding with their data type.

I was thinking something like this to ensure that no files starts with arkivmelding... but gets renamed to {dataType}-arkivmelding...

        List<string> dataTypeIds = applicationMetadata
            .DataTypes.Select(x => x.Id)
            .Concat([eformidlingMetadataFilename.Substring(eformidlingMetadataFilename.IndexOf('.'))])
            .ToList();

Copy link

sonarcloud bot commented Sep 13, 2024

@bjorntore bjorntore merged commit eedd776 into main Sep 17, 2024
10 checks passed
@bjorntore bjorntore deleted the feat/717-eformidling-unique-filenames branch September 17, 2024 08:44
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.

3 participants