Regions

VSCode Version: 1.5.2
OS Version: Win10

Would be great to have //#region support in typescript

@mbeckenbach can you provide more information of what you are looking for? I am not familiar with //#region support.
Also, is this VS Code specific or is this a feature request for TypeScript? This may be better in TypeScript.

The full visual studio uses comments to mark code blocks as collapsable in all languages. Depending on the language, the syntax is slightly different as the comment syntax is different.
Hard to explain, but web essentials has a nice screenshot of regions in the javascript area: http://vswebessentials.com/features/javascript
Regions should exist for all languages. The comment syntax is different but the result schould be the same.

I think, @mbeckenbach are talking about the #region, current present on c# syntax of Visual Studio. Currently, on C#, #region name_ragion is used to tell where code will start folding and #endregion tells where code will stop folding.
I'm really missing this feature on VS Code as well, all my code have regions for better code reading and on VSCode I can't fold my regions.

yes, that's what i'm talking about. i'm really missing that feature in other languages like for example ts

This issue was moved to Microsoft/TypeScript#11073

@waderyan Not trying to step on any toes here... but just curious why this issue would be moved to Typescript, isn't regions purely aesthetic? That seems like something the Editor should be handling not the language.
As others have mentioned this is great for large code bases, obviously its better when you can split things across multiple files but that's not always the case in large projects without adding even more unnecessary complexity.

@awdogsgo2heaven thank you for your comment. You may be correct and I have been meaning to come back and reopen this issue on our end to gather more feedback from VS Code users.

@isidorn I believe this issue is more general than TypeScript. This is a possibility for a feature request for any language. We see this in other editors (for example, this is what WebStorm does).
Possibly this falls under code folding and should be assigned to @aeschli?
Please advise.

FYI @aeschli @alexandrudima

Would like to have this support too.
Note that the way of WebStorm #region is different than in Visual Studio for C#, so I don't know if it should or can be done in one shot for all languages.
In WebStorm, you specify the region (for JavaScript) as follow:
// region Some comment
... code
// endregion

Notice that it does not have # before region and endregion.
when folded, it looks like this:

It would be great to match WebStorm syntax for JS/TS as my team use it instead of VSCode (I keep persuade them to change. 🌷 ), but that's my personal need / preference.

I use regions heavily and I have // #region XXX and // #endregion all over my JavaScript code which I mainly edit with Visual Studio 2015 Pro.
Here's what Visual Studio 2015 does with them:

My team absolutely needs this feature for large files and we can't use VSCode as our main editor without it.

I would love to see this feature in VS Code as well.
In my case, for PowerShell scripts.
#region Name
...code...
#endregion
Thank you!

Bump

As a C# developer, region/endregion is very general use on wrap reference section. Like below

Please teach me how to do on VSCode. If the feature not implement, please consider it seriously.

The request to allow language aware strategies is #3422

Could this be handled by an extension?

@cossio Unforturtunatly not yet.

