Capgemini / Capgemini/powerapps-packagedeployer-template

Auto-number seed setting logic should check the current highest value

Open
#52 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
27
Forks
8
PR merge metrics
No merged PRs in 30d

Description

## Is your feature request related to a problem? Please describe
Currently when a seed value is changed there is no check to see if the new seed value is lower than the old seed value. Because auto-number attributes do not enforce unique values, this runs the risk of duplicate values if an auto-number seed is set lower than the previous value.

## Describe the solution you'd like
- Logic that checks if the desired seed value is lower than what is in the current environment and prevents the seed being set and outputs a warning/error to the log file.
- This will require a query for the last created record that uses the auto-number attribute
- An optional boolean parameter for the ImportConfig.xml called `forceseedsetting` that can be used to override the logic
- Information should be logged to indicate when the seed has been set because of an override
- Tests to validate the logic and that the values have not been changed in the target environment unless the `forceseedsetting` parameter is provided.

## Additional context
The auto-number manager tool from XRM Toolbox has logic that can query and parse the current auto-number value: https://github.com/rappen/AutoNumManager/blob/16a19098465a454f98db28b96316f538497ca1cd/AutoNumMgr.cs#L479

Contributor guide

Open the contributing guide

Research direction

Start by locating the auto-number seed handling and the ImportConfig.xml parsing in the package deployer. Review the linked AutoNumManager logic for how the current value is queried and parsed, then identify the existing test area for deployment configuration. Done means lower seeds are blocked and logged, forceseedsetting overrides that behavior with an audit message, and tests cover both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devops, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.