Allow both the mandatory attribute to be set along with a default value and only force input if the default value is $null

When defining a function, I would like to use an environment variable as the default value. If the environment variable exists and has a value that value will be used. For example,
function Get-Info ([Alias("name")] [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [string] $projectName = $env:Project_Name)
{
}
Instead of having to passing in the Project Name for each call I would like to store it in an environment variable. When I do it would allow me to call Get-Info with no parameters and the value in the environment variable would be used. If the environment variable does not exist or is empty the user would be prompted for a value if it was not provided on the command line.
I tried writing the code as I have above but it never seemed to work. Even when the environment variable was set I was always prompted for projectName.
I know I could remove the mandatory attribute and add code in my function to set to the environment variable if it exists. But it would be much easier if what I am proposing was possible.
I also thought about using $PSDefaultParameterValues. This would almost be a short hand version of that set by the function writer and not the user.

We definitely wouldn't accept your proposed syntax, but to keep this discussion in line with what you want, it might look something more like:
function Get-Info ()
    param(
        [Alias("name")]
        [Parameter(MandatoryIfEnvVarNotSet = 'Project_Name', ValueFromPipelineByPropertyName=$true)]
        [string] $projectName)
{
}

Or maybe
function Get-Info ()
    param(
        [Alias("name")]
        [Parameter(Mandatory=$true, DefaultFromEnvironment='Project_Name', ValueFromPipelineByPropertyName=$true)]
        [string] $projectName)
{
}

In my opinion, this idea is too much of a special case and would unnecessarily complicate the already overly complicated parameter binder.

Environment variables are not the only use case for Mandatory + Default values. See original post on
UserVoice

I see - you're asking for a change to when we evaluate default arguments in the parameter binder so that defaults get used before prompting for mandatory parameters.
This might be tricky to get right. Some questions that come to mind:

If a parameter is mandatory in one parameter set but not another, what should happen?
If the parameter has a validation attribute

Should validation be performed on the default? (That doesn't happen today.)
Should validation failure result in prompting?

I'm sure more questions will come to mind if we consider this further.

If the parameter validation does not happen today I would not expect this to behave any different.  My natural instinct was to set the default value to a env var and it simply did not work.
I expected this to work similar to the Docker cli.  If you set the Docker Host as in Env Var you don't have to pass it to each and every command because it will read the Env Var instead.  I was looking for a similar feature with PowerShell. I think the closest thing is the $PSDefaultParameterValues.  However, when I tried to set that value via an Advanced Function it did not seem to "stick"  after I ran the function my values were not there.  The only way that worked is if I set them on the cmd line then tried to run a function.  I hope I did something wrong and will research further.
In a nut shell I did not expect any new rules for how defaults were handled I just wanted to be able to set the default to an Env Var.  If the Env Var is !NullOrEmpty use it.  If it NullOrEmpty behave as if the value was not passed.  For mandatory you would prompt if not you would not.

$PSDefaultParameterValues work as expected:
$PSDefaultParameterValues = @{"Get-Info:projectName" = "TestProject"}
function Get-Info ([Alias("name")] [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [string] $projectName)
 {
   $projectName
 }

>Get-Info

TestProject

The only difference in my use case was the setting of $PSDefaultParameterValues was in a different function than where it was used. Second I use add not = so I did not overwrite existing entries. I had a convenience function that added entries to $PSDefaultParameterValues but when I then called a function the values were not in $PSDefaultParameterValue. It was as if they were only scoped and existed where they were set not outside. I will have time today to try again.

For example the code below does not appear to work as expected.  Once Set-Project is called I would expect $PSDefaultParametersValues to have a new entry.  But if I output $PSDefaultParameterValues it appears empty.  But if I call Set-Project again I get an error that the key already exist. It only appears to exist in that function and not globally.
function Set-Project {
    param(
        # The name of the project to cache
        [Parameter(Mandatory=$true)]
        [string]
        $project
    )

    $PSDefaultParameterValues.Add("*:projectName", $project)
}

function Clear-Project {
    $PSDefaultParameterValues.Remove("*:projectName")
}

PS > Set-Project -project 'MyProject'
PS > $PSDefaultParameterValues
PS > Set-Project -project 'MyProject'
Exception calling "Add" with "2" argument(s): "The key '*:projectName' has already been added to the dictionary."
At D:\Repos\VSTSPowerShell\src\vsts.psm1:72 char:5

$PSDefaultParameterValues.Add("*:projectName", $project)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : PSArgumentException

PS > $PSDefaultParameterValues.Add("*:projectName", 'MyProject')
PS > $PSDefaultParameterValues
Name                           Value

*:projectName                  MyProject
What is the scoping behavior of $PSDefaultParameterValues?

I was able to get the code to work but setting $Global:PSDefaultParameterValues instead.

Yes, you need use scope.

@kilasuit this is quite an old issue, can it be evaluated by the working group? There hasn't been demand for this request.


Build Process

MacOS build keeps failing because of permissions with "npm"
Do you have additional instructions when this occurs.

Hugh,
are you running behind a corporate proxy by any chance?..

No.  It's  file system permission.   I have shelved this build for now and decided to work on a Docker build.  I have everything working with the exception of the UI build process.
Is there anyway you can describe or point me to the steps that I need execute in order to:
Create the Correction environment and dependencies.  : Versions of NodeJS, NPM, Mongo

I left out the UI build portion and I think most of it works.
Reactor Summary:
[INFO]
[INFO] com.capitalone.dashboard:Hygieia .................. SUCCESS [  0.249 s]
[INFO] com.capitalone.dashboard:core ..................... SUCCESS [  7.396 s]
[INFO] com.capitalone.dashboard:rest-api ................. SUCCESS [ 17.798 s]
[INFO] com.capitalone.dashboard:hudson-collector ......... SUCCESS [  1.468 s]
[INFO] com.capitalone.dashboard:sonar-collector .......... SUCCESS [  0.304 s]
[INFO] com.capitalone.dashboard:subversion-collector ..... SUCCESS [  0.353 s]
[INFO] com.capitalone.dashboard:github-collector ......... SUCCESS [  0.251 s]
[INFO] com.capitalone.dashboard:versionone-feature-collector  SUCCESS [  1.867 s]
[INFO] com.capitalone.dashboard:udeploy-collector ........ SUCCESS [  0.307 s]
[INFO] com.capitalone.dashboard:jira-feature-collector ... SUCCESS [  1.445 s]
[INFO] com.capitalone.dashboard:jenkins-cucumber-test-collector  SUCCESS [  0.683 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

I am trying to get through the UI build.
Running into Dependency Hell on NodeJS and Gulp.   I did upgrade the Gulp to 3.9. I think I am close.

[INFO] Building com.capitalone.dashboard:UI 0.1.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ UI ---
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:install-node-and-npm (install node and npm) @ UI ---
[INFO] Node v0.12.0 is already installed.
[INFO] Found NPM version 2.7.1
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:npm (npm install) @ UI ---
[INFO] Running 'npm install --color=false' in /Users/hbrien/Software/Hygieia/UI
[ERROR] npm WARN package.json Dependency 'gulp' exists in both dependencies and devDependencies, using<EMAIL_ADDRESS>from dependencies
[ERROR] npm WARN package.json<EMAIL_ADDRESS>No README data
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:bower (bower install) @ UI ---
[INFO] Running 'bower install' in /Users/hbrien/Software/Hygieia/UI
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:gulp (gulp build) @ UI ---
[INFO] Running 'gulp build --no-color' in /Users/hbrien/Software/Hygieia/UI
[INFO] [11:15:06] Using gulpfile ~/Software/Hygieia/UI/gulpfile.js
[INFO] [11:15:06] Starting 'wiredep'...
[INFO] [11:15:06] Starting 'injector:css:preprocessor'...
[INFO] [11:15:06] Starting 'scripts'...
[INFO] [11:15:06] Starting 'consolidate:jade:app'...
[INFO] [11:15:06] Starting 'consolidate:jade:components'...
[INFO] [11:15:06] Starting 'images'...
[INFO] [11:15:06] Starting 'fonts'...
[INFO] [11:15:07] Starting 'misc'...
[INFO] [11:15:07] Finished 'consolidate:jade:app' after 430 ms
[INFO] [11:15:07] Finished 'consolidate:jade:components' after 278 ms
[INFO] [11:15:07] Starting 'consolidate:jade'...
[INFO] [11:15:07] Finished 'consolidate:jade' after 13 μs
[INFO] [11:15:07] Starting 'consolidate'...
[INFO] [11:15:07] Finished 'consolidate' after 7.24 μs
[INFO] [11:15:07] Starting 'partials'...
[INFO] [11:15:07] gulp-inject 7 files into index.less.
[INFO] [11:15:07] 'wiredep' errored after 922 ms
[INFO] [11:15:07] Error: EPERM, chmod '/Users/hbrien/Software/Hygieia/UI/src/index.html'
[INFO]     at Error (native)
[INFO] [11:15:07] 'injector:css:preprocessor' errored after 1.02 s
[INFO] [11:15:07] Error: EPERM, chmod '/Users/hbrien/Software/Hygieia/UI/src/app/index.less'
[INFO]     at Error (native)
[INFO] [11:15:07] Finished 'misc' after 420 ms
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/chartist/plugins/tooltip.js
[INFO]   line 91  col 22  Don't make functions within a loop.
[INFO]   line 97  col 22  Don't make functions within a loop.
[INFO]
[INFO]   ⚠  2 warnings
[INFO]
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/dashboard/controllers/site.js
[INFO]   line 121  col 10  Unnecessary semicolon.
[INFO]
[INFO]   ⚠  1 warning
[INFO]
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/dashboard/directives/widget-container.js
[INFO]   line 87  col 33  Use '===' to compare with 'null'.
[INFO]
[INFO]   ⚠  1 warning
[INFO]
[INFO] [11:15:07] Finished 'images' after 830 ms
[INFO] [11:15:08] Finished 'fonts' after 1.21 s
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/dashboard/core/extensions/ng-fitText.js
[INFO]   line 68  col 26  Don't make functions within a loop.
[INFO]   line 73  col 99  Expected an assignment or function call and instead saw an expression.
[INFO]
[INFO]   ⚠  2 warnings
[INFO]
[INFO] [11:15:08] Finished 'scripts' after 1.8 s
[INFO] [11:15:08] Finished 'partials' after 1.21 s
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] com.capitalone.dashboard:Hygieia .................. SUCCESS [  0.311 s]
[INFO] com.capitalone.dashboard:core ..................... SUCCESS [  8.288 s]
[INFO] com.capitalone.dashboard:rest-api ................. SUCCESS [ 21.685 s]
[INFO] com.capitalone.dashboard:hudson-collector ......... SUCCESS [  1.995 s]
[INFO] com.capitalone.dashboard:sonar-collector .......... SUCCESS [  0.304 s]
[INFO] com.capitalone.dashboard:subversion-collector ..... SUCCESS [  0.425 s]
[INFO] com.capitalone.dashboard:github-collector ......... SUCCESS [  0.295 s]
[INFO] com.capitalone.dashboard:versionone-feature-collector  SUCCESS [  1.823 s]
[INFO] com.capitalone.dashboard:udeploy-collector ........ SUCCESS [  0.318 s]
[INFO] com.capitalone.dashboard:jira-feature-collector ... SUCCESS [  1.641 s]
[INFO] com.capitalone.dashboard:jenkins-cucumber-test-collector  SUCCESS [  0.774 s]
[INFO] com.capitalone.dashboard:UI ....................... FAILURE [ 11.357 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.817 s
[INFO] Finished at: 2015-09-28T11:15:08-05:00
[INFO] Final Memory: 70M/359M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.23:gulp (gulp build) on project UI: Failed to run task: 'gulp build --no-color' failed. (error code 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :UI
osxlthbrien:Hygieia hbrien$

Brien,
Have you made code changes already, or you are trying to compile a vanilla project straight out of Github.
It looks like you are running into compilation issues… make sure your js and html compiles an easy way is just to run
Gulp build and it can give you the same output.
[INFO] [11:15:07] gulp-inject 7 files into index.less.
[INFO] [11:15:07] 'wiredep' errored after 922 ms
[INFO] [11:15:07] Error: EPERM, chmod '/Users/hbrien/Software/Hygieia/UI/src/index.html'
[INFO] at Error (native)
[INFO] [11:15:07] 'injector:css:preprocessor' errored after 1.02 s
[INFO] [11:15:07] Error: EPERM, chmod '/Users/hbrien/Software/Hygieia/UI/src/app/index.less'
[INFO] at Error (native)
[INFO] [11:15:07] Finished 'misc' after 420 ms
From: Hugh Brien <notifications<EMAIL_ADDRESS>Reply-To: capitalone/Hygieia <reply<EMAIL_ADDRESS>Date: Monday, September 28, 2015 at 11:19 AM
To: capitalone/Hygieia <Hygieia<EMAIL_ADDRESS>Cc: Amit Mawkin <amit.mawkin<EMAIL_ADDRESS>Subject: Re: [Hygieia] Build Process (#127)
I am trying to get through the UI build.
Running into Dependency Hell on NodeJS and Gulp. I did upgrade the Gulp to 3.9. I think I am close.

[INFO] Building com.capitalone.dashboard:UI 0.1.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ UI ---
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:install-node-and-npm (install node and npm) @ UI ---
[INFO] Node v0.12.0 is already installed.
[INFO] Found NPM version 2.7.1
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:npm (npm install) @ UI ---
[INFO] Running 'npm install --color=false' in /Users/hbrien/Software/Hygieia/UI
[ERROR] npm WARN package.json Dependency 'gulp' exists in both dependencies and devDependencies, using 'gulp<EMAIL_ADDRESS>from dependencies
[ERROR] npm WARN package.json karma-phantomjs-launcher<EMAIL_ADDRESS>No README data
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:bower (bower install) @ UI ---
[INFO] Running 'bower install' in /Users/hbrien/Software/Hygieia/UI
[INFO]
[INFO] --- frontend-maven-plugin:0.0.23:gulp (gulp build) @ UI ---
[INFO] Running 'gulp build --no-color' in /Users/hbrien/Software/Hygieia/UI
[INFO] [11:15:06] Using gulpfile ~/Software/Hygieia/UI/gulpfile.js
[INFO] [11:15:06] Starting 'wiredep'...
[INFO] [11:15:06] Starting 'injector:css:preprocessor'...
[INFO] [11:15:06] Starting 'scripts'...
[INFO] [11:15:06] Starting 'consolidate:jade:app'...
[INFO] [11:15:06] Starting 'consolidate:jade:components'...
[INFO] [11:15:06] Starting 'images'...
[INFO] [11:15:06] Starting 'fonts'...
[INFO] [11:15:07] Starting 'misc'...
[INFO] [11:15:07] Finished 'consolidate:jade:app' after 430 ms
[INFO] [11:15:07] Finished 'consolidate:jade:components' after 278 ms
[INFO] [11:15:07] Starting 'consolidate:jade'...
[INFO] [11:15:07] Finished 'consolidate:jade' after 13 μs
[INFO] [11:15:07] Starting 'consolidate'...
[INFO] [11:15:07] Finished 'consolidate' after 7.24 μs
[INFO] [11:15:07] Starting 'partials'...
[INFO] [11:15:07] gulp-inject 7 files into index.less.
[INFO] [11:15:07] 'wiredep' errored after 922 ms
[INFO] [11:15:07] Error: EPERM, chmod '/Users/hbrien/Software/Hygieia/UI/src/index.html'
[INFO] at Error (native)
[INFO] [11:15:07] 'injector:css:preprocessor' errored after 1.02 s
[INFO] [11:15:07] Error: EPERM, chmod '/Users/hbrien/Software/Hygieia/UI/src/app/index.less'
[INFO] at Error (native)
[INFO] [11:15:07] Finished 'misc' after 420 ms
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/chartist/plugins/tooltip.js
[INFO] line 91 col 22 Don't make functions within a loop.
[INFO] line 97 col 22 Don't make functions within a loop.
[INFO]
[INFO] ⚠ 2 warnings
[INFO]
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/dashboard/controllers/site.js
[INFO] line 121 col 10 Unnecessary semicolon.
[INFO]
[INFO] ⚠ 1 warning
[INFO]
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/dashboard/directives/widget-container.js
[INFO] line 87 col 33 Use '===' to compare with 'null'.
[INFO]
[INFO] ⚠ 1 warning
[INFO]
[INFO] [11:15:07] Finished 'images' after 830 ms
[INFO] [11:15:08] Finished 'fonts' after 1.21 s
[INFO]
[INFO] /Users/hbrien/Software/Hygieia/UI/src/app/dashboard/core/extensions/ng-fitText.js
[INFO] line 68 col 26 Don't make functions within a loop.
[INFO] line 73 col 99 Expected an assignment or function call and instead saw an expression.
[INFO]
[INFO] ⚠ 2 warnings
[INFO]
[INFO] [11:15:08] Finished 'scripts' after 1.8 s
[INFO] [11:15:08] Finished 'partials' after 1.21 s
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] com.capitalone.dashboard:Hygieia .................. SUCCESS [ 0.311 s]
[INFO] com.capitalone.dashboard:core ..................... SUCCESS [ 8.288 s]
[INFO] com.capitalone.dashboard:rest-api ................. SUCCESS [ 21.685 s]
[INFO] com.capitalone.dashboard:hudson-collector ......... SUCCESS [ 1.995 s]
[INFO] com.capitalone.dashboard:sonar-collector .......... SUCCESS [ 0.304 s]
[INFO] com.capitalone.dashboard:subversion-collector ..... SUCCESS [ 0.425 s]
[INFO] com.capitalone.dashboard:github-collector ......... SUCCESS [ 0.295 s]
[INFO] com.capitalone.dashboard:versionone-feature-collector SUCCESS [ 1.823 s]
[INFO] com.capitalone.dashboard:udeploy-collector ........ SUCCESS [ 0.318 s]
[INFO] com.capitalone.dashboard:jira-feature-collector ... SUCCESS [ 1.641 s]
[INFO] com.capitalone.dashboard:jenkins-cucumber-test-collector SUCCESS [ 0.774 s]
[INFO] com.capitalone.dashboard:UI ....................... FAILURE [ 11.357 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.817 s
[INFO] Finished at: 2015-09-28T11:15:08-05:00
[INFO] Final Memory: 70M/359M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.23:gulp (gulp build) on project UI: Failed to run task: 'gulp build --no-color' failed. (error code 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :UI
osxlthbrien:Hygieia hbrien$
—
Reply to this email directly or view it on GitHubhttps://github.com/capitalone/Hygieia/issues/127#issuecomment-143774686.

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates and may only be used solely in performance of work or services for Capital One. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

Sorry this has been a little confusing:
I am attempting two builds: Both are just standard builds from source.
One on my Mac
Another via Docker which implies UBuntu.
I will open a new Issue for the Docker build so as to keep them separate.

I got the Mac build kind of running but I had to do
sudo gulp serve
without it I get
osxlthbrien:UI hbrien$
osxlthbrien:UI hbrien$  gulp serve
[13:30:48] Using gulpfile ~/Software/Hygieia/UI/gulpfile.js
[13:30:48] Starting 'consolidate:jade:app'...
[13:30:48] Starting 'consolidate:jade:components'...
[13:30:48] Starting 'wiredep'...
[13:30:48] Starting 'injector:css:preprocessor'...
[13:30:48] Starting 'themes-watcher'...
[13:30:48] Starting 'scripts'...
[13:30:48] Starting 'fonts'...
[13:30:48] Finished 'consolidate:jade:app' after 557 ms
[13:30:48] Finished 'consolidate:jade:components' after 419 ms
[13:30:48] Starting 'consolidate:jade'...
[13:30:48] Finished 'consolidate:jade' after 184 μs
[13:30:48] Starting 'consolidate'...
[13:30:48] Finished 'consolidate' after 5.86 μs
[13:30:48] gulp-inject 7 files into index.less.
[13:30:48] 'wiredep' errored after 444 ms
[13:30:48] Error: EPERM: operation not permitted, chmod '/Users/hbrien/Software/Hygieia/UI/src/index.html'
at Error (native)
[13:30:49] 'injector:css:preprocessor' errored after 544 ms
[13:30:49] Error: EPERM: operation not permitted, chmod '/Users/hbrien/Software/Hygieia/UI/src/app/index.less'
at Error (native)
/Users/hbrien/Software/Hygieia/UI/src/app/chartist/plugins/tooltip.js
line 91  col 22  Don't make functions within a loop.
line 97  col 22  Don't make functions within a loop.
⚠  2 warnings
/Users/hbrien/Software/Hygieia/UI/src/app/dashboard/controllers/site.js
line 121  col 10  Unnecessary semicolon.
⚠  1 warning
/Users/hbrien/Software/Hygieia/UI/src/app/dashboard/directives/widget-container.js
line 87  col 33  Use '===' to compare with 'null'.
⚠  1 warning
[13:30:51] Finished 'themes-watcher' after 3.05 s
[13:30:51] Finished 'fonts' after 3.22 s
/Users/hbrien/Software/Hygieia/UI/src/app/dashboard/core/extensions/ng-fitText.js
line 68  col 26  Don't make functions within a loop.
line 73  col 99  Expected an assignment or function call and instead saw an expression.
⚠  2 warnings
[13:30:52] Finished 'scripts' after 3.53 s

closing this issue as your build was successful as reported


Adds ability to get the parameters set in a search request.

Verified that @doncung has signed the CLA. Thanks for the pull request!


read simple persist-type reader out of vault

Any usage of pkg/pillar/utils, especially those things calling WaitFor*(), ends up depending on pkg/pillar/containerd, just to get the containerd client. It then depends on pkg/pillar/vault, because it needs to call vault.ReadPersistType().
ReadPersistType() is a simple function to read a file. But because it is in vault, it in turns depends on the go-zfs library, which is CGO, only available on Linux and with the right packages installed.
That complex dependency shouldn't exist for something like utils.
This moves just ReadPersistType() out of pkg/pillar/vault and into pkg/pillar/utils/persist. The dependency tree is simplified.

If everything passes except for yetus, I will merge it in.


Teste

The issue text was copied to the clipboard.  Please paste it into this window.

Hi @Camila-Carvalho
Thanks for reporting, but you haven't pasted the issue text.  Could you please tell me what the problem is and how we can reproduce it?  Thanks!


Question about morph with Laravel

Hello,
I've got one question, in morphs, vuexORM takes entity to use it as value for exampleable_type relationship, but for example, in Laravel, exampleable_type is stored in database as App\exampleable_type.
How can I solve this? Any ideas?

Oh yeah this is the hard one... You must first convert the API request to have entity as a value.
I'm planning to add these kinds of structure mapping functionality, though I don't think I can do it anytime really soon...

Always happens the same to me, seems that the solution is in the docs :sweat:  : https://laravel.com/docs/6.x/eloquent-relationships#custom-polymorphic-types , I'll try when I have time and get my results back

I had the same problem, morphMap solved it.
Relation::morphMap([
     'ActivityLog' => \App\API\ActivityLog::class,
     'Article' => \App\API\Article::class,
     'Company' => \App\API\Company::class,
]);


Os error code 10035

Hello people,
What does this error mean?
Err(Error { repr: Os { code: 10035, message: "A non-blocking socket operation could not be completed immediately." }
I'm getting it when using udpsocket recv_from.
Cheers

Thanks for the report! This probably indicates a bug on Windows, do you have some example code which reproduces this?

Yes sure :)
`extern crate shared;
use mio::net::UdpSocket;
use std::io::Cursor;
use byteorder::{LittleEndian, ReadBytesExt};
use shared::net::*;
fn main() {
let addr = "<IP_ADDRESS>:34254".parse().unwrap();
let socket = UdpSocket::bind(&addr).unwrap();
println!("Server listening on {}", addr);
loop {
    let mut buf = [0u8; 128];
    let ok = socket.recv_from(&mut buf).and_then(|data| {
        println!("TESTE");
        Ok(true)
    });
    println!("Ok? {:?}", ok);
}

}`

Do you have an example that'd work w/ something like cargo run? I wasn't able to reproduce once I got that example compiling :(

Do you have a way to reproduce with the code you gisted above? I'm unable to reproduce with that code. If you've got like a Cargo.toml and a Cargo.lock that would be helpful to reproduce

Closing due to inactivity. If you have a repro, please comment and I will reopen.

Some more background information for error code 10035 (WSAEWOULDBLOCK).
According to MSDN

Resource temporarily unavailable.
This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.

This a normal behavior on MS Windows.
Workaround can be:

if the error WSAEWOULDBLOCK occurs in a loop sleep a view milliseconds
or
better use select/poll/WSAWaitforMultipleEvents


How to point to a windows folder for the font?

example font is Storyboo.TTF located in C:
I tried C:\Storyboo.TTF and C:\Storyboo.TTF but it still seems not to find the font?

Ensure that the font file Storyboo.TTF is indeed located directly on your C: drive as you've specified. If it's inside any folder on the drive, you need to include that in the path.


Questions about the shiny dataset

Are there complete CD data sets in shiny? I downloaded the CD data set according to the URL you provided, and used img2pose to get pose_bounds.npy, but when I run it, I get the message that hwf_cxcy.npy is missing. Do you have the script that generated this file to share? Thanks!!!

Hmm, that file should be available in the one drive folder that I linked in the README. I can see it here, for example: https://vistec-my.sharepoint.com/personal/pakkapon_p_s19_vistec_ac_th/_layouts/15/onedrive.aspx?ga=1&id=%2Fpersonal%2Fpakkapon_p_s19_vistec_ac_th%2FDocuments%2Fpublic%2FVLL%2FNeX%2Fshiny_datasets%2Fshiny%2Fcd

Thanks!!!


Return Bad Request HTTP 400 context to client in error messages

Let's say I make a bad request to add a new VC. The verbose curl output I get back is:
% curl -X PUT -d '
{
    "Issuer": "did:key:zQ3shgaCdiqDT3K4ikNkZzbY7FHS8XNDhrCotGA813eRTJQAX",
    "Subject": "did:key:zQ3shgaCdiqDT3K4ikNkZzbY7FHS8XNDhrCotGA813eRTJQAX",
    "Schema": "59722df0-3458-4aeb-a5b4-929ad6bded63",
    "Data": {
        "emailAddress"<EMAIL_ADDRESS>    },
    "Expiry": "2022-12-31T05:00:00+00:00"
}' localhost:8080/v1/credentials -v
*   Trying <IP_ADDRESS>:8080...
* Connected to localhost (<IP_ADDRESS>) port 8080 (#0)
> PUT /v1/credentials HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Length: 319
> Content-Type: application/x-www-form-urlencoded
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Mon, 01 Aug 2022 17:19:36 GMT
< Content-Length: 45
<
* Connection #0 to host localhost left intact
{"error":"invalid create credential request"}

Trimming the verbosity, it's simply the JSON payload:
{"error":"invalid create credential request"}

The server logs show what's to be corrected in the request, but this won't be visible to the client:
build-web-1         | {"error":"invalid character 'â' looking for beginning of value","level":"error","msg":"invalid create credential request","time":"2022-08-01T17:21:33Z"}

I'm also not certain the error message on the server is correct for this example , but I'll look into that more and open another issue if so. This issue is for percolating necessary information to the client in 400 Bad Request errors so they can correct and retry.

I agree the http should be minimal and simple; the logs should give more verbose information about what went wrong, with a request ID that can correlate the two.

Yep, keeping in mind that the client may not be able to access the server in a real-world case -- so showing the context behind the error (and as a bonus, how to potentially correct it!) is a great practice.

Regarding the actual error

build-web-1         | {"error":"invalid character 'â' looking for beginning of value","level":"error","msg":"invalid create credential request","time":"2022-08-01T17:21:33Z"}

I think it might be because the quotes around the email value are non-standard  ” vs. "
"emailAddress"<EMAIL_ADDRESS>vs
"emailAddress"<EMAIL_ADDRESS>

Created this PR to improve the error responses by preserving context.  See below for before vs. after for the same request:
curl -X PUT -d '
{
    "Issuer": "did:key:zQ3shgaCdiqDT3K4ikNkZzbY7FHS8XNDhrCotGA813eRTJQAX",
    "Subject": "did:key:zQ3shgaCdiqDT3K4ikNkZzbY7FHS8XNDhrCotGA813eRTJQAX",
    "Schema": "59722df0-3458-4aeb-a5b4-929ad6bded63",
    "Data": {
        "emailAddress"<EMAIL_ADDRESS>    },
    "Expiry": "2022-12-31T05:00:00+00:00"
}' localhost:8080/v1/credentials -v

Before:
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> PUT /v1/credentials HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 324
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 324 out of 324 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Thu, 11 Aug 2022 05:12:10 GMT
< Content-Length: 45
<
* Connection #0 to host localhost left intact
{"error":"invalid create credential request"}* Closing connection 0

After:
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> PUT /v1/credentials HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 324
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 324 out of 324 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Date: Thu, 11 Aug 2022 06:48:04 GMT
< Content-Length: 100
<
* Connection #0 to host localhost left intact
{"error":"invalid create credential request: invalid character 'â' looking for beginning of value"}* Closing connection 0

Thank you for the contribution, @shobitb!!


Add information about licensing

Thanks for your reminding! I just added the MIT license for the project.

Thank you for information!


dfget --pattern cdn causes supernode to hang when downloading files

Ⅰ. Issue Description
dfget CDN mode hangs for extended periods of time, sometimes failing to complete.
Ⅱ. Describe what happened
In p2p mode dfget is very quick and always completes, putting it in cdn mode, the task seems to hang on the supernode. The more concurrency/bandwidth allowed on the supernode the faster the tasks seem to hang. They get stuck in some type of scheduling loop.
Ⅲ. Describe what you expected to happen
I expected dfdaemon/dfget to pull images from the supernode CDN after they are cached
Ⅳ. How to reproduce it (as minimally and precisely as possible)

set dfdaemon to pass ---pattern cdn to dfget
Attempt to pull a docker image with multiple layers. I was trying to pull richarvey/nginx-php-fpm

Ⅴ. Anything else we need to know?
If I set the number of downloads and uploads to 1, it will complete more layers before hanging, also if I reduce the network bandwidth down to very low it completes multiple layers.
Increasing the bandwidth or the concurrency causes the hang to happen.
(It isn't a bandwidth issue on the machine, it is a 1GB connection, pulling a 300mb image that normally takes a few seconds)
Ⅵ. Environment:

dragonfly version: 1.0.2 and master
OS (e.g. from /etc/os-release): Ubuntu 18.04.4 LTS
Kernel (e.g. uname -a): 5.3.0-59-generic

logs.zip
config.zip

I think this extends beyond just the cdn pattern, I am noticing the same task/scheduler hangs in p2p mode, they are just less obvious because it falls back to pulling pieces directly, but I definitely see tasks effectively get hung - using no bandwidth while the log cycles about scheduler results/updating peer progress.


[question] Package preset file size

Hi,
I was investigating the Node deprecation warning about the punycode builtin.
(node:597116) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland al
ternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:114:7)
    at Function._load (node:internal/modules/cjs/loader:1100:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at /.../node_modules/@storybook/addon-webpack5-compiler-babel/dist/preset.cjs:277:275864

And I found out that the preset.cjs file a a mega bundle of 2.7 MB.
The question is: what does it bundles? Webpack, babel-loader and all their transitives? And is it intended?
My env:
"@babel/core": "^7.26.0",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/react": "^8.3.6",
"@storybook/react-webpack5": "^8.3.6",
"babel-loader": "^9.2.1",
"storybook": "^8.3.6",

Node 22.10.0

@pascalduez Thank you for the investigations! Indeed, @storybook/core-common is currently not treeshakable. What I did to mitigate the issue was to extract the two helper functions into the package itself. The bundle size is now dramatically reduced.
PR: https://github.com/storybookjs/addon-webpack5-compiler-babel/pull/13


Gene info table

Description
While the network is great for looking at interactions, it is not so good at showing info about genes. Add a gene info table that prints information based off of refgen.candidate_genes() called here. Include all the information from the include_xxx kwargs here.
Tasks

[x] Add a gene data table
[x] Link the gene table with the network:

[x] highlight nodes when rows are clicked
[x] highlight rows when nodes are clicked

This one is resolved in #13, this can be closed once that is merged.

Before we close this can you include the information from the optional include_xxx kwargs in refgen.candidate_genes()? I think you should be able to just set them all to True.

#15 has most of them included, waiting on Camoco fixes for the others, but once they are there, the code is in here, it just needs to be uncommented when ready.


aapt2补充

1.aapt2 与build-tools有关
2.aapt2采用的flat和link方式
3.aapt2对一些研发写的代码校验更为严格

@JuneLeo  感谢反馈，我会在继续完善文章内容

Subject: Your Dream Job Awaits: Apply Now to Join GitHub as a Developer!
Hey there,
We've got some thrilling news for you! GitHub is currently looking for skilled Developers to join our team. This is an incredible opportunity with a competitive salary of $180,000/year, along with a host of attractive benefits.
Interested in taking your career to the next level? Don't miss out! Click here to apply and secure your spot.
Looking forward to potentially welcoming you aboard!
Best regards,
GitHub Recruitment Team


Project down command failing

The unikube project down command currently fails with a GraphQL error.
At this location https://github.com/unikubehq/cli/blob/60ef3a6e8ebf31498c6f5f3d80d778eb0fa83a7b/src/context/context.py#L192-L204
I had
organization_id=None project_id=None deck_id=None

which queries the platform with id:None. That is causing an error which prevents the unikube project down command from being effective.

I cannot reproduce this error. The GraphQL error should be caught by the following function:
    def __graph_ql(self, query: str, query_variables: dict) -> Union[dict, None]:
        # GraphQL
        try:
            graph_ql = GraphQL(authentication=self._auth)
            result = graph_ql.query(
                query,
                query_variables=query_variables,
            )
            key = next(iter(result))
            data = result[key]
        except Exception as e:
            data = None
            console.debug(e)
            console.exit_generic_error()

        return data

Thus I am not sure why the Graphgl error is visible.


Divorce regex_macros from regex.

Fixes #31 and #33.
There are a number of related changes in this commit:

A script that generates the 'match' tests has been reintroduced.
The regex-dna shootout benchmark has been updated.
Running cargo test on the regex crate does not require
regex_macros.
The documentation has been updated to use Regex::new(...).unwrap()
instead of regex!. The emphasis on using regex! has been reduced,
and a note about its unavailability in Rust 1.0 beta/stable has been
added.
Updated Travis to test both regex and regex_macros.

r? @huonw
(rust_highfive has picked a reviewer for you, use r? to override)

cc @alexcrichton

I moved all of the tests into regex_macros/tests. The Cargo.toml for regex points to regex_macros/tests/test_dynamic.rs, which defines a macro regex!. This lets us reuse all of the tests. :-)

Looks good to me! Just a few questions about organization and otherwise I'm fine merging.

Great, thank you for the review! I think I've addressed everything. I'll merge once Travis gives the all clear.


bumping to safe minimum dependency

Linked hashmap is unsound for versions 0.5.2 and below as per this advisory. Bumping this to ensure all dependents end up on a sound version.


Screenshot? Brief description of usage?

:smile:
I just noticed this was installed by your LT user plugin install script and I'm curious how this works.

Thanks for reporting your issue! This is one of my 12 active issues. Use that link to check how soon your issue will be answered. Don't forget to check your issue against this project's CONTRIBUTING.md. Cheers.


fix workspace issue that when it fails to sync, it does not reschedul…

Fix workspace sync issue that when it fails to sync, it does not reschedule the sync.

LGTM


Added compatibility with fastboot

Added guards around all instances of 'window' to prevent errors when serving via fastboot (functions containing references to browser globals throw errors, even if they are not called).

Thanks!
@homu r+

:pushpin: Commit de36a7c has been approved by poteto

:zap: Test exempted - status


Rancher Kubeconfig is missing Certificate Authority with self-signed certs

What kind of request is this (question/bug/enhancement/feature request):
Bug
I have a rancher HA cluster running with self-signed certs and a CA:
> kubectl -n cattle-system create secret tls tls-rancher-ingress --cert={{path}}/tls.crt --key={{path}}/tls.key

> kubectl -n cattle-system create secret generic tls-ca --from-file=certs/cacerts.pem

> helm install rancher-latest/rancher --name rancher --namespace cattle-system --set hostname=ranch.my.test --set ingress.tls.source=secret

Then I provision a cluster from the UI using the custom nodes option and they join with the command:
> sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run -v /cacerts.pem:/etc/ssl/certs/ca-certificates.crt rancher/rancher-agent:v2.3.0 --server https://ranch.my.test --token <token> --etcd --controlplane --worker

The cluster comes up successfully. I then try to get he kubeconfig from rancher's UI, and I see that it is missing the CA data. Also the launch kubectl option won't work either.
Kubeconfig: Notice how stage4 is missing the CA data section

Kubectl:

I've been able to recreate this problem even after creating completely new VMs, rancher HA cluster, and stage4 cluster
Why is this happening and how can I fix it?
Environment information

Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI): v2.3.0
Installation option (single install/HA): HA

Cluster information

Cluster type (Hosted/Infrastructure Provider/Custom/Imported): Custom from existing nodes

Machine type (cloud/VM/metal) and specifications (CPU/memory): VMs running CentOS with 16gb ram each/

Kubernetes version (use kubectl version): Server version v1.14.6

Docker version (use docker version):

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)

At https://rancher.com/docs/rancher/v2.x/en/installation/ha/helm-rancher/#certificates-from-files, it states:
Set hostname and set ingress.tls.source to secret.
If you are using a Private CA signed certificate , add --set privateCA=true to the command shown below.

You also shouldnt need to mount the cert into the agent as its retrieved from Rancher on start and used to connect to Rancher.
Let me know if that doesn't solve the issue.


[FIX - Workaround] Update to XF 2.4 & PlayServices 42.1021.1

Hello all,
So I've been investigating for some probs concerning update to XF & XFM <IP_ADDRESS>2 and update of all PlayServices to 42.1021.1.
I managed to get everything work by cloning the actual repo and building the dlls by myself, so atm I get ride off nuget. To get it work I updated all packages for the TKCustomMap project (playServices & XF) and built again the dlls.
For these issues :
#241 => the is showing user is now working same for zoom/in out  buttons
#207 => now the error that was poping when adding a pin ("an item with the same key has already been added") is fixed
#210 => Link assemblies on "sdk only" works when in release mode so no need now to skeep assemblies.
@TorbenK, @jfversluis   I guess if you want to update the package there is not so much work to do as it does not concern any part of your code, but more packages to update so I can't really do a PR for that ;) . Hope it will help you to maintain this awesome package.
Thank you for your time. Ihope that will help people that want to update to latest versions.

Is there a way to update nuget  soon? It's the only maps for xamarin forms with  implementation of google directions and I can't use it with firebase notification due to PlayServices and XF version. Workaround doesn't work for because I get  errors after adding dlls to project.

@straiser
What are errors ?

A lot of "The "XamlCTask" task could not be initialized with its input parameters" and "ResolveLibraryProjectImports tasks failed unexpectedly"

For the first error I don't really see what it is ... could you provide more informations ? Have you clone the repo, clean the solution, updated all package of the repo (XF 2.4 XFM 2.4 and play services to 42.1021.1 ? Then building the dlls ?
For the second error, it appears most of the time when your project is too deep in your arbo I mean by that path of your project.

1.6.0-pre1 should work


Migrate to standalone docs repo

Summary
See: https://github.com/astral-sh/uv/pull/5081

Does this need any update to the contribution guidelines?

Nope! No changes to anything at all. This only affects the publishing pipeline which happens during deploy.

I won't be merging this until I change a few other things downstream though (and we feel ready to post the uv docs).

(Merging this as requested by Charlie.)


Light mode code snippets

In Dark mode, the  code looks pretty good, though the container could be more distinct. However, in light mode, there is still a black box, which looks really strange.

I will update this within 48 hours! Thanks for letting me know.

Sounds good :)

Light code theme has been added! The update will be deployed to production in less than 12 hours, following verification.

Yay, it looks all nice now, with the text fix too :D


Handling multiple tile layers in group

Hi,
I'm using Leaflet and I wanted to know if there is some way to add tile layers into leaflet and then toggle them?

Like in http://leafletjs.com/examples/layers-control/ ?

yes, I was looking at this, but don't know why it didn't worked. I managed to solve it with panes. thanks!


.btn-link has border-color: transparent why?

I've looked for the reasoning behind adding border-color: transparent to the :hover and :focus states of .btn-link
https://github.com/twbs/bootstrap/blob/b7558830593711db0924bab6e9c44916865fd7c2/scss/_buttons.scss#L80-L92
but cannot find the reason for this. I came across this when trying to utilize some custom border styles on .btn-link and had the borders turn transparent on hover because of this.
Blame points to the change being introduced in https://github.com/twbs/bootstrap/pull/22951, but it isn't obvious to me the reasoning behind this rule. I propose removing it.

Hi,
Thanks for asking. Read this, I think you'll get your answer.
https://stackoverflow.com/questions/9612758/add-a-css-border-on-hover-without-moving-the-element

Because .btn-link is a modifier of .btn, you need both classes on the element. The .btn-link makes it transparent instead of removing the border outright to prevent any potential shifting (not likely these days with our box-sizing) and maintain some consistency.
I could go either way with it. I don’t know for sure if there are any situations where we absolutely need the border to stick around. We’d have to test more.

.btn already sets border-color: transparent;, so indeed this can be removed. The same with background-color: transparent; which was added in #27003. See R14-R15:
https://github.com/twbs/bootstrap/blob/ed48d9a4401ce0ad61b38a236e0a1c15bc3bb17b/scss/_buttons.scss#L7-L15

We kinda did the same here https://github.com/twbs/bootstrap/pull/27003


Add the readme.md example dag to example dags folder

Description
What is the current behavior?
Currently, we have examples in the README.md file which are not getting tested as we update the code.
closes: #680
What is the new behavior?
We can move our code to example_dags and refer to that file in README.md so that this file is tested with every change.
Does this introduce a breaking change?
Nope
Checklist

[X] All checks and tests in the CI should pass
[X] Example DAG
[X] Improve the documentation (README, Sphinx, and any other relevant)

@feluelle I didn't see any way to change the size of the code scnipet.


No tabs in circle ci config

@rgardler,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot


macos 10.12 not supported by DotNet Core 3.x

macos 10.12 not supported by DotNet Core 3.x

cc @adityapatwardhan

need to change this
https://github.com/PowerShell/PowerShell/blob/b218e6f6ccfbd784d29258a0cab5820c676c4773/tools/packaging/packaging.psm1#L976

Fixed by: https://github.com/PowerShell/PowerShell/pull/11163


MM-20788 Migrate autocomplete components to use React.createRef

For the SuggestionList items, we still use a ref callback since there's an arbitrary number of those. Also, note that the refs in the SearchSuggestionList are actually used since it extends the SuggestionList.
Ticket Link
https://github.com/mattermost/mattermost-webapp/pull/new/mm20788

Creating a new SpinWick test server using Mattermost Cloud.

Mattermost test server created! :tada:
Access here: https://mattermost-webapp-pr-4381.test.mattermost.cloud

Account Type
Username
Password

Admin
sysadmin
Sys@dmin123

User
user-1
User-1@123

Test server destroyed


Refactor DescribedClass to use node_pattern

@andyw8 would you like to review these changes? My goals:

100% mutation coverage of DescribeClass cop
Subsequent refactor to use def_node_matcher after full mutation coverage

Hi @backus, sorry I never got a chance to look at this earlier.
Are you hoping to add the Mutant gem (or something similar) once there is full coverage?

@andyw8 Yeah I'd like to add mutant using the --since flag soon (it doesn't have to be at full coverage to do that). I need to figure out if I want to use a different CI first though. Travis is painfully slow and running mutant will be really painful if I just add it on top of this.


Code compatibility with Tensorflow 1.7

Recently update my Tensorflow to 1.7, when loading the model, got an warning:
model = Model()
WARNING:tensorflow: From xxxxxxx\encoder.py: 59: calling l2_normalize (from tensorflow.python.ops.nn_impl) with dim is deprecated and will be removed in a future version.

Changed the code from encoder.py: 58-62
change the dim parameter into axis
    if wn:
        wx = tf.nn.l2_normalize(wx, axis=0) * gx
        wh = tf.nn.l2_normalize(wh, axis=0) * gh
        wmx = tf.nn.l2_normalize(wmx, axis=0) * gmx
        wmh = tf.nn.l2_normalize(wmh, axis=0) * gmh

The warning is gone.

I think I posted in the wrong category, please delete this post, and the same topic issue is posted in "Issues" category.
Thank you.


Invoking .Page.RenderString on a page without a backing file throws an erroneous warning

This was introduced in v0.92.0, and is still present in v0.92.1.
MRE:
git clone --single-branch -b hugo-github-issue-9433 https://github.com/jmooring/hugo-testing hugo-github-issue-9433
cd hugo-github-issue-9433
hugo

.File.Path on zero object. Wrap it in if or with: {{ with .File }}{{ .Path }}{{ end }}

The warning is triggered in layouts/_default/list.html, line 4:
{{ .RenderString "foo" }}

References:

https://discourse.gohugo.io/t/36590/5
https://github.com/gohugoio/hugo/issues/9383#issuecomment-1013704831

Thanks ... We should have made that an error long time ago, but I guess we cannot do that in a patch release ...

We should have made that an error

Please clarify. Should I update the documentation to indicate that this method should not be used on pages that are not backed by file?


Connect a Front End to a Back End Using a Service

Hello all, I need help to resolve service to service communication issue.
I have created the exact setup as per URL "https://kubernetes.io/docs/tasks/access-application-cluster/connecting-frontend-backend/" and made some little changes.
Front end, I have created a frontend deployment and service using new image which I build using below configuration:
proxy.conf
`
upstream snoop-test {
server server1:8443;
server server1:8443;
}
server {
listen 31443;
location / {
    proxy_pass https://snoop-test;
}

}
Updated the nginx.conf for below tag:include proxy.conf;`
Dockerfile:
FROM interanal_nginx_image COPY nginx.conf /usr//webserver/conf/ COPY proxy.conf /usr/webserver/conf/
I kept all the yaml files as it is as per k8s documentation page except , for backend I have created a deployment snoop-test wth service name as snoop-test of "NodePort" type.
frontend-deployment and service yaml:
`apiVersion: v1
kind: Service
metadata:
name: frontend
spec:
selector:
app: snoop-test
tier: frontend
ports:

protocol: "TCP"
port: 30443
targetPort: 30443
type: NodePort

apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
selector:
matchLabels:
app: snoop-test
tier: frontend
track: stable
replicas: 2
template:
metadata:
labels:
app: snoop-test
tier: frontend
track: stable
spec:
securityContext:
runAsUser: 222
containers:
- name: nginx
image: nginx-test`
Backend application deployment yaml is as below:
`apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: snoop-test
name: snoop-test
spec:
replicas: 2
selector:
matchLabels:
app: snoop-test
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: snoop-test
spec:
containers:
- image: 'snoop'
imagePullPolicy: Always
name: snoop-test
ports:
- containerPort: 8443
resources: {}`
snoop-test-service.yaml
apiVersion: v1 kind: Service metadata:   labels:     app: snoop-test   name: snoop-test spec:   ports:     - port: 8443       protocol: TCP       targetPort: 8443   selector:     app: snoop-test status:   loadBalancer: {}
Can someone suggest how to redirect the request directly to snoop-test service from frontend service.

/kind support

I am able to fix the issue with loadbalancer type service. Its not possible to resolve it using nodeport as nodeport is not resoling DNS name locally on master node.


Do integration tests need istio?

Is it possible to decouple the integration tests here from istio and the gateway?  Does volumes need istio to function or is it used for routing the selenium tests?  Couldn't they go directly at the dashboard?  The dashboard operator CI does not use istio

The reason istio was added was that without it the namespace field during the creation of a volume would not be filled as it takes it directly from the user-id which is added in the routing using istio.
There might be a way of avoiding this but at the time I ran out of time and stuck with adding istio.

Closing this for now, we are currently testing our UIs with istio, if we want to change that we need to address it on a bigger level.


Finer control over log deletion logic with a new config option

Small logs that rotate more frequently are wiped out and the loss of diagnostic logs make it harder to debug. This pull request brings a new deletion mechanism with a config option of max space allowed for all types of log files. (proxy.config.log.auto_delete_files_space_limits_mb)
The deletion will happen on the oldest file from the log type with biggest ratio=(total size used by the type)/(max space allowed for the type). Log types that are not configured with the max space allowed will not be considered for deletion. (If the config option is empty, then traffic server won't delete any files.)
Test case:
Config:
proxy.config.log.max_space_mb_for_logs INT 25
proxy.config.log.auto_delete_files_space_limits_mb STRING diags.log=7,traffic.out=8,squid.log=10
Files:
10 traffic.out (1M each), 10 diags.log (1M each), and 10 squid.log (5M each)
Verified that 1) it does delete files and 2) deletion happens in order and 3) deletion works not just for the first time.

Seems odd to have this option proxy.config.log.auto_delete_files_space_limits_mb be the only one that is combined for the logs while all the other options are split out into their own config:
proxy.config.log.rolling_enabled: 3
proxy.config.log.rolling_interval_sec: 900
proxy.config.log.rolling_offset_hr: 0
proxy.config.log.rolling_size_mb: 6000
proxy.config.diags.logfile.rolling_enabled: 3
proxy.config.diags.logfile.rolling_interval_sec: 900
proxy.config.diags.logfile.rolling_size_mb: 6000
proxy.config.output.logfile.rolling_enabled: 3
proxy.config.output.logfile.rolling_interval_sec: 900
proxy.config.output.logfile.rolling_size_mb: 6000

I suggest adding a configuration option (3 options) for each of the log types.

We can split it if you like.

What should the new option be? I like the ability to set a size limit for rotated files, rather than just a flag of delete or not. In practice, though, the numbers are really dimensionless weights to provide space based priorities. E.g. if A is set to 100MB and B to 200MB, that means that the rotated files will be clipped such that A takes about half as much space as B as files are deleted to get under the headroom limit.

@bryancall proxy.config.log.auto_delete_files_space_limits_mb might be better in terms of control over custom logs with user-defined names?

custom log overrides should be done in yaml

This was discussed at length during the summit and @dyrock will make the agreed upon changes.