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

Implement unique project name validation in Digger configuration #1767

Closed

Conversation

NikhilKalloli
Copy link

Closes #1309
This PR implements a crucial feature to ensure that project names in the Digger configuration (digger.yml) are unique. This is an important prerequisite for proper functionality, as Digger relies on project names to organize various resources, including state files.

Key Changes to Digger Configuration

1. Updated ValidateDiggerConfigYaml function in libs/digger_config/yaml.go:

  • Added a check to ensure project names are unique across all projects.
  • Returns an error if a duplicate project name is found, along with a descriptive message.

2. Modified ConvertDiggerYamlToConfig function in libs/digger_config/converters.go:

  • Implemented an additional check for duplicate project names during the configuration parsing process.
  • Returns an error if any duplicate project names are found.

3. Added a new test case TestDiggerConfigDuplicateProjectNames in libs/digger_config/digger_config_test.go:

  • Verifies that an error is raised when duplicate project names are present in the configuration.

4. Updated Documentation in docs/ce/reference/digger.yml.mdx:

  • Added a new section Project Name Uniqueness explaining the requirement for unique project names.
  • Provided examples of incorrect and correct project name configurations.
  • Updated the "Project" table in the "Reference" section to specify that the name field must be unique across all projects.

Please review these changes and let me know if any further modifications or clarifications are needed.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
}

// check for project name duplicates
// Check for project name duplicates
projectNames := make(map[string]bool)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello this duplication check is already being performed here, unfortunately your PR adds duplicate logic and that change has already been merged into the main branch

@motatoes
Copy link
Contributor

motatoes commented Nov 4, 2024

Hi there, thanks for contributing! unfortunately this issue is stale and has already been implemented in a previous PR, I unfortunately wont be able to accept this as a contribution

@motatoes motatoes closed this Nov 4, 2024
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.

digger.yml validation: ensure that project names are unique
2 participants