@aeschli this does not to be a specifically language aware strategy. It seems to only be more for creating bounded regions in the editor in general. As it may be beneficial to create such regions regardless of the actual underlying language, provided it appears within a comment. Thus
// region
// endregion
/* region
/* endregion
region
endregion
and so on. Even though the initial request was Typescript, it should not be limited there and would be better suited as a language agnostic feature.

@AuthorProxy This has nothing to do with code, only with the way it is presented in an editor, allowing you to visually denote regions and fold them up. So if, for example you are working in C#, and you put all public methods after class properties and your private methods are at the bottom, you can simply put
// region public methods
a couple lines above the first public method and
// endregion
a few lines after the ending of the last, and fold them all to easily skip over them while scrolling. It does not affect the code at all.

Why should everybody see this comments in the source code? It should be clean and self-documented, with comments only there where they should be. Probably editor can provide functionality for a block collapsing or any selected block, but it definitely should not make any changes to the source code. First, you should avoid comments, and make code structure and readability better. Second respect people who do not use VsCode or Visual Studio, we don't like garbage in the source code.

@AuthorProxy Thanks so much for your programming lesson. I guess I've been so wrong all these years. The fact that Visual Studio has offered this for a very long time and that pretty much every JetBrains product also does, the whole world seems to be in horrible shape. I'll be sure in the future to ask you before I write any code, just to make sure it measures up to what you think code should be. Don't forget to let Microsoft know how wrong they've always been and I'll be sure to refer everyone to your standards in the future.

I like how you hide behind "everybody" in our conversation and how you make idol from Microsoft. I don't want teach you or continue the discussion because it seems your arguments finished.

@AuthorProxy Hey I'm not the one who decided to freely offer a programming lesson to someone I didn't know on the internet. To be honest, I don't care how you write code, and the way anyone else does isn't my business either.
However, both professionally and privately I have found regions to be a useful feature in many code bases. And obviously others do feel the same as I'm certainly not the one who came up with the concept. Thus, someone opened an issue asking for a feature many of us are already used to. You were the one who decided to tell us how wrong we all are for how we do things.

Nothing new on work with regions ? Btw i love VS Code keep up the good work.

It seems this feature is still not supported.

I use the region/endregion feature on real-world production code a great deal and miss it for my JS code in VS Code. I'd love to see it added or for VSCode to be extensible enough that a 3rd party extension could add it.

This feature would really help us organize our code for readability and quicker editing!

I think it is already implemented but in weird way cause you have to tab the content in then it will show the folding '-' button on the gutter, but then the default format will remove those tabs out

@viqofirdaus I believe that is only for C#

I really want this feature on Visual Studio Code.
Any news on this?

would be great dude !

Why was this closed?

because does not exist #region at typescript man.

@VictorAnquino that is true. #region is a C# thing (and maybe a few others?). The idea here remains the same though. The request is that there is a way to signify to the editor that we're logically grouping sections of code and would like them to be easily fold-able. One of the best implementations I have seen of this is in FlashDevelop. Their editor continues to respect folding of { and } in comments. This allows you to compose something like:
`//{ Members
public x:number = 0;
public y:number = 0;
public width:number = 0;
public height:number = 0;
//}`
The region above would fold/collapse down to Members...

#region is 100% an editor feature - and not a language feature - as others have pointed out.
When it comes to C#, (nearly) everyone is using Visual Studio, and so you can expect that seeing #region in a .cs file will not annoy (almost) anyone.
However for VS Code, people will quite often being opening files that someone else has created or edited in another editor. For those people, putting in VS Code-specific constructs will almost certainly be annoying.
As much as I love #region in Visual Studio, I can't really think of a way of including it in VS Code in a clean way that continues to support the rich ecosystem.
Probably, the only way to get such a feature IS to include it as a language feature in TypeScript, in which case it could be supported by all TypeScript-capable editors.

It is an editor feature. VS and WebStorm both support it, but in different syntax.
For vscode, it would be best to make it configurable so that the team can use one syntax that works for multiple editors.

It seems that in Jetbrains editors, the file content is parsed, and when the region word is seen in a comment, the next following endregion is then matched with it and the foldable region is created. It is not based on the language itself, but that it appears in whatever makes a comment (whether that be //, /**, #, and so on) in that language. Since they are standard comments for the language in question, they are no more intrusive than comments themselves would be. Jetbrains example is the best I can come up with in this case as they support many different languages in their editors. In these editors, regions can also be named so that a folded region will display the given name (for example // region private will show private when folded), and the regions themselves are nestable.

as @viqofirdaus mentioned, you just need to tab in code in order to do regions.
for example:
  //Variables
    var variable1 = 1;
    var variable2 = 2;
    var variable3 = 3;
  //Methods
    function someMethod(){}
    function someOtherMethod(){}

these will have a collapse icon in the gutter and will only show the comments when collapsed.
Above shows it being used in JavaScript but it also works for html (I us vs community for C# as I code on windows systems, so I didn't test it). all you need to do is make the collapsible region more indented.
I do also agree with @AuthorProxy in that '#regions' pollute the code and might introduce issues when compiling with different IDE's. Never had thought of it being an issue until I read this thread. I think that how the collapsing is incorporated now is a brilliant idea as it helps vs-code be language agnostic and not have to remove IDE specific syntax when compiling which could be an issue for others who prefer other IDE's like vim or atom.
HOWEVER, I think the online documentation needs to explain this a little more as it only showed a method body being collapsed as an example.

Gross.
https://en.wikipedia.org/wiki/Indent_style

If you feel it pollutes the code then simply don't use the directive. Make it something you can enable/disable for those who don't want to use it. Given that VS Code derives its name from 'Visual Studio', which implements this feature, and other IDE's with code folding implement this feature, I fail to understand what all the feet dragging is about.  Implement it already.

@ChessMess I agree that a toggle feature would be very important for those who are very familiar with the '#region' method and would wish to use that in their code. I wonder how hard the implementation would be and if the benefits would out way the effort. Is anyone familiar with the code folding implementation in vs-code and if you are could you comment on the issue of a toggle feature or allowing both features to work in sync?

I always missed #region since I left Visual Studio. I don't understand the complexity to implement it or why isn't there an extension for it yet. I Hope it will see the light someday.

Pleeeeeease 😃

I am thinking about how it can be implemented and I feel as if using the languages version of a comment with a unique phrase would be ideal as it would easily let compilers work with the code without having to remove any strange '#regions' out of it. For instance javascript wouldn't work with the line starting with a '#' and would require the extension or ide to remove it before running the application which would be tying that file or script to the IDE itself which I feel is not the right way to do it. Ideally something such as
// code-region
function doSomething(){}
function parseThis(){}
// code-region-end

but maybe not "code-region" exactly. Any thoughts on this guys/gals?

@TLBSoftware agreed. It should consider comment notation used by each language but look for "region {name}" and "regionend" to create a region. If I'm not mistaken, we could even do a region search within Visual Studio. That is very useful.

@TLBSoftware this is almost exactly how jetbrains does it there's looks like
<Language comment notation> <region> <region name>

...

<Language comment notation> endregion

So for js and php for example
// region Public Methods

...

// endregion

VS (and therefore JetBrains) did it that way because they needed/decided to
fit to their existing compiler directives syntax.
VS Code has no such constraint, and I agree that using comments is good
because it's language and editor portable, so how's this for a wacky idea:
//+
...
//-
It's function is bit more guessable, I reckon, and is less "Microsofty" to
those that are so inclined. Plus I have already typed r-e-g-i-o-n as many
times in my life as I'd like to.
On 3 Aug. 2017 9:34 pm, "Rhonun"<EMAIL_ADDRESS>wrote:

@TLBSoftware https://github.com/tlbsoftware this is almost exactly how
jetbrains does it there's looks like

...
 endregion
So for js and php for example
// region Public Methods
...
// endregion
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/12146#issuecomment-319943985,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABjIdZ5xFe8M9kDsDPWib75s1i1S2aDLks5sUbBSgaJpZM4J-5zO
.

Any news on this? I can't use the tabbed version, otherwise StandardJS will slap me in the face.

I think I'd opt for something that is already being used by other editors over inventing something new.
// region My Region Name
...
// endregion
I've also seen this
//{ My Region Name
...
//}

region support would be very nice

@TLBSoftware has a good temporary solution with indentation and comments
  //Variables
    var variable1 = 1;
    var variable2 = 2;
    var variable3 = 3;
  //Methods
    function someMethod(){}
    function someOtherMethod(){}

But proper region support like the full Visual Studio IDE has should be the final goal
#region MyRegion
var variable1 =1 ;
#endregion

An add on for Visual Studio IDE https://marketplace.visualstudio.com/items?itemName=MadsKristensen.JavaScriptRegions

Using this issue to collect votes for region folding.

How do we vote? I think many people here have already voiced their interest.

interesting extension that does part of what #region functionality should do: bookmarks
maybe it can evolve to what we want here?

Hello,
I was thinking about vscode working with a separate json file that holds peoples regions to be language independent (Regions.json):
files: {
  name: "Main.cs", regions: {
    {0, 6, "usings"}, {10, 15, "private vars"}
    },
  name: "Lib.cs", regions: {
    {1, 10, "constructor"}
}

The editor would manage tracking and persisting the info and the developer be able to toggle its visibility through settings. Thank you. Good day.

Hello,
One alternative is to put effort towards a universal block tagging mechanism. You can write one regex that identifies a start and another to identify an end. You can specify if nesting is allowed. I could for example go and make this:
settings.region = {start: "/^[ ]*[#]region[ ](\\S)$/", end : "/^[ ]*[#]endregion$/", nest: "true", files: "*.cs", languages: "csharp" }

Now if we assume the first ($1 not $0) match group is the region label, it is not too bad for this. vscode can be aware of this filtered view and possibly load any number of these from extensions. Thank you. Good day.

@cossio To vote, add a 👍 to the issue description

Add 👍  to the OP:

I have code files full of #region tags because it works on visual studio CE on my pc. It doesn't work on Visual studio or visual studio code on my mac at all. I use it to manage my code, and it doesn't work at all. Please get this fix through as fast a possible.

I (and many others) use this for PowerShell.  I would love to see this supported in VSCode.
I have to edit code on multiple editors, so it would make sense that VSCode used the same convention for region comments:
 region region_name
... stuff that can be folded away
 endregion [optional matching region_name]
So, in PowerShell:
# region Helper Functions

function x{ ...etc etc

# endregion Helper Functions

Using other syntax (e.g. //+) is not a bad idea, but either (a) support both, or (b) make it configurable.  Otherwise I'd have to change all my scripts to use them in VSCode and region support would then be broken if I needed to edit in another editor.
Thanks.

I don't think it's necessary feature. I don't this this should be even considered.
IMO Using regions is way to get in trouble. If you have to use regions it means your code is not clean. This is NOT language-specific feature, it's only used by VS and its usage is not directly specified. Please keep your code clean instead of using ugly workarounds.

@Melmoth-the-Wanderer
Hello,
I would agree that it is not necessary. Are you against folding code at all? Vscode already has folding based on indentation. Structural artifacts are not about whether your code is clean. Some languages have limits about how you can visually layout code and regions can improve it.
One point is about how to introduce something that is editor only or to make it so an extension can scan and give the user a choice in how they want portions of code to be presented. Given that there is also an issue for language aware folding, there seems to be overlap about whether this is cherry picking one notion of that broader endeavor. If you are particularly concerned about what people put into there code, then the language designers are a better group to mention your concern for some of your points.
I think Eclipse and Idea have awareness of regions either directly or through plugins. Thank you. Good day.

@Melmoth-the-Wanderer - thanks for your thoughts. I'm glad you personally don't need region support and therefore don't miss the feature.  I will resist the urge to get involved in a conversation about code style and whether yours is superior to mine (although I will note that it almost certainly is). I will also note that region folding can be useful for more than just hiding ugliness.
It's clear that folding is considered desirable by a number of people (not just me).  Can you bear in mind that if you find the facility unnecessary you, naturally, do not need to use it.
Best Regards.

Dear @ChrisWarwick , dear @pr-yemibedu,
Thanks for paying me attention to my way of writing, which might be considering as "hate", but it's not. What I'm saying is - I don't like the idea. My thought are based on my experience (and other developer code I'm working on), and they are base for my private opinion. I just consider this 'folding' feature to be more harmful than good. I might be wrong, but currently this is how I feel, therefore I'd like to add my worries to the discussion.
It's up to product owner to decide whether to implement this feature - instead of implementing other useful stuff - or not. Time and resources are always a problem here, it's never good idea to blindly add more and more features, "because we can" ;) VS is good a example here - it's overwhelming and heavy tool - that's why I'm using VS Code instead.
Also, I definitely agree that 'pluginizing' features is a good way of letting user to decide if they want to add (and use) certain features or not. I simply don't like to idea to keep everything in the core :)

@Melmoth-the-Wanderer
Lite is good.  Supporting this with a plug-in is fine for me --- Providing VSCode provides sufficient context to the plug-in to enable it to work.  I claim ignorance on this point, but have to imagine that if it was currently possible to create a region folding plug-in one would exist by now...

@ChrisWarwick Agreed. If it was possible in the first place an extension should have been created by now. Or people do not care about it enough and focused on more useful extensions. Anyhow, for me, it is not a need, I can live without it although I find it very neat. I have a vague memory that I read somewhere that VSCode can't handle regions as it is, that is why nothing has been created so far, but I can be mistaken.

Hello,
Vscode does the hooks for folding as part of core (for indentation). It needs to establish a user facing api that an extension can tell when to begin and end a fold. This will also enable notions for nesting of folds, what the current fold level is, what is a valid marker, what is the signaling glyphs to the user ("+/-" or a label) and if there is support for mixing multiple kinds of regions (comment, keyword, or structure).
I appreciate all feedback and welcome everyone's point of view. I include my two cents as a way to give developers a chance to consider how something can be implemented. I also think about those who may not know many other languages and to not consider there to be only one reason why something is being considered.
I was actually not considering your feelings in my previous reply. I was just adding information to the context you provided. I would not be able to tell whether you were hating or not. That is why I asked about folding in general and mentioned the idea of limitations of language layout. Thank you. Good day.

Here is documented example of language-agnostic support, i.e. #region or //region depending on the language comments, as well as less frequently used <editor-fold>. Worth mentioning that it works for both //region and // region as comment padding is usually a linting rule.

Super happy to see this issue on the iteration plan for Oct 2017!

Folding now supports region markers. Markers are defined by the language in the language configuration. The following languages currently have markers defined:

TypeScript/JavaScript:  //#region and //#endregion  and //region and //endregion
C#: #region and #endregion
C/C++: #pragma region and #pragma endregion
Powershell: #region and #endregion
VB: #Region and #End Region

Let me know about common region markers in other languages.
Making the region markers configurable in the settings might come at a later time.

Fantastic, thanks a lot Martin!

Amazing! :D hoping to see php on the list soon!

Hello,
@aeschli where in the source code was this added?
Would it make sense to add this for F# in the style defined in F# Outlining extension for Visual Studio?
It is mentioned here Regions and Navigation by @tpetricek in an article. It would be the //#region and //#endregion form. Thank you. Good day.

@Fenweldryn What region patterns are common in PHP?

@pr-yemibedu I added the suggested region markers to fsharp

For php using Javascript pattern is fine: //#region

Hello,
There is also something to be said to follow other existing tooling that would make it easier on people. Phpstorm uses //region as described here Using Folding Comments. including a comparison with other editors. Just to minimize possible disparity. Thank you. Good day.

Hello,
@aeschli is there a way to have a fallback folding region. {single-line-comment-leader}<editor-fold desc="Description"> like //<editor-fold desc="Code"> that is used with netbeans and jetbrains products? Then when something specific is needed, it can be added with precedence ahead of the fallback. That is described in Folding Regions for JetBrains and for Code Folds Netbeans. Thank you. Good day.

Hi @aeschli please can you confirm if the content within the #region and #endregion tags has to be indented for the collapsed visual decoration to appear, as is currently in vscode 16.1?
I say this because it would be very handy to use #region to hide the useful, but ugly PowerShell here-string syntax where the @" or @" has to be on the first column of a new line :(

Support for CSS/SASS/LESS would also be very nice.
Pattern is /*#region Description*/ and /*#endregion*/

@Ben-Shirley Content inside #region and #endregion does not need to be indented: I can have any indentation.

When will this show up in the Insiders build?  It doesn't seem to be working for me here:

Judging from the date in that screenshot there hasn't been an Insiders update in a few days, maybe that explains it?

@daviwil Yes, unfortunately still no insiders updates on Mac and Windows. Use Linux or see #34978 for download links.

Hello,
@aeschli I have some nice updates to the fsharp language folding regular expression. Should I send a pull request or do you need to apply the code yourself? This will enable the following:

flexible whitespace before the #region and #endregion signals
"//#region name" or "// #region name"
using one line block comments to enable the same region folding
"(*#region name*)" or "(* #region name *)"

This style will allow languages like CSS to have fold support (it only has  block comments).
I already tried with my own editor and it all does the right thing. This would be helpful to give freedom of choice to the developer and let VSCode lead by example. Thank you. Good day.

@pr-yemibedu I'm happy to take a PR. But I'd like to limit us to established folding markers, and not come up with new variants, however useful they might be.
At some point we will can add user configurable markers.

Hello,
That sounds fair enough. I will qualify any future submissions of this kind with a link to at least one other generally accepted popular editor. Probably looking at tmLanguage files would be a good reference point. Thank you. Good day.

