Closed Joerio closed 2 years ago
Can you provide the complete log for this step?
Hi Waldo, do you know when we can expect an update on this ticket?
Hi @Joerio , I only get a subset of the log .. it stops at the start of the compile.. .
In the log, I also see the value "Pipelines\AL\Rulesets\saas.ruleset.json". That doesn't seem right. If it's a relative path to the workspace, please include it like ".\Pipelines..".
A good practice is to use a URL (like blob storage) so you can share the same ruleset easily among other pipelines as well. Did you try that approach?
Where is your ruleset coming from at this moment?
Hi @waldo1001 ,
Here is a complete log, not sure if it's the exact same run, but should contain the same data CompleteLog.txt
As stated in the original message, we don't know how to pass the ruleset parameter, we tried many different things including an uri, but nothing seems to change anything.
We have a repository with a bunch of rulesets. We also checkout this repo, and depending on the type of Business Central repo, we switch to ruleset (at least that's the goal). So, we have them all locally on the build server.
Ok,
let me give you a few resources.
here you can find documentation on the compilerv2: https://github.com/HodorNV/ALOps/blob/master/Documentation/BuildSteps_v2.md
Here you can find examples: https://github.com/HodorNV/ALOps/tree/master/Examples/Compiler%20V2
One of which describes:
- task: ALOpsAppCompiler@2
inputs:
artifacttype: 'Sandbox'
appversiontemplate: '1.0.*.0'
alcodeanalyzer: none
# This will take these specific code analyzers
# example: "alcodeanalyzer: UICop,CodeCop,PerTenantExtensionCop,AppSourceCop"
# 'none' disables all code analysers
# example: "alcodeanalyzer: none"
# (empty) will take vscode settings
ruleset: none
# path - will take that specific file
# url - wille download the ruleset from a url, and applies that one
# 'none' - forces that no ruleset will be applied
# (empty) will take the vscode settings
# example: for appsource, you could point to the ruleset from Microsoft:
# ruleset: 'https://navmgtstorage00000000.blob.core.windows.net/backup/app.ruleset.json?sp=r&st=2021-01-17T11:45:50Z&se=2022-02-01T19:45:50Z&spr=https&sv=2019-12-12&sr=b&sig=Y%2BibBuN2cTg3%2FIasH9rigqGBoUCCb9rsSXsrwaW8f%2Fc%3D'
So,
I read indeed that "you tried many different things" - what I don't know yet is what you tried exactly though, except from the log you sent me, where I see: Pipelines\AL\Rulesets\saas.ruleset.json
as a value. That is not a path, though.
So, you might try actual paths:
.\Pipelines\AL\Rulesets\saas.ruleset.json
(if the ruleset is part of the source)c:\somewhere\Pipelines\AL\Rulesets\saas.ruleset.json
(the full path of somewhere on your drive)I did also some tests myself.
Setting: ruleset: './sometest.ruleset.json'
Log:
...
*** Using Ruleset: [X:\vsts-agent-hodor\_work\92\s\Test\sometest.ruleset.json]
*** No AL-RuleSet json found
...
This was expected, because the file doesn't exist. but what is important here is that it actually chnaged the setting to an actual path. I won't do that if it can't:
Setting: ruleset: 'Pipelines\AL\Rulesets\saas.ruleset.json'
Log:
...
*** Overrule VSCode settings RuleSetPath: Pipelines\AL\Rulesets\saas.ruleset.json
*** Using Ruleset: [Pipelines\AL\Rulesets\saas.ruleset.json]
*** No AL-RuleSet json found.
...
So that settings wrong, and will never find anything.
What I find very weird is that I don't see that output in your log. What I also seem to read from your log is that you do not have a settings.json in your workspace. Just a hunch, but maybe the lack of the settings prevents alops from overriding it .. .
Could you try to foresee a settings.json in your .vscode folder, make that part of the repository, and try again? And send me the full log again?
@Joerio - were you able to check this?
@waldo1001 I've send last week an email to admin@hodor.be with the details and configuration of this issue. Can you please have a look at that?
v1.449: ALOpsAppCompiler@2: Ruleset not being applied when settings.json is missing
@jpreniers, @Joerio We just released v1.449 which contains a possible fix for this issue. Could you please validate that this solves your issue?
it looks like release v1.449 requires now a settings.json file. Only we are not using this file! The error is:
@jpreniers , could you please share a little more of the log file of this last error?
Log2405.txt See attachment!
@jpreniers , thanks for the log! We just released a hotfix: v1.449.3024
Could you please validate if the hotfix works for you?
Thanks! That seems to work now.
Describe the bug No matter how I input a ruleset, a ruleset never seems to be applied in the pipeline. Maybe I'm passing the ruleset incorrectly, but it seems even if I pass some random string I don't get any feedback.
the used yaml I tried multiple variations of the 'ruleset' parameter, none seem to work:
Also tried:
the output I see in the ouput of this task, in the top section, my ruleset setting, eg.:
But this seems to be the only place I see anything about a ruleset. When I look at the alc.exe command being used, there is not ruleset parameter passed:
If searched in the raw output of the pipeline, the only place 'ruleset' or 'rule' is being used is when outputting the input parameter. No warnings and/or errors are shown.
Expected behavior I see my result being used, and compilation throwns warnings and/or errors depending on the ruleset I pass. At the very least a warning and/or error if something isn't working in the pipeline.