Skip to content

GH Issue 1257: Check for duplicates among field names, import aliases, and parent import aliases - #3128

Merged
labkey-susanh merged 8 commits into
developfrom
fb_aliasDupes
Jul 30, 2026
Merged

GH Issue 1257: Check for duplicates among field names, import aliases, and parent import aliases#3128
labkey-susanh merged 8 commits into
developfrom
fb_aliasDupes

Conversation

@labkey-susanh

Copy link
Copy Markdown
Contributor

@labkey-susanh
labkey-susanh requested a review from cnathe July 28, 2026 13:36
updatePage.getFieldsPanel().addField("DupeAliasCheck")
.setImportAliases(GOOD_PARENT_NAME);
errors = updatePage.clickSaveExpectingErrors();
errorMsgExpectedTxt = "Field DupeAliasCheck has an import alias " + GOOD_PARENT_NAME + " that conflicts with a parent alias header.";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any reason we need to add some checks for the other cases here like having multiple fields that have the same import alias or having an import alias that matches a parent alias? Or maybe some of that could be covered with junit tests (not sure what our validation coverage looks like there for domains).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't include that here because this test class is specifically for SampleTypeParentColumnTest. So, tests aren't completely done for this branch.

Comment on lines +332 to +335
checker().verifyThat("Expected an error when two fields share an import alias differing only by case",
String.join("\n", createPage.clickSaveExpectingErrors()),
containsString("You have 2 field errors."));
checker().screenShotIfNewError("duplicateImportAliasIgnoringCase");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI, you can give a screenshot name to the .withScreenshot call:

checker().withScreenshot("duplicateImportAlias").verifyThat("Expected an error when two fields share an import alias",

Comment on lines +341 to +344
checker().verifyThat("Expected an error when an import alias matches another field's name",
String.join("\n", createPage.clickSaveExpectingErrors()),
containsString("Import alias '" + fieldTwo + "' on field '" + fieldOne + "' conflicts with a field name."));
checker().screenShotIfNewError("importAliasConflictsWithFieldName");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

@labkey-susanh
labkey-susanh merged commit dc86087 into develop Jul 30, 2026
7 checks passed
@labkey-susanh
labkey-susanh deleted the fb_aliasDupes branch July 30, 2026 22:35
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