Can vscode support #region and #endregion in PHP ?
( # is also PHP comment )
http://php.net/manual/en/language.basic-syntax.comments.php

@DarkNami I'm happy to add it if this is already an established marker in PHP. Please file a new issue.

What about Python? A simple #region and #endregion would be useful. Right now you can only fold like that if you indent code between the two region comments, but that leads to wrong indentation errors.

This new feature doesn't seem to work in a HTML file.
eg (file: my-app.html):
...
<script>
//region
..... some stuff
//endregion
</script>

That would be very usefull.

Hello,
@yveslange the region handling it is not a global feature. So the javascript regions would need to be included in the htnl language configuration. I am sure many would argue if you start to use regions, to pull that code out into a dedicated file. The you will get the support you expect. Thank you. Good day.

Hello,
@KillyMXI honestly you probably actually want language aware context folding instead of this artificial editor folding. CSS only has block comments, so be careful with your sets of open and close comments. Anyone can manually edit their CSS lang config file:
C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\css\language-configuration.json
and add an acceptable folding section.
"folding": {
  "markers": {
    "start": "^\\s*\\/[*]\\s?#region\\s*(.*)\\s*[*]\\/$",
    "end": "^\\s*\\/[*]\\s?#endregion\\s*(.*)\\s*[*]\\/$"
  }
}

This is something that would probably be lost when the program updates itself, but if you want it anyway, that would probably be a possibilty. I always make a copy of the file before I make changes, just in case. Thank you. Good day.

We want both language aware context folding and artificial region folding for every language. The Ace editor does this for all C style languages (including CSS); it also works for the SqlServer language.
https://github.com/ajaxorg/ace/wiki/Non-Standard-Code-Folding

Hello,
@sevin7676 I agree that a lot of people do want both. I looked at ACE too before and found it had some nice folding options. My prior post was because MXI was asking about a feature in a different issue that seemed better suited here.
So my first sentence is actually out of context here as I started writing it. The rest of my post and example are actually in support of the idea that users should have choice. The code snippet I shared can be hacked into any 1.17.1 editor where they want some non official support for existing code. Thank you. Good day.

Hello. Thanks for answers, @pr-yemibedu
I missed this issue because it has closed status.
I upvoted https://github.com/Microsoft/vscode/issues/12146#issuecomment-332472259 above, with only note that I'd like it to support arbitrary number of spaces around #region keywords and maybe optional description repeated after #endregion, so it will be easier to read in other code editors without region folding.
I'm not interested in editor hacking. I'd like to see this as an officially supported feature that I can refer to when formatting files for a project accessed by multiple developers.

There should be an option to set initial fold state for specific regions.
#region imports folded
// code folded by default
#endregion

#region logic
// code not folded by default
#endregion

you can make it even more fancy with region pragmas taking json objects as props
#region imports {folded=true, bgColor:'red', fontSize:'8pt'}

@aeschli can we have the folding markers be a arrays instead of just a single string? The logic would match start and end markers pair wise until the shortest list is exhausted.
indentRanges.ts 200 can have patterns (an Array) instead of pattern (a String) and just loop over the smaller of the two lists.
let minMarker = markers.start.length < markers.end.length ? markers.start.length : markers.end.length;
for (let currentMarker = 0; currentMarker < minMarker; currentMarker++){
  let currentPattern = new RegExp(`(${markers.start[currentMarker].source})|(?:${markers.end[currentMarker].source})`);
  patterns.push(currentPattern);
}

indentRanges.ts 220 can check for list length > 0 with an outer if and then on an inner for loop over each pattern, do all the existing logic you have today inside.
if(patterns.length >0){
  for(let pattern of patterns){ do existing logic }
}

And that would all work (including an update to the schema) with below as an example.
"folding": {
  "markers": {
    "start": ["^\\s*#Region\\b", "^\\s*Region\\b"],
    "end": ["^\\s*#End Region\\b", "^\\s*End Region\\b"]
  }
}

This would promote not having mixed start and end markers.


Support smaller font sizes on mobile

Is your feature request related to a problem? Please describe.
The design team for Merch has a design for a mobile flight card that uses size 1.125rem font for the departure and arrival times:

The auro-flight component uses 1.75rem for these fonts and it cannot be adjusted directly.

Describe the solution you'd like
I'd like the component either updated to allow for an input to control the mobile font size, with the default value being the same as today for backward compatibility or have the component updated to use 1.125rem for departure & arrival times on mobile screen sizes, there was some discussion on the Auro public channel that the behavior I am seeing might be a bug and the font size is supposed to be 1.125rem on mobile.
Describe alternatives you've considered
I considered using javascript to reach into the shadow dom and modify the styles directly but this would be a brittle solution and doesn't address the underlying issue.

Hey @cwilliams7 I am looking over the code for this element and we do not have any media query support. I am re-classing this as a FEATURE vs a BUG as this is not something that is broken, it's a capability that does not exist.
@leeejune who is a designer we can work with to understand the missing capability?

@blackfalcon, thanks for clarifying! @blackfalcon & @leeejune the designer would be Chloe L'Ecuyer.

Erika has also brought this issue up. Would like to see this work refined.

Flight Search is planning to direct mobile user to the responsive microsite soon, and we are seeing the same wrapping issue with the time. The auro-flight blueprint does indicate smaller text sizes at the mobile breakpoint.

This is the link to original redlines: https://www.figma.com/file/4e5FcfFlEhnSW9GveMlKnj/Flight-Line?type=design&node-id=160-7273&mode=design&t=fO8htQTrwZXcPRZs-11

We need to update the smallest breakpoint to use var(--auro-text-heading-300-size-breakpoint-sm)

Blueprint completed here


nitrogql generate throws error on Vercel's build environment: bad option: --import=@nitrogql/esbuild-register

Reproduction: https://github.com/cm-ayf/nitrogql-nextjs (examples/nextjs with vercel.json)

Full error log from Vercel:
/node18/bin/node: bad option: --import=@nitrogql/esbuild-register
Error: Command failed: /node18/bin/node --no-warnings --import=@nitrogql/esbuild-register --experimental-loader=@nitrogql/esbuild-register/hook --input-type=module
/node18/bin/node: bad option: --import=@nitrogql/esbuild-register
    at checkExecSyncError (node:child_process:885:11)
    at execFileSync (node:child_process:921:15)
    at executeNodeSync (file:///vercel/path0/node_modules/@nitrogql/core/dist/config.js:27:12)
    at execute_node (file:///vercel/path0/node_modules/@nitrogql/core/dist/config.js:62:24)
    at wasm://wasm/00824b7a:wasm-function[741]:0x1a732f
    at wasm://wasm/00824b7a:wasm-function[21]:0x7925
    at wasm://wasm/00824b7a:wasm-function[1679]:0x1da3bc
    at wasm://wasm/00824b7a:wasm-function[690]:0x1a0f6c
    at wasm://wasm/00824b7a:wasm-function[1718]:0x1dac7c {
  status: 9,
  signal: null,
  output: [
    null,
    '',
    '/node18/bin/node: bad option: --import=@nitrogql/esbuild-register\n'
  ],
  pid: 230,
  stdout: '',
  stderr: '/node18/bin/node: bad option: --import=@nitrogql/esbuild-register\n'
}
Error:
Failed to execute config file: Failed to execute config file
Error: Command "npm run generate && npm run build" exited with 1

This issue does not reproduce with (local) Node.js of either v18.18.2 or v20.8.1, but does reproduce only in Vercel build environment which has been confirmed (just added node -v in buildCommand) to be using v18.17.1 currently.
This issue reproduces in<EMAIL_ADDRESS>but does not in<EMAIL_ADDRESS>(I ended up avoiding this issue by downgrading @nitrogql/cli to v1.3.0 and using scalar.mjs; refer to #19.)
This diff in #22 seems to throw the error. node --import is introduced in v19.0.0 and v18.18.0, but Node.js version in Vercel build environment is not sufficient to use this flag.

It may be not very good to depend on Node.js feature that is "Stability: 1 - Experimental" :thinking:

Thanks you for detailed report 🙂
Fixed in v1.3.3.
As you suggested, the --import flag seems too new for Node.js 18 users. I updated to use the --require flag instead.
I'm not very hesitant to using experimental features though, as long as I can actively maintain the project, since experimental features will be experimental forever if no one uses them. 🙃

I've confirmed that<EMAIL_ADDRESS>works perfectly on Vercel build environment. Thank you!
By the way, Vercel has just announced that Node.js v20 LTS is available in beta.


[SPARK-17984][YARN][Mesos][Deploy][WIP] add executor launch prefix support

What changes were proposed in this pull request?
Complete Standalone, Yarn, Mesos support from #15579 and adapt to latest master branch.
How was this patch tested?
Standalone and Yarn mode tested on spark cluster with 1 master + 2 slaves, Mesos mode is not tested due to lack of resources.
How to use

Global Environment Variable
export SPARK_EXECUTOR_LAUNCH_PREFIX="/tmp/spark-numa-example.sh"
Config Files

Standalone mode: add SPARK_EXECUTOR_LAUNCH_PREFIX="/tmp/spark-numa-example.sh" in conf/spark-env.sh
Yarn client mode: add spark.yarn.appMasterEnv.SPARK_EXECUTOR_LAUNCH_PREFIX="/tmp/spark-numa-example.sh" in conf/spark-defaults.conf

Attach the example script for adding executor launch prefix to enable NUMA-aware binding for executors. Same apply to adding other launch prefix such as strace, vtune etc..
spark-numa-example.zip

Can one of the admins verify this patch?

Why is this different from https://github.com/apache/spark/pull/16411 ?

@srowen do you mean #15579?

Fix some character escape issues of #15579 if the command string contains some special characters like '
Add Standalone and Mesos support as #15579 only support Yarn mode

Oops yes wrong copy/paste.
We have two overlapping PRs then. It'd be better to collaborate on one. If the other is inactive can you close it @sheepduke ? but I am not sure we're going to merge this anyway.

@srowen sheepduke is my colleague who just left. I am continuing to refine his work. It's OK to close #15579 .  @sheepduke

I'm a little worried this is very open ended and could cause a lot of issues with users using it wrong.  This opens up customers to basically do anything they want while launching an executor. Even not launching an executor since really this is replacing the normal executor launch command with this script.   It relies on that customers script to actually launch the executor based on the command passed in.
If this goes in it definitely need much better explanation and docs on how to properly write and use it.   I would rather see it being more truly of a pre-init script then a total replacement.  Perhaps the spark executor launch command is a script that will pre-pend some users stuff but then makes sure it still calls the normal java executor launch command.
Also what about yarn cluster mode?
Do you have test results of configuring numa that shows definite improvements?   How does this compare to Automatic NUMA balancing that I believe is on by default in Rhel7.  I realize perhaps most machines aren't running rhel7 yet but wondering if it was tried.
does numactl require special priveleges (like root) to do certain operations?
The script looks very basic which I understand for an example is fine but it seems like there are definitely things missing and things people could get wrong.
For instance, how do you handle multiple containers on a node.  How does this work when you specify an executor to have X cores.
Note I haven't done any tuning of numa myself so sorry if some of these questions seem obvious.
How does processes with numa configured interact with processes that don't?    It seems like tuning things right could be quite hard especially if running on something like yarn where other applications aren't using the same logic to configure numa.

@tgravescs Thanks for your comments. There are two things we have tried.

To add a prefix command on executor launch
I agree this opens a door for user to do anything for launching the executor. This patch is intended for profiling and debugging. May not fit for production. I am not sure it's the best form to implement, it fixed our problem quickly.

NUMA
The script attached about NUMA is only an example to show how to use this patch. User can customize it to fulfill their specific needs. Automatic NUMA balancing is by default enabled on our system. As mentioned in the original Redhat slides, It can only deal with certain cases and still can not beat manual pinning. From our experiments, not all cases have big NUMA penalties. We should use some platform tools such as Intel VTune to identify if there is a NUMA problem and tune case by case.

Can one of the admins verify this patch?

Can one of the admins verify this patch?


How to compare if two functions are equal.

void foo() {}
void main(){
  print(foo == foo);  // => false on the VM.
}
We need to specify how references to (static) functions are handled.
This includes the following cases:
 o.foo == o.foo
 o.foo === o.foo
 foo == foo // for a static function foo.
 foo === foo

Someone asked about this recently; note that this does work in more recent Dart versions:
$ cat func.dart
void foo() {}
void main(){
  print(foo == foo); // => false on the VM.
}

$ dart func.dart
true


Try101Linqsamples - not getting it going

Cloned the project, dotnet try tool installed.
From the package manager:
PM> dotnet try
Hosting environment: Production
Content root path: C:\Users\Owner.dotnet\tools.store\microsoft.dotnet-try\1.0.20474.1\microsoft.dotnet-try\1.0.20474.1\tools\netcoreapp3.1\any
Now listening on: https://localhost:60364
Application started. Press Ctrl+C to shut down.
Browser opens, and there is nothing there, except for this in a heading:
Try .NET c:\users\Owner\source\repos\try-samples\101-linq-samples\src\

Just use dotnet try c:\users\Owner\source\repos\try-samples\101-linq-samples and then scroll down the page to where it reads:

If you loaded this page from dotnet try, click [here](https://localhost:28344/index.md) to start the sample. (This link will not work in the samples browser).

You should be able to get to the samples that way.
Good luck


Upgrade observer version, watch for delete events

Description
Fix: https://github.com/openshift/autoheal/issues/101
Upgrade to v1.5.11 of observer, watch for create and delete events.

@nimrodshn @zgalor @moolitayer @elad661 @jhernand . Please review.

@yaacov if I run make check with this patch applied I get the following error:
$ make check
{ \
hack/verify-gofmt.sh ||r=1;\
hack/verify-govet.sh ||r=1;\
hack/verify-imports.sh ||r=1;\
exit $r ;\
}
[INFO] Detected go version: go version go1.10.1 linux/amd64.
[WARNING] Detected golang version doesn't match required Go version.
[WARNING] This version mismatch could lead to differences in execution between this run and the CI systems.
[INFO] hack/verify-gofmt.sh exited with code 0 after 00h 00m 00s
[INFO] Detected go version: go version go1.10.1 linux/amd64.
[WARNING] Detected golang version doesn't match required Go version.
[WARNING] This version mismatch could lead to differences in execution between this run and the CI systems.
[INFO] hack/verify-govet.sh exited with code 0 after 00h 00m 00s
SUCCESS after 0.012s: hack/verify-imports.sh:18: executing 'import-verifier /files/go/src/github.com/openshift/autoheal/hack/import-restrictions.json' expecting success
[INFO] hack/verify-imports.sh exited with code 0 after 00h 00m 01s
GOTEST_FLAGS="" hack/test-go.sh
[INFO] [CLEANUP] Cleaning up temporary directories
ok  	github.com/openshift/autoheal/cmd/autoheal	(cached)	coverage: 58.9% of statements
ok  	github.com/openshift/autoheal/pkg/alertmanager	(cached)	coverage: 100.0% of statements
ok  	github.com/openshift/autoheal/pkg/apis/autoheal	(cached)	coverage: 8.0% of statements
E0509 09:59:24.995523    8425 config.go:105] Can't reload configuration files: Can't check if '/tmp/test_dir735571558/test_file0258046093' is a file or a directory: stat /tmp/test_dir735571558/test_file0258046093: no such file or directory
E0509 09:59:25.050732    8425 config.go:105] Can't reload configuration files: Can't check if '/tmp/test_config144561735' is a file or a directory: stat /tmp/test_config144561735: no such file or directory
E0509 09:59:25.050853    8425 config.go:105] Can't reload configuration files: Can't check if '/tmp/test_config144561735' is a file or a directory: stat /tmp/test_config144561735: no such file or directory
E0509 09:59:25.051588    8425 config.go:105] Can't reload configuration files: Can't check if '/tmp/test_config144561735' is a file or a directory: stat /tmp/test_config144561735: no such file or directory
E0509 09:59:25.052407    8425 config.go:105] Can't reload configuration files: Can't check if '/tmp/test_config144561735' is a file or a directory: stat /tmp/test_config144561735: no such file or directory
PASS
coverage: 57.1% of statements
==================
WARNING: DATA RACE
Write at 0x00c42041a600 by goroutine 60:
  github.com/openshift/autoheal/pkg/config.(*RulesConfig).clear()
      /files/go/src/github.com/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/pkg/config/rules.go:104 +0xc3
  github.com/openshift/autoheal/pkg/config.(*Config).load()
      /files/go/src/github.com/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/pkg/config/config.go:125 +0x103
  github.com/openshift/autoheal/pkg/config.(*Config).watch.func1()
      /files/go/src/github.com/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/pkg/config/config.go:103 +0xab

