Conversation
The CS8981 warning on `internal enum componentstate` is suppressed the same way the generated context in MetadataGenerator.Context already handles it: the name deliberately mirrors the Dataverse logical name of the option set. While confirming the enums against the current Process (Workflow) table reference, three were behind Dataverse: Workflow_Category + ModernFlow (5), DesktopFlow (6), AIFlow (7) WorkflowState + Suspended (2) Workflow_StatusCode + CompanyDLPViolation (3) The category/statecode values were also hardcoded as literals in two places that these enums already describe, including a comment spelling out the mapping. Both now use the enums - WorkflowManager via the internal Workflow_Category, WorkflowReader via the generated workflow_category and workflow_statecode from its own context.
Bircck
force-pushed
the
remove-unused-componentstate-enum
branch
from
September 3, 2026 08:39
38f62b2 to
3335ba2
Compare
Author
|
Follow-up on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three small changes to the internal
workflowoption sets, all verified against the generated context inMetadataGenerator.Context, which is produced from a live org and checked into this repo.Refresh the enums
Workflow_CategoryModernFlow = 5,DesktopFlow = 6,AIFlow = 7WorkflowStateSuspended = 2Workflow_StatusCodeCompanyDLPViolation = 3The other four (
Workflow_Type,componentstate,Workflow_BusinessProcessType,Opportunity_StatusCode) already match and are untouched.Use
Workflow_Categoryinstead of literalsWorkflowManagercomparedcategoryagainst3and0in three places, with a// Category: 0 = Workflow, 3 = Actioncomment spelling out the mapping the enum already encodes.WorkflowReaderdid the same forstatecodeandcategory, and can use the generatedworkflow_statecode/workflow_categoryfrom the context project it already references.Values are unchanged, so this is behaviour-preserving.
WorkflowStateandWorkflow_StatusCodestill have no callers — refreshed for correctness, not because anything reads them. The legacyMetadataGenerator365/DataHelper.cshas the same literals but no context project to draw from; left alone to keep this small.Silence CS8981
warning CS8981: The type name 'componentstate' only contains lower-cased ascii charactersfires once, onUtility.cs:1210, undernet8.0only. The name deliberately mirrors the Dataverse logical name, and the generated context already wraps every such enum in#pragma warning disable CS8981— this does the same. Cosmetic: there's noTreatWarningsAsErrorsanywhere.Not in scope
Neither generator filters workflows on
typeorcomponentstate, and the test fixtures already hold a mix oftype=1andtype=2records. That's a behaviour change, filed separately.Verification
Build clean with zero CS8981. 664 net10.0, 656 net462, 83 generator tests, 0 failed.
https://claude.ai/code/session_01YWUbYsznntsbtkmxHDcvaa