Skip to content

The CRM image build carries the file its analyzers are handed - #31

Open
nguyenngothuong wants to merge 1 commit into
votrongdao:devfrom
diginno-net:fix/crm-dockerfile-sonarlint
Open

nguyenngothuong wants to merge 1 commit into
votrongdao:devfrom
diginno-net:fix/crm-dockerfile-sonarlint

Conversation

@nguyenngothuong

Copy link
Copy Markdown

docker compose up --build cannot succeed on a clean checkout.

What happens

Directory.Build.props declares SonarLint.xml as an AdditionalFiles for every project. samples/crm/Dockerfile assembles its build context by hand — global.json, Directory.Build.props, FlowX.slnx, .editorconfig — and does not copy it.

The analyzers are then handed a path that does not exist, and the build does not degrade to “no Sonar rules”. It fails:

CSC : error AD0001: Analyzer 'SonarAnalyzer.CSharp.Rules.UseAwaitableMethod' threw an exception of type
'System.InvalidOperationException' with message 'File 'SonarLint.xml' has been added as an AdditionalFile
but could not be read and parsed.'
CSC : error CS2001: Source file '/src/SonarLint.xml' could not be found.

…one AD0001 per rule that tried to read it, and the CS2001 behind them.

Both the repository root and samples/crm/README.md give docker compose up --build as the way to run this sample end to end, so this is the first thing a new reader does.

Why CI never sees it

Every workflow starts from actions/checkout, so the file is simply there. A hand-assembled build context is the only place it can go missing, and the repository has exactly one.

The change

One entry on the COPY line, and a comment saying why it belongs there so it does not get tidied away again.

Verified by building the build stage to completion against this change.

Separately

On a clean checkout dotnet restore fails before reaching this, with exit 155: global.json pins SDK 10.0.110 with rollForward: latestPatch, and no published mcr.microsoft.com/dotnet/sdk image provides a 10.0.1xx at or above that — 10.0.100-noble exists and is lower, 10.0.200/301/302-noble exist and are a different feature band. So sdk:10.0-noble can never satisfy it.

That is a policy call rather than a bug, and it is yours to make, so it is not in this PR — I will open an issue with the tag survey unless you would rather it came as a patch.


Signed off under the DCO.

`Directory.Build.props` declares `SonarLint.xml` as an `AdditionalFiles` for every
project, and `samples/crm/Dockerfile` assembles its build context by hand — global.json,
Directory.Build.props, FlowX.slnx, .editorconfig — without it. The analyzers are then
handed a path that does not exist, and the build does not degrade to "no Sonar rules":
`dotnet publish` fails with `CS2001` for the missing source file and one `AD0001` per
rule that tried to read it.

So `docker compose up --build`, which the repository root and samples/crm/README.md both
give as the way to run this sample end to end, cannot succeed on a clean checkout. CI
never sees it: every workflow starts from `actions/checkout`, so the file is simply
there. A hand-assembled context is the only place it can go missing, and there is one.

Verified by building the `build` stage to completion against this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: nguyenngothuong <nguyenthuongtb12@gmail.com>
nguyenngothuong added a commit to diginno-net/FlowX that referenced this pull request Aug 8, 2026
`custom_field_option` has carried a `label` since migration 0005, `crm.custom.field` writes
one for every option, and nothing has ever read it back: `FieldsForEntity` aggregates
`o.value` and stops there, so describe answered with values only.

Every picklist on every screen therefore showed the identifier. An administrator who typed
"Mid-market" into the option box got `mid_market` on the edit form, in the setup detail
column, in the filter picker and in the validation-rule value list. A client cannot repair
that from its side — it has no way to know the value was ever called anything else, and a
transcription in the client is the second copy of a vocabulary, which is the defect
`10ba635` removed for built-in enums.

`DescribedOption(Value, Label)` carries both, zipped on the server rather than sent as two
arrays: a client lining them up by index would line them up wrongly the first time a field
had one and not the other. An option whose label was never written is called by its value,
which is what every client did for all of them until now.

The values stay values. Validation asks whether a written value is a member of the set,
which is a question about values, and a label that changed would otherwise invalidate rows
that were correct when they were written.

Also on this branch, because the fork has to build: `global.json` rolls forward by feature
band (votrongdao#32 — no published SDK image satisfies the pin) and the CRM Dockerfile copies
`SonarLint.xml` (votrongdao#31). Neither belongs in this commit's argument; both are here because
without them nothing compiles.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: nguyenngothuong <nguyenthuongtb12@gmail.com>
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.

1 participant