Previous read at 0x00c42041a600 by goroutine 45:
  runtime.convT2Eslice()
      /usr/lib/golang/src/runtime/iface.go:373 +0x0
  github.com/openshift/autoheal/pkg/config.TestLoadDir()
      /files/go/src/github.com/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/pkg/config/builder_test.go:390 +0x9aa
  testing.tRunner()
      /usr/lib/golang/src/testing/testing.go:777 +0x16d

Goroutine 60 (running) created at:
  github.com/openshift/autoheal/vendor/github.com/yaacov/observer/observer.(*Observer).sendEvent()
      /files/go/src/github.com/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/vendor/github.com/yaacov/observer/observer/observer.go:192 +0xa0
  github.com/openshift/autoheal/vendor/github.com/yaacov/observer/observer.(*Observer).handleEvent.func1()
      /files/go/src/github.com/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/vendor/github.com/yaacov/observer/observer/observer.go:229 +0xe6

Goroutine 45 (finished) created at:
  testing.(*T).Run()
      /usr/lib/golang/src/testing/testing.go:824 +0x564
  testing.runTests.func1()
      /usr/lib/golang/src/testing/testing.go:1063 +0xa4
  testing.tRunner()
      /usr/lib/golang/src/testing/testing.go:777 +0x16d
  testing.runTests()
      /usr/lib/golang/src/testing/testing.go:1061 +0x4e1
  testing.(*M).Run()
      /usr/lib/golang/src/testing/testing.go:978 +0x2cd
  main.main()
      _testmain.go:104 +0x324
==================
E0509 09:59:25.054325    8425 config.go:105] Can't reload configuration files: Can't check if '/tmp/temp_dir467130618' is a file or a directory: stat /tmp/temp_dir467130618: no such file or directory
Found 1 data race(s)
FAIL	github.com/openshift/autoheal/pkg/config	1.096s
ok  	github.com/openshift/autoheal/pkg/dig	(cached)	coverage: 73.9% of statements
ok  	github.com/openshift/autoheal/pkg/memory	(cached)	coverage: 90.0% of statements
[ERROR] PID 8094: hack/test-go.sh:190: `go test ${gotest_flags} ${test_packages}` exited with status 1.
[INFO] 		Stack Trace:
[INFO] 		  1: hack/test-go.sh:190: `go test ${gotest_flags} ${test_packages}`
[INFO]   Exiting with code 1.
make: *** [Makefile:92: test-unit] Error 1

Can you take a look?

Can you take a look?

looking :+1:

Can you take a look?

@jhernand PTAL now

Thanks @yaacov, I don't get the error now, but I still don't see any action when a configuration file is removed. This is what I do to check it:
$ # Create an empty configuration directory:
$ mkdir config.d

$ # Start the autoheal service in the background:
$  _output/local/bin/linux/amd64/autoheal server --config-file config.d &
I0509 11:08:40.129114   14815 config.go:97] Watching configuration file 'config.d/*.yml'
I0509 11:08:40.129199   14815 config.go:97] Watching configuration file 'config.d/*.yaml'
I0509 11:08:40.129223   14815 healer.go:132] AWX user is ''
I0509 11:08:40.129234   14815 healer.go:133] AWX project is ''
I0509 11:08:40.129324   14815 healer.go:196] Workers started
W0509 11:08:40.129337   14815 healer.go:254] There are no healing rules in the configuration
I0509 11:08:40.129354   14815 healer.go:213] Web server started
I0509 11:08:40.129416   14815 active_jobs_worker.go:27] Going over active jobs queue

$ # Copy a first configuration file to the configuration directory:
$ cp examples/autoheal-dev.yml config.d/0.yml
I0509 11:09:25.830782   14815 config.go:109] Configuration files have changed
I0509 11:09:25.831166   14815 config.go:193] Loading configuration file 'config.d/0.yml'
I0509 11:09:25.863426   14815 healer.go:252] Loaded 2 healing rules from the configuration
I0509 11:09:25.863503   14815 rules_worker.go:83] Rule 'start-node' was added
I0509 11:09:25.863531   14815 rules_worker.go:83] Rule 'say-hello' was added

$ # Create a second configuration file, with a new rule:
$ cat >> config.d/1.yml <<.
> rules:
> - metadata:
>     name: another-rule
>   labels:
>     alertname: "AnotherAlert"
>   awxJob:
>     template: "Do something"
> .
I0509 11:10:50.559053   14815 config.go:109] Configuration files have changed
I0509 11:10:50.559484   14815 config.go:193] Loading configuration file 'config.d/0.yml'
I0509 11:10:50.562470   14815 config.go:193] Loading configuration file 'config.d/1.yml'
I0509 11:10:50.563518   14815 rules_worker.go:98] Rule 'start-node' was deleted
I0509 11:10:50.563923   14815 rules_worker.go:98] Rule 'say-hello' was deleted
I0509 11:10:50.564028   14815 rules_worker.go:83] Rule 'start-node' was added
I0509 11:10:50.564142   14815 rules_worker.go:83] Rule 'say-hello' was added
I0509 11:10:50.564245   14815 healer.go:252] Loaded 3 healing rules from the configuration
I0509 11:10:50.564331   14815 rules_worker.go:83] Rule 'another-rule' was added

$ # Delete the second configuration file. Should trigger a reload, but nothing happens.
$ rm config.d/1.yml

@jhernand

Delete the second configuration file. Should trigger a reload, but nothing happens.

Works for me (TM)
Do you think I check somthing more ?

Ah, I see, I applied only the last commit of your pull request. Now I applied both and it works correctly. Thanks @yaacov.


Invesitgate rate limits causing CORs errors

Context: https://hiropbc.slack.com/archives/C03TU42NL05/p1707765745337059

The errors were cuased by coingeeko rate limit


tests: Add --force option to tools/test-all

Fixes #2996.

Automated message from Dropbox CLA bot
@rafidaslam, it looks like you've already signed the Dropbox CLA. Thanks!

Automated message from Dropbox CLA bot
@rafidaslam, it looks like you've already signed the Dropbox CLA. Thanks!

One approach for doing this that might be cleaner is something like this:
if [[ "$1" = "--force" ]]; then
   FORCEARG="--force"
fi
￼
run ./tools/test-tools "$FORCEARG"
...

(Only adding the "$FORCEARG" for the commands that support/require --force).  I think if we did that we'd be able to fully support the desired feature with a very small diff (and small overall resulting script, which is nice for readability).
(Nicer still would be to use the getopt command-line argument parsing tool)

@timabbott that implementation seems cleaner, I'll try to using the getopt approach, thanks.

@trueskawka @timabbott updated


Theme related suggestions

Hi, I have some suggestions related to Base Template, theme tutorial and variables, from the theme developer's perspective.

{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
That's not great to be required to define a basic variable by default in a template. I found it's already available in grav as config.theme so maybe we can delete this from Base Template and docs.
<html lang="{{ grav.language.getActive ?: theme_config.default_lang }}"> ->
<html lang="{{ page.language ?: site.language }}">
There's already page.language available, just introduce default variable site.language and it gets a lot cleaner.  theme_config.default_lang is not the best because it should be default site language as set by the user and not theme language as set by theme developer. default_lang is also not even defined in the theme config of Base Template.
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title> ->
<title>{% if page.title %}{{ page.title|e }} | {% endif %}{{ site.title|e }}</title>
page.title is more intuitive and doesn't introduce new top-level variable, 'html' is default for escape filter
<link rel="canonical" href="{{ page.url(true, true) }}" />
Maybe consider introducing some new variable like page.permalink but for canonical, e.g. page.canonical
{{ page.header.body_classes }} - > {{ page.body_classes }}
{{ base_url == '' ? '/' : base_url }}
Can't base_url just return '/' instead of ''? Also I had to check where it came from as it's a new top-level variable. Something like site.url would be more intuitive.
{{ config.site.title }} -> {{ site.title }}

Generally speaking I'd make most of variables available as x.y and not x.y.z, while also limiting the number of top-level x variables available.
config.system.variable -> system.variable
config.theme.variable -> theme.variable
config.site.variable -> site.variable
page.header.variable -> page.variable
header.variable -> page.variable
I think these changes would make Base Template, documentation, and workflow with grav more clean and intuitive. Some of them are already supperted but not documented as default worflow.

Some of these are good ideas and would definitely make things a little easier.  As i'm already actually working on a new default theme, i'll see what I can do about adding some of these improvements.
The one thing that is not relaly possible, is the header.variable -> page.variable.  There could be conflicts here as the header is a flexible YAML powered set of variables, where as the page itself, is an object that represents the page.  The header. is simply a shortcut for page.header.

Grav looks good, I'm glad to provide some feedback.
About header.variable -> page.variable, I put {{ page.title }} in a template and it also alredy works as shortcut for {{ page.header.title }}! Is it discouraged to use page.title, and rather type header.title or page.header.title? It's easier to remember and more consistent to me to just use page.language and page.title instead of page.language but headers.title or page.headers.title. Also that way I can have mirrored default variables in site. and just type: {{ page.title|e }} | {{ site.title|e }} or {{ page.language ?: site.language }}.

Quite a few improvements have been taken care of here: https://github.com/getgrav/grav/pull/1232

This PR has been merged, just need to document it all!


Define lineinfo to encode 3 elements: Column number, Line number, Total number of lines

Macro/Function Definition:
let g:lightline.component = {
        \ 'lineinfo': "[%{printf('%03d/%03d',line('.'),line('$'))}]"
}

Currently this definition is printing only two elements: Line number and Total number of lines.
Actual Behavior:  45/1123
Desired Behavior: 23/45/1123
Can someone help me with the definition of lineinfo so that it prints 3 elements:
- Column number,
- Line number,
- Total number of lines in file
How would I extend current definition. Could I request the right definition given here.

You can get the column number by col('.').

Thanks for the suggestion. I updated the old definition to the new one given below. Basically added a 3 element to the macro definition and it works.
The new definition is:
let g:lightline.component = {
\  'lineinfo': "[%{printf('%03d/%03d/%03d',col('.'),line('.'),line('$'))}]"
}


Change "Responsible" Vulnerability Disclosure policy to "Coordinated" Vulnerability Disclosure

1. What's the name of the policy?
Responsible Disclosure of Security Vulnerabilities
2. Is this issue related to a specific section within one of our policies (e.g. the Terms of Service)? If so, please include a link to the section or subsection.
https://docs.github.com/en/github/site-policy/responsible-disclosure-of-security-vulnerabilities#article-contents
3. Did you already open a pull request? If so, please include a link to the PR in the GitHub Docs repo.

https://github.com/github/docs/pull/11451

4. Sometimes it's easier to just put your feedback text into an issue. If that's how you'd prefer to contribute, this is the section to do that.
The name of the policy should be changed from "Responsible Disclosure of Security Vulnerabilities" to "Coordinated Disclosure of Security Vulnerabilities".
5. Why do you think this section or language needs improvement?
For lots of the discussion and points here I'll be referencing this article Coordinated Vulnerability Disclosure: Bringing Balance to the Force by Katie Moussouris from 2010.
"Responsible" implies a set of ethics and morals are involved in vulnerability disclosure. "responsible" is also very subjective. From the perspective of the security researcher, the company (in this case GitHub) may be the "irresponsible" party for releasing the vulnerable code without adequate testing. From the perspective of the company, in this case GitHub, the researcher may be "irresponsible" if they choose to go public with a vulnerability before the vulnerability is fully patched and shipped to customer. As such, much of the industry has moved away from the term "Responsible" to the term "Coordinated".

Responsible Disclosure should be deprecated in favor of something focused on getting the job done, which is to improve security and to protect users and systems.

Additionally, Coordinated Vulnerability Disclosure (CVD) has been the norm at Microsoft for 11 years. GitHub should similarly match the language around vulnerability disclosure that Microsoft has.
Also, I'm regularly working with the GitHub Security Lab and they use a Coordinated Disclosure Policy. It would be nice if this policy were consistent across GitHub.

https://docs.github.com/en/code-security/security-advisories/about-coordinated-disclosure-of-security-vulnerabilities
https://securitylab.github.com/advisories/#policy

While this is being addressed. I believe the following change should also be made here:

https://bounty.github.com/#legal_safe_harbor

Currently:

We want you to responsibly disclose through our bug bounty program, and don’t want researchers put in fear of legal consequences because of their good faith attempts to comply with our bug bounty policy. We cannot bind any third party, so do not assume this protection extends to any third party. If in doubt, ask us before engaging in any specific action you think might go outside the bounds of our policy.

Should be changed to:

We want you to coordinate disclosure through our bug bounty program, and don’t want researchers put in fear of legal consequences because of their good faith attempts to comply with our bug bounty policy. We cannot bind any third party, so do not assume this protection extends to any third party. If in doubt, ask us before engaging in any specific action you think might go outside the bounds of our policy.

@JLLeitschuh - thanks so much for opening this issue and the PR ✨

The name of the policy should be changed from "Responsible Disclosure of Security Vulnerabilities" to "Coordinated Disclosure of Security Vulnerabilities".

💯 - Apologies for not getting to this yet - it's on deck for next week.

https://docs.github.com/en/github/site-policy/responsible-disclosure-of-security-vulnerabilities#article-contents .... close please

@JLLeitschuh I pushed https://github.com/github/docs/pull/11451/commits/ec06da126b9b9271d518dc4c67b557d4cdf08203 to ~responsible~ **coordinated** in one more spot and added Bug Bounty Program - Legal Safe Harbor to your PR.
https://bounty.github.com/#legal_safe_harbor is maintained separately. We'll update the site-policy docs in the meantime.

cross-posting from https://github.com/github/docs/pull/11451#issuecomment-969552090

@JLLeitschuh - the change you requested is now live on https://bounty.github.com/#legal_safe_harbor 🎉

thanks again for your ✨ contributions to these docs!


matTooltip on matMenuTriggerFor cannot be closed

Bug
If matMenuTriggerFor has a matTooltip then after menu is closed tooltip will be shown again.
But it won't be hidden until user clicks somewhere or hover trigger button again.
Manual call to MatTooltip.hide() does not work in this situation.
What is the expected behavior?
Not show tooltip after menu is closed as it was in previous version or make it closable.
What is the current behavior?
Tooltip is shown and cannot be closed.
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-dozdbn

Looks like tooltip is shown when element receives a focus by keyboard.
When menu closed matMenuTriggerFor receives focus and tooltip is shown.
Probably tooltip cannot be hidden until element has focus.

Calling HTMLElement.focus() on menuClosed completely solves the problem.
https://stackblitz.com/edit/angular-material2-issue-m6e4un
It even continue to show tooltip if menu was closed by Ecs

In material 5.x.x we can use
<button mat-icon-button class="actions" [matMenuTriggerFor]="menu"  #menuTrigger="matMenuTrigger"  matTooltip="tooltip here" (menuClosed)="menuTrigger.focus()">
        <mat-icon class="actions"></mat-icon>
</button>

 <mat-menu #menu="matMenu" [overlapTrigger]="false" class="related-doc-menu">
        <button mat-menu-item >
title goes here !
        </button>

    </mat-menu>


Unable to migrate to latest sdk versions in my capacitor/react app

Environment
What version are you running? Etc.
"@sentry/capacitor": "^1.0.2",
"@sentry/cli": "^2.25.3",
"@sentry/react": "8.37.1",

"@capacitor/core": "^6.1.2",
"react": "^18.2.0",

Steps to Reproduce

Bumped both @sentry/capacitor and @sentry/react using npm i @sentry/capacitor@latest @sentry/react@latest
Received some error output indicating a peer dependency violation. @sentry/capacitor@latest requires a very specific, exact version of<EMAIL_ADDRESS>Fine, I installed the exact version npm i<EMAIL_ADDRESS>--save-exact
My app appears to compile and run without issue, but there is still a large error output indicating some variable or export mismatch in sentry internals

Expected Result
When the correct sdk versions and peerDeps are installed, the app should run without errors
Actual Result
ERROR in<EMAIL_ADDRESS>26:15-26
export 'SDK_VERSION' (imported as 'SDK_VERSION') was not found in '@sentry/utils' (possible exports: BAGGAGE_HEADER_NAME, CONSOLE_LEVELS, DEFAULT_RETRY_AFTER, GLOBAL_OBJ, LRUMap, MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, SENTRY_XHR_DATA_KEY, SentryError, SyncPromise, TRACEPARENT_REGEXP, _asyncNullishCoalesce, _asyncOptionalChain, _asyncOptionalChainDelete, _browserPerformanceTimeOriginMode, _nullishCoalesce, _optionalChain, _optionalChainDelete, addContextToFrame, addExceptionMechanism, addExceptionTypeValue, addInstrumentationHandler, addItemToEnvelope, addNonEnumerableProperty, addOrUpdateIntegration, addRequestDataToEvent, addRequestDataToTransaction, applyAggregateErrorsToEvent, arrayify, baggageHeaderToDynamicSamplingContext, basename, browserPerformanceTimeOrigin, checkOrSetAlreadyCaught, consoleSandbox, convertToPlainObject, createAttachmentEnvelopeItem, createClientReportEnvelope, createDebugPauseMessageHandler, createEnvelope, createEventEnvelopeHeaders, createStackParser, dateTimestampInSeconds, dirname, disabledUntil, dropUndefinedKeys, dsnFromString, dsnToString, dynamicRequire, dynamicSamplingContextToSentryBaggageHeader, envelopeContainsItemType, envelopeItemTypeToDataCategory, escapeStringForRegex, eventFromMessage, eventFromUnknownInput, exceptionFromError, extractExceptionKeysForMessage, extractPathForTransaction, extractRequestData, extractTraceparentData, filenameIsInApp, fill, forEachEnvelopeItem, generateSentryTraceHeader, getDomElement, getEventDescription, getFunctionName, getGlobalObject, getGlobalSingleton, getLocationHref, getNumberOfUrlSegments, getOriginalFunction, getSDKSource, getSanitizedUrlString, getSdkMetadataForEnvelopeHeader, htmlTreeAsString, instrumentDOM, instrumentXHR, isAbsolute, isBrowser, isBrowserBundle, isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isMatchingPattern, isNaN, isNativeFetch, isNodeEnv, isPlainObject, isPrimitive, isRateLimited, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel, join, loadModule, logger, makeDsn, makeFifoCache, makePromiseBuffer, markFunctionWrapped, memoBuilder, nodeStackLineParser, normalize, normalizePath, normalizeToSize, objectify, originalConsoleMethods, parseEnvelope, parseFetchArgs, parseRetryAfterHeader, parseSemver, parseStackFrames, parseUrl, rejectedSyncPromise, relative, resetInstrumentationHandlers, resolve, resolvedSyncPromise, safeJoin, serializeEnvelope, severityFromString, severityLevelFromString, snipLine, stackParserFromStackParserOptions, stringMatchesSomePattern, stripSentryFramesAndReverse, stripUrlQueryAndFragment, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsHistory, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver, timestampInSeconds, timestampWithMs, tracingContextFromHeaders, truncate, updateRateLimits, urlEncode, usingPerformanceAPI, uuid4, validSeverityLevels, walk, watchdogTimer)
<EMAIL_ADDRESS>41:0-58 41:0-58
<EMAIL_ADDRESS>2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457 2:0-457
 @ ./src/sentry.js 20:37-65
 @ ./src/logger.js 32:37-54
 @ ./src/index.js 32:37-54

webpack 5.94.0 compiled with 54 errors in 3422 ms

Hi and thank you for opening this issue!
Could you tell the versions inside the package @sentry/utils, @sentry/react and @sentry/capacitor?
you can find this information at<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>

I just ran npm upgrade @sentry/utils and it looks like I can now compile without errors. Seems that for some reason this upgrade was not made automatically when I made the other version migrations


Does it work with Rails 5.1.4 and Spree 3.3.2?

Hi I was wondering if it works with Rails 5.1.4 and Spree 3.3.2?

@tathspts Yes! This should work with Spree 3.3

getting this error
/public/vinsol_spree_themes/current/views/spree/shared/_header.html.erb where line #13 raised:
undefined method `store_menu?' for #<#Class:0x007faaa7078c68:0x007faaa708afa8>

@tathspts Thanks for reporting this bug. This method has been recently removed from Spree
Will provide a fix ASAP.

Getting error on search
undefined local variable or method `cache_key_for_taxons' for #<#<Class:0x00000006d18c50>:0x00000006d0cdd8>

Did you mean?  cache_key_for_products

Hey @nakamuraagatha
I have already updated few themes and there are PR's that are pending for review but you can use these branches for Spree >= 3.3.0

Default
theme-ClassicWhite
theme-BigShop

I am using spree 3.4.4 and vinsol_spree_themes 0.0.1 (at master@5c5b7a0) and I am getting still the error
undefined local variable or method `cache_key_for_taxons' for #<#<Class:0x00007f7ef06747f8>:0x00007f7ef0643d60>
Did you mean?  cache_key_for_products

Is there any way around this issue?

Due to the differen spree version I opened a new issue: https://github.com/vinsol-spree-contrib/spree_themes/issues/17


Remove text references and table

[x] Update config
[x] Update create table / insert data scripts
[x] Update tornado handlers
[x] Update DB Clients - remove text table
[x] Update postgres.py
[x] Update API_Schema handlers

I can't reply to your comment directly @ahmedhamodi, but basically I ran the app and went through all the saved endpoints that I had on Postman and all of them worked :) Also ran the update/insert scripts and manually checked postgres to ensure it looked good


Format service tests and style fixes

For now it is not possible to run the tests in CI, see https://github.com/Microsoft/vscode/issues/118.
I suggest disabling Travis until that version lands.

Hmm, i see. Thanks for information and contribution :)


Getting access token from the backend

Hi!
As I understood, there are multiple types of auth supported. I would like to be able to access user profile image and name from the backend server, but authorize user on mobile. How to do that?
Currently, as I understood, VK ID receives auth code and then immediately exchanges it to the access token. Instead, i would like to send the auth code to the backend, and then exchange it for the access token there. Is it possible?
I know I can achieve the same behavior with a webview + manual requests, but I believe the SDK is more suitable for that?
Thanks!
P.S. I am using OneTap

Hello!
You can folow the guide for reciving the token on backend. In short you need to do this:

Set up OneTap
Pass codeChallenge to authParams
Override onAuthCode method
After receving auth code and deviceId send them to backend
Exchange code and deviceid for access token


Only throw an error in the default VirtualDevice callback if an error has been provided.  Fixes #240.

See #240.

That will do it. +1


GradleBuildInfoExtractor triggers deprecation warnings when using Gradle 5 with --parallel

#255

@yahavi - I reverted the code of this PR with this commit - https://github.com/jfrog/build-info/commit/68a5dc9d7f5b823077a51025dba198579176eee0 because this code seems to be creating an issue, following https://github.com/jfrog/build-info/pull/261


Pin Dependencies

Striving for more reproducible builds with less pain, this PR tackles the problem of different dependency versions for the different packages we build ourselves. I'm using build variants here to specify dependency versions. In short, one has to supply a yaml file, like in this case ilastik-pins.yaml (in the conda-build lingo it is the conda-build-config.yaml or CBC.yaml). Of course it serves more than the purpose of pinning, but here I only one feature for this PR: In the file specifying key (e.g. package name) value (version) pairs. This kind of superseeds the old --numpy=.. and --python=.. arguments to conda-build.
All keys specified in the variant file, can be used in the recipes. Conda build has to be invoked with conda-build -m <variant_file.yaml> ... in order to take those into account. I made the necessary changes to build-recipes.py.
You can see example recipes in https://github.com/k-dominik/ilastik-build-conda/tree/pin-dependencies
If we decide that this is the way to go, we'd have to specify the variables in all the other recipes we build as well.
I just wanted to have you guys' opinions @stuarteberg and @FynnBe

As I went over all other packages we build, I stumbled over some python-only packages that will also have the {{CONDA_PY}} in the version string. Was this done for the sake of consistency with other package names, or is the a different reason I don't see?

Perhaps I'm misunderstanding the question.  You're wondering if the {{CONDA_PY}} part can be left out entirely?  Somehow the package name for different versions of python must be distinguished.  Otherwise publishing a package built for e.g. Python 3.7 would overwrite the version built for Python 3.6.  Older versions of conda-build used the convention 0_py36.  The newer convention uses a hash (which depends on more than just the Python version).  I guess I don't have a strong preference for which convention we use.  If you leave the build string empty entirely, I think conda-build will choose a suitable default.  (It probably won't include the git commit, though, and that can be convenient for forensic analysis sometimes.)
(Packages built for different versions of Python are not interchangeable, even if they are pure-python, because their files are installed to different directories, and also because they are often pre-compiled (via compileall) and .pyc files are not necessarily compatible between versions).

Thank you for the clarification @stuarteberg, I wasn't aware that python only packages would be really built. From what I read I thought that something like ilastik-feature-selection in essence a noarch: python package which would not need any python build string attached to it? (because installation is basically just placing the files into site-packages...)
Having the commit hash in the build string is indeed convenient, since we often build 'non-releases'...

in essence a noarch: python package which would not need any python build string attached to it?

OK, after consulting the conda docs again, and inspecting the .../info/files for a few noarch: python packages, I think you're correct about the meaning of noarch: python.  Unless I'm missing something, that means that those packages can't be pre-compiled, since .pyc files are not necessarily portable across python versions.  But that's not a big deal, I guess.
My reasoning would apply to noarch: generic packages, but I don't think we use that anywhere.

Thanks.
So after building ilastik for Linux and Mac with this I consider this a working solution. The question to you @stuarteberg, would be whether you want to use the conda_build_config.py style of pinning for the flyem recipes as well, or not.
In any case I could then

make build-recipes.py support both styles. I think if I add a cbc.yaml to all our (ilastik) recipes next to the meta.yaml it will still work without providing pinnings yourself. Or,
I could also open PRs for all your recipes, altering the meta.yamls to use the new style of pinning and add a flyem-pins.yaml to this repo.

Or are you not sold to the concept at all, yet?

I'm sold!

make build-recipes.py support both styles.

Don't worry about supporting both styles on my account.  Just support the preferred style.

I could also open PRs for all your recipes,

Don't worry about that; I'll update them myself.  Just go ahead and merge this branch, and I'll mimic your changes in the flyem recipes when I'm ready.

thx, playing around with this, a new problem came to surface, that you have pointed out in on of your previous messages:

Somehow the package name for different versions of python must be distinguished. Otherwise publishing a package built for e.g. Python 3.7 would overwrite the version built for Python 3.6. Older versions of conda-build used the convention 0_py36. The newer convention uses a hash (which depends on more than just the Python version).

let's say I update a random dependency via the ilastik-pins.py, with the exception of numpy or python itself, this will not be picked up by conda-build, so in fact, the package will not be rebuild. After digging a bit through the conda-build docs and repo, I don't see a way of achieving rebuilds upon dependency change if we keep the current custom build string.

Yeah, that's why the default build string provided by conda-build now uses a hash, which it computes from the contents of the requirements (and other stuff).
I guess our options are:

Remove our custom build string and let conda-build pick a default

OR

Use a custom string that incorporates {{PKG_HASH}}, maybe something like this:
{{PKG_BUILDNUM}}_h{{PKG_HASH}}_g{{GIT_FULL_HASH[:7]}}

For my own packages, I'll probably try the custom string, but I do not have a strong opinion for the packages that we share.  (The conda-build developers recommend against customizing the build string, because people can screw it up if they don't know what we're doing.  But I like to live dangerously.)

Aight, we'll ride the dangerous trail with you ;) while being a bit redundant I fixed build strings to

py{{CONDA_PY}}np{{CONDA_NPY}}_{{PKG_BUILDNUM}}_h{{PKG_HASH}}_g{{GIT_FULL_HASH[:7]}}


Modify rule to prevent automount of system-related filesystems on usb…

… storage.

Thanks for the quick merge Jens!


RegisterChangeCallback fires only once

From @RoboBurned on September 4, 2016 8:37
I am writing a handler to reconfigure logger on configuration file changes.
I get a reload token and subscribes to the changes. On every change I re-register the handler.
But when I change appsettings.json file in file editor I get only one change event.
public Startup(IHostingEnvironment env)
{
	var builder = new ConfigurationBuilder()
		.SetBasePath(env.ContentRootPath)
		.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
		.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
	Configuration = builder.Build();
	var token = Configuration.GetReloadToken();
	Console.WriteLine("Registering for token {0}", token.GetHashCode());
	token.RegisterChangeCallback(WriteToConsole, token);
}
private void WriteToConsole(object state)
{
	Console.WriteLine("ChangeCallback raised for token {0}", state.GetHashCode());
	var token = Configuration.GetReloadToken();
	Console.WriteLine("Registering for token {0}", token.GetHashCode());
	token.RegisterChangeCallback(WriteToConsole, token);
}

Output:
Registering for token 7563067
#here I change appsettings.json file
ChangeCallback raised for token 7563067
Registering for token 55993668
# here I am changing the file again and again and nothing happens.

Copied from original issue: aspnet/Logging#487

From @pranavkm on September 4, 2016 21:27
You have to re-register the token as part of the callback. See https://github.com/aspnet/Logging/blob/a63a9d05c1938e50f376e316f47c2a44f6c9851f/src/Microsoft.Extensions.Logging.Console/ConsoleLoggerProvider.cs#L58-L62

From @RoboBurned on September 5, 2016 6:4
@pranavkm Hi, Yes, I already found that the token can be used only once. However in callback (WriteToConsole) I get a new token and re-register the callback (see code)

From @RoboBurned on September 7, 2016 7:59
@muratg Agree. It was my mistake to post it here. I was working on logger when encountered this issue and was looking at how Console logger handles this.
Should I close this issue and create another in aspnet/Configuration or it is possible to move it there?

From @pranavkm on September 6, 2016 16:20
Oops, missed that bit. This does look ok at first glance.

@RoboBurned Shouldn't this bug be filed in aspnet/Configuration repo? Does it have anything to do with Logging?

@RoboBurned can you try using OnChange() as described at https://github.com/aspnet/Configuration/issues/432#issuecomment-221704063?

@divega I have tried the approach from comment. Results are the same. Sometimes it works fine 2 or 3 times i.e. I change file and save and hit the breakpoint set in callback. But then it stops. Sometimes I get two fires after single file change.

This is likely a dupe of https://github.com/aspnet/Configuration/issues/486


Crash ! why ?

The issue here is that you have two placeholders (%@) in your format string, but only one argument in the list.
In the stack trace you should see where this call is coming from and there you need to either pass another argument, or remove one %@ from your format string.

sorry, I'm not familiar with "va_list" ,how did you know there was only one argument in the list ? I didn't recognized it, can you figure it out  for me ?

@Goallying Ah, sorry - missed the type in the debug output. Yea, va_lists are quite terrible to debug. Either way, the issue is still somewhere within the format string / arguments.
To proof that, try the following in the place where you call DDLogInfo today:
NSString *message = [[NSString alloc] initWithFormat: @"蓝牙框架 - 数据解析 %@ 开始分发 当前分发队列 %@", cmdStr, self.writeServiceCallBackList];
DDLogInfo(@"%@", message);

If it crashes in the line where you create message, it's unrelated to CocoaLumberjack...
Also, if you step over the crash, you should get some information from the exception that is thrown.


create start contributing guide

Description
This is an updated guide that is ideal for all beginners.
It contains all the information beginners need.
I'm waiting for feedback :)
Issues Resolved
#6845
Check List

[ ] New functionality includes testing.

[ ] All tests pass

[ ] New functionality has been documented.

[ ] New functionality has javadoc added

[x] Commits are signed per the DCO using --signoff
[ ] Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

I would like to add this guide to all repositories changing the context
What do you think about it?

@Nicksqain we already have a contributing guide (CONTRIBUTING.md, along with DEVELOPER_GUIDE.md), I don't think we need yet another one, may be filling the gaps in the existing ones would be helpful.

@reta I myself have recently started contributing to opensearch project repositories. And when I started it was difficult for me to search for information. As a member of the CCI programme I would like to see the guide do just that. From less to more :)

And when I started it was difficult for me to search for information.

That would not make it easier - we would end up with 3 places having more or less the same information. We better should provide clear pointers where the required information lives. With that being said, OpenSearch landing page has the link to contribution guide right at the beginning:

have you found it difficult to find the contribution guidelines?
have you found it difficult to follow the contribution guidelines?
have you found it difficult to configure your development environment?
have you found missing links which prevented you to prepare everything  you needed to start contributing?

@reta
The entire guide was compiled from the responses of programme participants who were never able to make their first pull request. The problem was that they found it difficult to understand the guide itself. There is a lot of information and it all needs to be processed

@Nicksqain Thanks for getting involved in the project! I do agree with @reta here that the existing guides seem like the right place for this content.
We also have a readme at the main landing page that links to an ONBOARDING guide. I would suggest going through those as well and look at adding/improving the content there.

@owaiskazi19 @kotwanikunal @Poojita-Raj @Rishikesh1159 one of the CCI contributors went an extra mile to collect and compile all of the obstacles raised by the new contributors. He then went ahead and created comprehensive material that would make it easier for new contributors to get started. Let's take a closer look at what @Nicksqain has put together and incorporate it in either the Contributing or Developer guides.
What is the specific feedback for @Nicksqain ?

I agree with @reta that creating another guide called STARTING would not be the ideal solution in this case since we do clearly provide a contributing and developer guide.
That being said, since you have shared that it is the experience of multiple contributors that they're hard to understand, it would be a good idea to go through the content of this starting guide and incorporate it into the existing guides to make them more user-friendly to beginners.

I'll pile on with this recommendation.  I think documenting these experiences and obstacles is great, but I'm not sure another .md file is the best place.  This seems like something which could be written up as a blog post or forum post, however.

+1 to @reta and @Poojita-Raj. @Nicksqain thanks for bringing this up. Looking at the changes looks like the changes would fit in CONTRIBUTING.md. Let's add the changes there and we can review the new PR.

@owaiskazi19
Thank you all for the answer! I'll take all the comments into account. I think it's necessary to make a topic on the forum on this file. And for contributing.md I will extract all the most important and update it. Then I think it's worth changing the issue and continuing to work on changing the current guide.
After I change contributing.md and will you accept the changes I will need to make pull requests to all repositories with this file?


init migrate to next

Contains basic code to migrate to next.
Pushing PR to allow others to contribute.
TODO: Fix every page (migrate to css in js)

resolves #38


Updated README Instructions' return statements

When I was using it via self-hosted coolify, I wasn't able to render the image, after re-reading instructions and some searches I found out that the example had "images/" between the two variables. After trying it out, the image got rendered. Hopefully it helps :)

Very useful fix, it needs to be merged !

Pushing this up

It is already merged in another PR, but thanks for this. :)


Upgrade robolectric dependency

Update to Robolectric and take opportunity to use more public API.

This is disappointing
The :okhttp:animalsnifferMain task failed.View task in console log
Failed to check signatures
>  failed to process jar /Users/yschimke/.gradle/caches/modules-2/files-2.1/org.robolectric/android-all/10-robolectric-5803371/873cbe64a7ac6fc2f9f5e2f6a24967fcc7a28ff8/android-all-10-robolectric-5803371.jar : Bad class file /Users/yschimke/.gradle/caches/modules-2/files-2.1/org.robolectric/android-all/10-robolectric-5803371/873cbe64a7ac6fc2f9f5e2f6a24967fcc7a28ff8/android-all-10-robolectric-5803371.jar:libcore/io/Os.class
  > Bad class file /Users/yschimke/.gradle/caches/modules-2/files-2.1/org.robolectric/android-all/10-robolectric-5803371/873cbe64a7ac6fc2f9f5e2f6a24967fcc7a28ff8/android-all-10-robolectric-5803371.jar:libcore/io/Os.class
    > (No message provided)

No wonder this was familiar...
https://github.com/square/okhttp/pull/5525

And https://github.com/xvik/gradle-animalsniffer-plugin/issues/8

Blocked on https://github.com/xvik/gradle-animalsniffer-plugin/issues/8

@swankjesse @JakeWharton This may never progress
https://github.com/mojohaus/animal-sniffer

MojoHaus AnimalSniffer Maven Plugin
This is the animal-sniffer-maven-plugin.
Please note this plugin is now in maintenance level as the exact same feature can be now easily achieved using the --release flag from Javac see (http://openjdk.java.net/jeps/247)

And there just isn't any movement on the github issues in months, so I believe them.

A little bit of movement here, no release yet https://github.com/mojohaus/animal-sniffer/commit/71db56b1d247e0446e75e40628d8943297ab00ea


cicd: add healthcheck to cli

Codecov Report
Attention: 41 lines in your changes are missing coverage. Please review.

Comparison is base (086da74) 26.14% compared to head (9702bc5) 26.00%.
Report is 1 commits behind head on develop.

Files
Patch %
Lines

golang/pkg/cli/container_defaults.go
0.00%
41 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #885      +/-   ##
===========================================
- Coverage    26.14%   26.00%   -0.14%
===========================================
  Files           70       70
  Lines         7440     7480      +40
===========================================
  Hits          1945     1945
- Misses        5341     5381      +40
  Partials       154      154

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Resolve: "RS232 Serial Input"

Closes #71

Ready for another review.

Ready for re-re-review

At this point it would probably be best for you to finish the changes since you have a better sense of what an API should look like than I do.


Cardholder name limit should be increased

https://github.com/Adyen/adyen-salesforce-commerce-cloud/blob/457286dc26ce82748ba342f1edd3bd495e818a91/cartridges/int_adyen_SFRA/cartridge/forms/default/creditCard.xml#L21
The field seems to be too short. The WSDL reference a maxlength of 50 and the API references a maxlength of 80.

Side note: it's not a mandatory field


ReferenceError: AzureKeyCredential is not defined

I'm using the sample at https://github.com/Azure/azure-sdk-for-js/blob/%40azure/openai_1.0.0-beta.2/sdk/openai/openai/samples/v1-beta/javascript/chatCompletions.js#L16
and I'm always getting a ReferenceError: AzureKeyCredential is not defined  I have it from my azure account but not sure why I'm always getting this.  Is there somewhere I can look to figure out what the issue is?

@phusting can you provide some details about what environment you're running this in, such as what Node version, etc. If you're seeing AzureKeyCredential not being defined I imagine it's some issue with the require statement since it appears the package is exporting the credential correctly.

Node 8.19.3
I'm using Visual Studio 2022 and building a Word Web Add-in.

const { OpenAIClient } = require("@azure/openai");

const endpoint = process.env["ENDPOINT"] || "https://myinstancecantshow-azureopenai.openai.azure.com/";
const azureApiKey = process.env["AZURE_API_KEY"] || "mykeycantshow";

const messages = [
            { role: "system", content: "You are a helpful assistant. You will talk like a pirate." },
            { role: "user", content: "Can you help me?" },
            { role: "assistant", content: "Arrrr! Of course, me hearty! What can I do for ye?" },
            { role: "user", content: "What's the best way to train a parrot?" },
];

                // ** AZURE EXAMPLE
                console.log("== Chat Completions Sample ==");

                const client = new OpenAIClient(endpoint, new AzureKeyCredential(azureApiKey));
                const deploymentId = "gpt-35-turbo";
                const result = await client.getChatCompletions(deploymentId, messages);

                for (const choice of result.choices) {
                    console.log(choice.message);
                }
            } catch (error) {
                document.getElementById("txterror").innerText = error;
            }

@phusting Node 8 has been out of support since the end of 2019. Our minimum supported Node version at this time is Node 14.
I'm not familiar with Word Web Add-ins, but I imagine you'll have to bundle similarly to the browser, since presumably the Add-In is running inside of a browser context?

Sorry, it is Node v18.13.   I typed the wrong command.
Yes, it is running in a Chromium instance.
Going directly to OpenAI API is just fine.   I am setting the azureai key, but it fails right away.

Seems like a Office web add-in thing.   I'm actually further and it is sending the request, now troubleshooting the response.  :)   Almost there!

Almost, but this I have no clue.  Any suggestions?  I'm getting a 404 error.
`fetchHttpClient.js:67
    POST https://ghostwriterai-azureopenai.openai.azure.com/openai/deployments/text-davinci-003/completions?api-version=2023-03-15-preview 404`

Closing, I got it to work in Office now.


router rewrite (again)

As mentioned on discord, I rewrote my other router rewrite (#522).
Comparison to the current router

completely new API, relying on rust instead of rsx!
over 130 tests
about 50 doc tests (in addition to the 130 above)
nested routes
parameter routes (with a filtering variant)
named navigation
SSR & sitemap generation support

Comparison to #522

the routing core is no longer dependant on dioxus and could be used for other UI crates
things that were previously identified by a &'static str now use TypeId
named targets are constructed via a function instead of From impls

Tracking

[x] routing core
[x] dioxus integration
This should be fairly easy, I just need to figure out the things that changed in dioxus since #522. Most of the logic is in the core already.
[x] web history integration
I'll rewrite what's in #522, but the logic is already there.
[x] documentation
This'll take a bit longer, but I should be able to reuse most of the work I did for #522.
[x] examples
By this I mean updating the examples outside the router that rely on it.

Dioxus integration

I plan to keep the dioxus components and hooks mostly as they were in #522.
I was told that the Component definition in dioxus would go away. This means the as Component thing wont be possible any more. Since there still needs to be a conversion from the fns strange type, I plan to add a comp() function to do this.
I have thought about replacing the Router component with a use_router hook. I'm not entirely sure whether that is a good idea though. Pro: it would be obvious that the router won't react to changing props. Con: It is a bit less obvious what is inside the router and what isn't.

This should now be on par with #522 feature-wise. However, due to the bug I reported in #653, I haven't been able to test if it actually works.
Next steps are:

Add documentation comments and eventually add #![forbid(missing_docs)] (already done in the core).
Write some tests to see if the dioxus parts actually work
Maybe add a few examples

After that I'll continue on to the third and forth points I listed in the PR description

I implemented scroll restoration and was able to avoid the bug I mentioned above.
I also made it optional. However, because of that the router can no longer default to WebHistory, even when the web feature is enabled. This is because of side effects, specifically setting history.scrollRestoration = "manual".
If this is a problem, I think it should be possible to find a solution. However, for now I'll mark the browser history integration as done and continue on to the documentation and examples.

This is ready for review now.
I now about one issue I've already written about on discord. It should be solved before merging, either on master or in this PR. I'd also like to test the examples manually once that is done.

I just fixed the CI by reading the web_router.rs. I just copied it from before my first change and updated it. I don't know how the test actually works.

I think the failed checks aren't a result of this PR, but came from master.

Yeah, I wanted to fix the bug but there were too many tests to alter. Will circle around on that

One other thing that should be considered before merging:
Several hooks and components need access to the routers current state. For that reason, they all share an async_rwlock::RwLock. However, this only has an asynchronous read function, so currently the code busy waits using the synchronous try_read function.
This is obviously not ideal, but I don't know if the other options are better:

It could be with std::sync::RwLock, which wouldn't busy wait (I assume), but also has no async access, which the router uses in the task the router spawns by default.
An alternative to async-rwlock could be used, that provides async and sync read functions. The only such crate I could find is tokio, which IIRC is not used by dioxus-web.
I believe you added support for async components to dioxus. Should I convert the components to async, or would that hurt usability/limit them to specific targets/…? Also, should I convert the hooks to be async?

@jkelleyrtp any chance this will get merged?

Several hooks and components need access to the routers current state. For that reason, they all share > an async_rwlock::RwLock. However, this only has an asynchronous read function, so currently the code busy waits using the synchronous try_read function.
This is obviously not ideal, but I don't know if the other options are better:
It could be with std::sync::RwLock, which wouldn't busy wait (I assume), but also has no async access, which the router uses in the task the router spawns by default.
An alternative to async-rwlock could be used, that provides async and sync read functions. The only such crate I could find is tokio, which IIRC is not used by dioxus-web.

It looks like async_lock has a similar RwLock that has a blocking variant which could be used here.

I believe you added support for async components to dioxus. Should I convert the components to async, or would that hurt usability/limit them to specific targets/…? Also, should I convert the hooks to be async?

Because the RwLock shouldn't block for very long, I don't think we should use async variants here. Async hooks would force the users component to be async. I think async components also have a small overhead because they first load in a placeholder and then load the final component (also not sure about SSR compatablility).


Pager is not responsive and will overflow if table width is too small -- make pager maxSize customizable

[* ] feature request

Current behavior
If the table is too small (on mobile devices, this is the case) and five pages are listed in the pager, the pager will overflow to a new line.

Expected behavior
The pager should adjust the maxSize if there is not enough space.
Reproduction of the problem
Decrease your browser width or test on a mobile device.
What is the motivation / use case for changing the behavior?
Responsive design.

Table version: ^1.3.1

Angular version: ^2.1.2

Browser: all

Language: Typescript 2

Easiest solution I can think of is allowing the maxSize to be passed in as an input, I could implement this myself and make a pull request.  Have there been any other thoughts on adding responsive functionality?

Have the same problem, i think you don't need the numbers in the pagination on mobil devices. I will hide them. What do you think?
Did you see, i added the smooth scrolling on the table, so it feels more natural on iDevices...
Other question: do have the problem with the row width on mobil? i have 3 columns in flex mode and i get some space after the last column, and a scrollbar at the bottom:-(

I have the same problem, how to fix it ?

How can I fix this problem ?

Here's the SCSS I have to override this:
// fix pager so that it doesn't wrap and uses available space
.ngx-datatable {
  .datatable-footer-inner {
    display: flex;
    flex-flow: row nowrap;  // can't wrap because footer height fixed
    justify-content: space-between;  // probably not needed because .page-count flex grows
    > .page-count {
      // remove padding so there's more room in-between
      padding-right: 0 !important;
    }
    > .datatable-pager {
      margin: 0 !important;
      // don't grow, otherwise pager won't be right-aligned
      flex: 0 0 auto !important;
      > .pager {
        // prevent numbers from wrapping
        display: flex !important;
        flex-flow: row nowrap;
      }
    }
  }
}

The other advantage of this is that the pager grows to the left instead of changing the width of the table. With this CSS, the left text will be covered by the pager when too narrow. Not sure what the best solution is. At the moment, wrapping the count and pager won't work.

Here's the SCSS I have to override this:
// fix pager so that it doesn't wrap and uses available space
.ngx-datatable {
  .datatable-footer-inner {
    display: flex;
    flex-flow: row nowrap;  // can't wrap because footer height fixed
    justify-content: space-between;  // probably not needed because .page-count flex grows
    > .page-count {
      // remove padding so there's more room in-between
      padding-right: 0 !important;
    }
    > .datatable-pager {
      margin: 0 !important;
      // don't grow, otherwise pager won't be right-aligned
      flex: 0 0 auto !important;
      > .pager {
        // prevent numbers from wrapping
        display: flex !important;
        flex-flow: row nowrap;
      }
    }
  }
}

The other advantage of this is that the pager grows to the left instead of changing the width of the table. With this CSS, the left text will be covered by the pager when too narrow. Not sure what the best solution is. At the moment, wrapping the count and pager won't work.

I think, total row count should be on first line, and center pager. In that way pager fits mobile size and no need to scroll