[question] enums

how do i do this?
---@class Realm
local Realm = {
	Realm_Client = 0,
	Realm_Server = 1,
	Realm_ClientAndServer = 2,
	Realm_None = 3,
	Realm_Pipeline = 4,
}

---@param p_Realm Realm?
function Test(p_Realm)
	p_Realm = Realm.Realm_Client
end

This is happening because you're assigning a parameter — that you defined as Realm type — to a field of Realm that's an integer. Not sure what the purpose of this is, but you can set the type of p_Realm as Realm|integer? to specify Realm or integer as the types. This may be what you want, since Realm_Client looks like a normal integer.

I could do this:
---@param p_Realm `Realm.Realm_Client` | `Realm.Realm_Server` | `Realm.Realm_ClientAndServer` | `Realm.Realm_None` | `Realm.Realm_Pipeline`

but thats not really a solution

Enums are most easily annotated as @alias types. The OpenResty annotations in the repo have a good example:
https://github.com/sumneko/lua-language-server/blob/befc89c83b248aa4dbfd3bac8e744ca9969b1208/meta/3rd/OpenResty/library/ngx.lua#L39-L70
This makes it possible to write functions that take ngx.http.method as a param type:
https://github.com/sumneko/lua-language-server/blob/befc89c83b248aa4dbfd3bac8e744ca9969b1208/meta/3rd/OpenResty/library/ngx.lua#L2258-L2263
If that doesn't work you may need to explain a bit more about what you are trying to accomplish with this Test function.

would be nice if we could use sth like ---@enum Realm instead of ---@class Realm

You can make that an alias and use the alias as the param type
On Wed, Jun 29, 2022, 4:43 PM FlashHit @.***> wrote:

[image: grafik]
https://user-images.githubusercontent.com/56718716/176540941-598e337b-1407-4c7e-b2d1-b68d53fa2f95.png
well this doesn't look nice. it not optimal imo
—
Reply to this email directly, view it on GitHub
https://github.com/sumneko/lua-language-server/issues/1255#issuecomment-1170475431,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADKTFYG6IMPCTHZC2PDB5CDVRSYQ3ANCNFSM52G4G34Q
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

You can make that an alias and use the alias as the param type

thats what I did

---@enum Realm --> Equivalent to ---@alias Realm Realm.Realm_Client|Realm.Realm_Server|...
local Realm = {
	Realm_Client = 0, --> type: Realm.Realm_Client
	Realm_Server = 1, --> type: Realm.Realm_Server
	Realm_ClientAndServer = 2,
	Realm_None = 3,
	Realm_Pipeline = 4,
}

---@param p_Realm Realm?
function Test(p_Realm)
	p_Realm = Realm.Realm_Client
end

proposal of ---@enum

Yes please 👍

please add this to the next milestone :)

When this is ready for testing feel free to @ me and I can work on adding a description for it like I did back in https://github.com/sumneko/lua-language-server/commit/e2b791ea5ccc2438fa10c4874f8c8ab9d7829335


Disable all sorting algorithms button once some algorithm is selected.

Disable all sort algorithms button once some algorithm is selected.

@shivam7374 assign it to me.

@shivam7374 check once, i have created a PR

@WaniAthar also disable the generate array buttons when the sorting has started.

ok

@shivam7374 please check once, i have disabled for generate buttons also


fixed broken splunk UF download url

the used URL to download the MSI for splunk UF was decomissioned:

This URL has been decommissioned, Please get the updated wget URL from www.splunk.com

added new working URL

@7a6570 I'm not sure what happened exactly but your PR isn't actually changing any code, so I can't merge it.

This was fixed here: https://github.com/clong/DetectionLab/pull/721
Just tested and seems to be working fine


[Nox.DataProvider] Build Entity Relation ZeroToOne or ExactlyOne

This issue should be done after https://github.com/NoxOrg/Nox.Generator/issues/171

This issue should be done after https://github.com/NoxOrg/Nox.Generator/issues/171
This issue should be done before This issue should be done after https://github.com/NoxOrg/Nox.Generator/issues/171
The generated POCO for an Entity needs to have an [ForeignEntityName]Id property to hold the foreign key of the relation.
POCO Example:
` public class Country
{
public string Id { get; set; } = null!;
    public string Name { get; set; } = null!;

    public List<Currency> Currencies { get; set; } = null!;

    public Capital CountryCapital { get; set; } = null!;

}

public class Capital
{
    public string Id { get; set; } = null!;
    public string CountryId { get; set; } = null!;
    public string Name { get; set; } = null!;
    public virtual Country CapitalCountry { get; set; } = null!;
}`

The CountryId needs to be created on the Capital that will hold the foreign key, after this the database provider will configure the relation in this way (this is not to be done in the scope of this ticket):
` var countryEntityBuilder = modelBuilder.Entity();
countryEntityBuilder
    .HasOne(p => p.CountryCapital)
    .WithOne(p => p.CapitalCountry)
    .HasForeignKey<Capital>(p => p.CountryId);

`
see one to one relation setup
Rules:
following the rules:

ZeroOrOne<=> ZeroOrOne: No particular rule the database relation will be created on the entity with the name in the Highest Ascending Position by sorting the name => Ensuring that if the user swaps Entities from position in the yaml the model build will be built in the same way
ExactlyOne<=> ExactlyOne: same as ZeroOrOne<=> ZeroOrOne
ExactlyOne<=> ZeroOrOne: create the [ForeignEntityName]Id on the entity that hold the ExactlyOne relation
ZeroOrOne<=> ExactlyOne: Do not generated any code, covered by previous rule


perlPackages.MojoliciousPluginAssetPack: init at 2.08

This adds the Mojolicious::Plugin::AssetPack perl module.
JavaScriptMinifierXS, CSSMinifierXS are not strictly dependencies, but the module is not particularly useful without them.
Things done

[X] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[X] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[X] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[X] Fits CONTRIBUTING.md.

@GrahamcOfBorg build perlPackages.CSSSass perlPackages.MojoliciousPluginAssetPack
@GrahamcOfBorg build perldevelPackages.CSSSass perldevelPackages.MojoliciousPluginAssetPack

Darwin fails, I'll update with a fix

Dropped the CSS::Sass dependency as it needs some work on darwin.

@GrahamcOfBorg build perlPackages.MojoliciousPluginAssetPack perldevelPackages.MojoliciousPluginAssetPack

CSS::Minifier::XS and JavaScript::Minifier::XS fails on darwin as well, I'll set up a separate PR that fixes those.


Documentation

From my understanding, this package uses the Tracking HTTP API.
On some methods it was not clear to me what the parameters actually mean so I got through the code and tried to find out to which parameter of the dart API matches what parameter of the tracking API and just add these correspondences to the documentation.
I also fixed a mistake where it currently states that
https://github.com/Floating-Dartists/matomo-tracker/blob/2dbf25209c995762daf6461cbcfa5ca0952798ef/lib/src/matomo.dart#L111
where it should be visitorId instead.
Also, I wonder why int and not num is used for eventValue in trackEvent
https://github.com/Floating-Dartists/matomo-tracker/blob/2dbf25209c995762daf6461cbcfa5ca0952798ef/lib/src/matomo.dart#L395
because the tracking API states that it can be an int or float, but this should maybe be discussed in a separate issue.
I tried to not write code and just write documentation because I'm still not able to write tests (see #59...) but I could not resist to add some checks to the trackDimensions method 😅.
Moreover I think the concept of _id (which is visitorId), cid (which is forcedId) and uid (which is userId) is a bit confusing... I'd love to add some more explanations on that, but haven't understood it fully yet myself... For example, why can visitorId be set in initialization but not userId? What is the puropse of forceId if the user can not set it? Or can he actually set it somehow and I'm missing something?
Also I've not updated CHANGELOG.md and the pubspec.yaml yet because I belive there might be some discussions about these changes 😄.

About the unclear naming conventions for _id, cid and uid it is mostly legacy code from the original package that we've forked a while ago. I don't mind changing those names but as this might lead to breaking changes in the public API it should probably be done by first keeping and deprecating the old getters. 🤔
About the userId which is not set in the initialize method, it is also because of the initial forked code, it can probably be improved but there might be side effects with such a modification. For now, we, the maintainers, decided that it was not a priority to change this behavior as you can chain with a call to setVisitorUserId after the initialization.

(cc @Pierre-Monier do you think you can double check before I merge this)

Yes, I think I'll have to look into units test, since I might need to implement campaigns for our usage in our next project...
About the id thing: I want to highlight that if I'm not mistaken, forceId is unnecessary, since the user can never set it at it will always be null. It is part of the Visitor class which belongs to the non-public API. This class is instantiated at two different places.
The first place is
https://github.com/Floating-Dartists/matomo-tracker/blob/2dbf25209c995762daf6461cbcfa5ca0952798ef/lib/src/matomo.dart#L160-L161
where forceId is not set at all, meaning that it is null.
The second place is
https://github.com/Floating-Dartists/matomo-tracker/blob/2dbf25209c995762daf6461cbcfa5ca0952798ef/lib/src/matomo.dart#L48-L56
where the forceId is simply keept from the previous instance, which at this point has to be null.


Flink Engine GetInfo support CLI_ODBC_KEYWORDS

:mag: Description
Issue References 🔗

This PR aims to support CLI_ODBC_KEYWORDS on flink engine to avoid https://github.com/apache/kyuubi/issues/2637
Describe Your Solution 🔧
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Types of changes :bookmark:

[x] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪
Behavior Without This Pull Request :coffin:
Behavior With This Pull Request :tada:
Related Unit Tests
Adjusted existing test #org.apache.kyuubi.it.flink.operation.FlinkOperationSuite

Checklists
📝 Author Self Checklist

[x] My code follows the style guidelines of this project
[x] I have performed a self-review
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] This patch was not authored or co-authored using Generative Tooling

📝 Committer Pre-Merge Checklist

[x] Pull request title is okay.
[x] No license issues.
[ ] Milestone correctly set?
[ ] Test coverage is ok
[ ] Assignees are selected.
[ ] Minimum number of approvals
[ ] No changes are requested

Be nice. Be informative.

Thanks, merged to master/1.8, also cc @YesOrNo828


What does the dimensions of the state returned by the environment mean? What are the corresponding parameters in the paper?

state[0, -1] correspond the Xt( the network throughput measurements for the past k video chunks) in paper?

Please refer to the original paper and its repo
https://github.com/hongzimao/pensieve


shim: support errorType and stackTrace

Required for StepFunctions support
https://github.com/apex/apex/issues/698

ping


User Answer is wrong but System is Right

Challenge http://freecodecamp.com/challenges/waypoint-create-a-set-of-radio-buttons has an issue. Please describe how to reproduce it, and include links to screenshots if possible.
on of the label buttons name is indoor-outdoor,then system analysis syntax is right.However,another name is wrong.

Dear camper, your issue is related to these ones:
https://github.com/FreeCodeCamp/FreeCodeCamp/issues/1390
https://github.com/FreeCodeCamp/FreeCodeCamp/issues/1307
https://github.com/FreeCodeCamp/FreeCodeCamp/issues/1017
Please see Help I've Found a Bug.


fix two broken links and update troubleshooting webhooks

1. Issue, if available:
N/A
2. Description of changes:

Fix two broken links in previous website versions that shows up on the 404 checker when releasing. These sections should have been removed in those version since the dashboards are imported automatically beginning at v0.5.6.
Fix troubleshooting webhooks section which is out-dated since the webhook and controller are now in the same pod.
Fix inconsistent casing on the Getting Started landing page. All other links have "Started" capitalized except "Getting started with eksctl"

3. How was this change tested?

make website

4. Does this change impact docs?

[x] Yes, PR includes docs updates
[ ] Yes, issue opened: link to issue
[ ] No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

lgtm


analyze_json.py - error

Hi,
Could you please to fix this issue?
python3 analyze_json.py<PHONE_NUMBER>.json
Traceback (most recent call last):
  File "analyze_json.py", line 127, in <module>
    data = json.loads(fh.read())
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Hi,
Thank you for your help, attached the json file.
1534402953.zip

Hi,
Is there any update?

Did you try to analyse the<PHONE_NUMBER>.json? Your two JSON files are not the same, so the error is not directly reproducable. I still think your first mentioned file was simply empty, because of a script restart or similar. The collector has a delay in which it has to receive flows from the source. Until then, nothing is written into the JSON file.
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) is an error occuring if an empty file is passed into JSON.decode.

Hi,
There are some error again,
/opt/python-netflow-v9-softflowd# python3 main.py -p 9009 -D
Listening on interface :9009
Starting the NetFlow listener
Received data from <IP_ADDRESS>, length 1392
Exception happened during processing of request from ('<IP_ADDRESS>', 3464)
Traceback (most recent call last):
File "/usr/lib/python3.5/socketserver.py", line 313, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 341, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.5/socketserver.py", line 681, in init
self.handle()
File "main.py", line 72, in handle
export = ExportPacket(data, self.TEMPLATES)
File "/usr/local/lib/python3.5/dist-packages/netflow_v9-0.6.1-py3.5.egg/netflow/collector_v9.py", line 316, in init
dfs = DataFlowSet(data[offset:], self.templates)
File "/usr/local/lib/python3.5/dist-packages/netflow_v9-0.6.1-py3.5.egg/netflow/collector_v9.py", line 184, in init
template = templates[self.template_id]
KeyError: 260

The souce of error template = templates[self.template_id] -> KeyError: 260 comes from unknown templates. See #4 for more details. Hope to resolve this issue in one of the next updates!


Add Remote Logging configuration UI in the IS Console

Is your suggestion related to an experience ? Please describe.
We need to bring the Remote logging UI configuration of https://github.com/wso2/product-is/issues/16697 to IS Console.

Marking this issue as on-hold since the GET /configs/remote-logging is not implemented yet and it wouldn't be possible to introduce the UI without it as it is required to deliver a better UX.
cc: @madurangasiriwardena @NipuniBhagya

@bhagyasakalanka is currently working on the backend improvements for the GET /configs/remote-logging.

I'm started working on back-end improvements for remote logging feature today.  Following tasks are pending

Store configurations in the database
Write a periodically running thread to update configuration in a clustering environment.
Write a GET API
Improve other API if applicable.

To write the GET API, we need the first task to be completed. Based on that, to deliver the APIs,
Best case: 2nd October (Monday)
Average case: 3rd October (Tuesday)


等效词串都有哪些

Bigram分词中的等效词串
你的文章列举了一些等效词性，请问除了下面这些，还有哪些呢?
未##地, 始##始, 未##它, 未##团, 未##数, 未##专, 未##时, 未##串, 末##末, 未##人
这里的未有什么含义吗？未登录词？这样会不会影响到已经登录的字词呢？
eg:移除每天晚上二十一点的日程
在加入”移除  v 100"后，移和除还是分开的

版本1.3.2，NS分词

START**
打印词图：========按终点打印========
to:  1, from:  0, weight:04.60, word:始##始@移
to:  2, from:  0, weight:04.60, word:始##始@移除
to:  3, from:  1, weight:02.31, word:移@除
to:  4, from:  2, weight:11.25, word:移除@每
to:  4, from:  3, weight:05.70, word:除@每
to:  5, from:  2, weight:11.25, word:移除@未##时
to:  5, from:  3, weight:03.40, word:除@未##时
to:  6, from:  4, weight:10.58, word:每@天
to:  7, from:  5, weight:04.76, word:未##时@晚
to:  7, from:  6, weight:10.04, word:天@晚
to:  8, from:  5, weight:02.52, word:未##时@未##时
to:  8, from:  6, weight:04.07, word:天@未##时
to:  9, from:  7, weight:10.68, word:晚@上
to: 10, from:  8, weight:02.52, word:未##时@未##时
to: 10, from:  9, weight:04.09, word:上@未##时
to: 14, from: 11, weight:05.57, word:未##时@点
to: 15, from: 10, weight:03.04, word:未##时@的
to: 15, from: 12, weight:03.04, word:未##时@的
to: 15, from: 13, weight:03.04, word:未##时@的
to: 15, from: 14, weight:02.98, word:点@的
to: 16, from: 15, weight:05.62, word:的@日
to: 17, from: 15, weight:05.67, word:的@日程
to: 18, from: 16, weight:10.10, word:日@程
to: 19, from: 17, weight:03.52, word:日程@末##末
to: 19, from: 18, weight:06.15, word:程@末##末
粗分结果[移/v, 除/p, 每天/t, 晚上/t, 二十一点/t, 的/ude1, 日程/n]

对这个问题来讲，你可以直接删除 移@除 。我实在想不出任何上下文中需要把移除分为移+除的情况，估计是语料问题。比如在98年语料中，根本没有 移@除 这个BiGram。
“未”的确代表未登录词，所有确定为该词性的词语都会被compile为等效词串，以平滑数据稀疏的问题。至于具体都有哪些，请参考 https://github.com/hankcs/HanLP/blob/master/src/main/java/com/hankcs/hanlp/utility/Predefine.java#L92 。
私以为，HanLP虽然写得不够好，但文档写得还算非常全面的

确实很全面，不好意思，代码没有看得很仔细


support multilabel confusion matrix

using sklearn multilabel_confusion_matrix
sample usage:
confusion_metric  = evaluate.load("confusion_matrix", config_name="multilabel")

y_true= np.array([[0, 0, 0, 0, 1], [1, 0, 1, 0, 0], [0, 0, 1, 0, 1], [1, 0, 0, 0, 0]])
y_pred= np.array([[0, 1, 0, 0, 1], [0, 0, 1, 0, 0], [0, 0, 1, 1, 1], [1, 0, 1, 0, 1]])

confusion_metric.compute(references= y_true, predictions= y_pred)

output:
{'confusion_matrix': array([[[2, 0],
         [1, 1]],

        [[3, 1],
         [0, 0]],

        [[1, 1],
         [0, 2]],

        [[3, 1],
         [0, 0]],

        [[1, 1],
         [0, 2]]])}

@lvwerra

There was a problem with file formatting, I reformatted it and comitted the new code

There's an error in tests, I can't understand it, it seems to be unrelated with the code 😅 sorry for inconvenience

Overall LGTM, but I wonder if it should be a separate metric to keep 1:1 mapping to sklearn

I'm not sure 100% what is the optimal way, but I think the main idea behind evaluate is to be an abstraction.
anyway, if you think if it's better to be in a seperate module I can do it.
thank you ☺

@osanseviero will you accept the request? I've done the suggested edites

thanks for rerunning the workflow, but I don't understand what's the problem 😬

I fixed the problem in docstring example that causes unit test failure, can you run the test and merge please? @lvwerra
thank you


Double arrows

Any song with double arrows basically insta kills me, by double I mean 2 arrows at once like right and left at the same time.

already fixed


Support for Lex V2: Chatbots are not available in new console

Before opening, please confirm:

[X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
[X] I have searched for duplicate or closed issues.
[X] I have read the guide for submitting bug reports.
[X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v16.4.0
Amplify CLI Version
5.3.0
What operating system are you using?
Mac
Amplify Categories
interactions
Amplify Commands
add
Describe the bug
Chatbots I have created with amplify are available in the lex console but they are not available in the new lex V2 console.
Expected behavior
Chatbot in lex v1:

Lex v2 (clicked on start building):

Not sure if it is hidden somewhere.
Reproduction steps

amplify add interactions
Add sample chatbot
Go to lex

GraphQL schema(s)
No response
Log output
No response
Additional information
No response

Based on the announcement this is by design by Lex: https://aws.amazon.com/about-aws/whats-new/2021/07/amazon-lex-announces-tooling-to-migrate-bots-from-lex-v1-console-to-lex-v2-console/
Amplify CLI does not support Lex V2 which is a full set of new APIs not just a new Console it seems.
I mark it as a feature request.

Ah, sorry I thought it is just a new console. Thank you!

Support for Lex v2 has been implemented in the interactions category. Please refer to https://docs.amplify.aws/lib/interactions/getting-started/q/platform/js/#lex-v2-bot for additional information.


NEW replace _ss_environment.php with .env and environment vars

This PR replaces our idiosyncratic _ss_environment.php convention with support for first class environment variables with a .env poly-fill for easy testing/development.
I've also removed the dependency on the Host header ($_SERVER['HTTP_HOST']) from the bootstrap so we no longer require $_FILE_TO_URL_MAPPING global for CLI execution. Devs can now set SS_HOST environment variable or Director.alternate_host config var.
Docs and tests have been updated

Brilliant change. I'd suggest creating an env($key, $default = null) function which proxies to the underlying env function, but allows for defaults. Then things like getenv('SS_PROTECTED_ASSETS_PATH') can have sensible defaults (like env('SS_PROTECTED_ASSETS_PATH', 'assets/secure')).

Could we not support both getenv() and defined() vars using a core environment helper?
class Environment {
	public static function get($var) {
		if (defined($var)) return constant($var);
		return getenv($var);
	}
}

This allows certain vars to be fixed (and thus protected from modification). there are security concerns related to allowing core vars to be modified.

@assertchris good idea - I guess I'll just copy laravel ;) - though there is more a favour towards putting these methods into utility classes.
@tractorcow whilst I don't really think there's a significant issue in allowing our pseudo environment vars to be modified I think your suggestion is sound in regards to providing BC support.
One issue there is to address is how we now handle $_FILE_TO_URL_MAPPING - though we could just define a new env var for this?

I think it would be better to resolve .env variables before constants, but good suggestion @tractorcow.

I would prefer to see $_FILE_TO_URL_MAPPING become less important and opt-in, and instead have a better default.

I would prefer to see $_FILE_TO_URL_MAPPING become less important and opt-in, and instead have a better default.

I agree - there's currently the ability to set default baseurl and we could easily move this to an env var itself. .env won't apply across sites, so there's less of a need for a path to domain map.

My view is that if you declare security-sensitive vars such as SS_TRUST_* values, attempts to re-declare them via getenv() could potentially be an error condition (i.e. only if defined in multiple places AND differ).
Other values could be safely overridden, however, e.g for testing purposes. :)
I'm very security paranoid though... so I am perhaps arguing for unnecessary strictness in this case.

there's currently the ability to set default baseurl

Maybe just have SS_DEFAULT_BASEURL instead as a substitute? Does that better suit the new architecture?

Maybe just have SS_DEFAULT_BASE_URL instead as a substitute? Does that better suit the new architecture? We have BASE_URL but that's a core constant not an environment-level option.

Agreed

@SpiritLevel I guess you're right, there are a lot of double calls to getenv which is because I just wrapped defined calls and bare constants with getenv(). That's because this was more a quick "lets see if the tests pass" thing at first (which they do, yay).
If I take @assertchris' advice about a helper (getenv($val, $default)) I could probably remove large chunks of this code.

:)
I like the fact that _ss_environment.php is being renamed as a dot file .env so that it is hidden. What about doing the same for silverstripe-cache ? If I had my hands on the big lever, I think I would use the names .ss-cache and .ss-environment ;)

You can call either whatever you like.
With .env you can add This to your _config.php:
try {
	(new \Dotenv\Dotenv(BASE_PATH, '.ss-env'))->load();
} catch (\Dotenv\Exception\InvalidPathException $e) {
	// no file found - no big deal
}

And with the cache file:
define('TEMP_PATH', BASE_PATH . '/.ss-cache');

Just in case you thought otherwise, dot prefixed files aren't automatically hidden by web servers. it's not really any more secure.
However, I think we DO need a php env file support, as we have relied on this in several places. E.g. for splitting automatically maintained config from manually maintained config, or for conditional configs.
Could we not have separate support for .env.yml and .env.php?
I also have this problem with phpdotenv.
Add your application configuration to a .env file in the root of your project. Make sure the .env file is added to your .gitignore so it is not checked-in the code

For some applications we MUST have the enviroment variables outside of the web root. Having it outside of the application root is also preferred, even if the webroot is a sub-directory.

Also, after re-reading this whole PR again for a second time I see a lot I missed earlier. Sorry for missing these earlier.

Thanks @dhensby. I am sure I noticed that the silverstripe-cache folder name was hardcoded somewhere...maybe only as a default though. I can't remember..I'll check. And, since I opened on an efficiency note (:P), isn't the attempt to create a new object, and doing so within a try-catch block, a fairly expensive operation for just checking the existence of a file? A bit picky, I know :)
@tractorcow Yup. I know dot files are not hidden from access but only hidden from view in the file manager and from the ls command. It "feels" tidy to remove this noise and have only the essential files and folders visible. I was also going to raise the issue of .env being outside of webroot; I put passwords and keys in _ss_environment.php above the webroot and have no _ss_environment.php in the webroot. I am hoping to be able to do the same thing with .env since it appears from Dan's docs that I can create an "extra" .env outside the webroot and not have any .env in the webroot...is this possible Dan ?

Oh no :(
From https://github.com/vlucas/phpdotenv:
"phpdotenv is made for development environments, and generally should not be used in production. In production, the actual environment variables should be set so that there is no overhead of loading the .env file on each request. This can be achieved via an automated deployment process with tools like Vagrant, chef, or Puppet, or can be set manually with cloud hosts like Pagodabox and Heroku."
Might this be an issue to consider for production mode since you have .env. being loaded in main.php on each request ?
On the other hand, it looks like new \Dotenv\Dotenv(PARENT_OF_BASE_PATH, '.ss-env'))->load(); will enable one to put .ss-env above the webroot, without having to define an "extra" .env file.

However, I think we DO need a php env file support, as we have relied on this in several places. E.g. for splitting automatically maintained config from manually maintained config, or for conditional configs.

What kind of things are you thinking? something like:
if ($_SERVER['REMOTE_ADDR'] == [some ip]) {
    define('SS_ENVIRONMENT_TYPE', 'dev');
}

If so, I think this kind of config is really bad practice and something we should be discouraging.
The aim of moving away from _ss_environment.php and to .env is to move away from SilverStripe's idiosyncrasies and to a more standardised approach. These constants are a way of doing environment variables without doing environment variables and that should change.

For some applications we MUST have the enviroment variables outside of the web root

Then these variables should probably be real environment variables, not ones stored in a .env and polyfilled into environment vars
If the above isn't possible, you can move the .env to any location you like and pull it in like so:

try {
	(new \Dotenv\Dotenv('/anywhere/I/like'))->load();
} catch (\Dotenv\Exception\InvalidPathException $e) {
	// no file found - no big deal
}

The approach to using real environment variables mitigates the need for a .env at all - the point of that file is just to make it a bit easier (no restarting apache) during development.

the point of that file is just to make it a bit easier (no restarting apache) during development

I'd argue that's not the only or even the most important purpose of that file. It documents what environment variables are required (this is usually done with a key-only copy of the file, named .env.example) so that newcomers can know waht environment variables they need to set up before the application error log (or hours of debugging) tell them.

I like this change but I'd prefer _ss_environment.php to be deprecated rather than broken.

Could we not support both getenv() and defined() vars using a core environment helper?

I think that making getenv() calls break is A Bad Idea. In moving away from getenv() and creating another abstraction we limit our ability to interoperate with the rest of the PHP ecosystem.
I'd do this by something along the lines of:
if(defined('SS_DATABASE_USERNAME')) {
  if(getenv('SS_DATABASE_USERNAME')) {
    cryAndDie();
  }
  setenv('SS_DATABASE_USERNAME', SS_DATABASE_USERNAME);
}

This would also mean whitelisting the variables supported.

The server guy is here!
I really like the move to using env variables instead of _SS_env. It will be much easier to deploy a silverstripe on different systems (locally, dockers, servers) and follows the 12-factor app methodology nicely.
But it will be tricky for me to build a production environment and knowing before hand if the SS app is going to be 3.0 or 4.0. So, in this case, I would probably duplicate the information into either .env or the webserver env AND _ss_environment.php.
People might be jumping between branches when deploying to check SS 4 compatibility and I would rather not setup a specific environment for that.
So if both works, it would make my job much easier and cause less confusion during the transition. I would probably deprecate _ss_env.php with the goal of removing support in the next major version of SS

I guess another way to approach it would be to have a shim module that took all the .env content and turned it into define()s?

Related: https://github.com/vlucas/phpdotenv/issues/213

@dhensby do you have xhprof results of before and after (with & without concurrency)? Does this add any overhead if we're running it in prod?
The reason I can see this being a poorer choice over _ss_env is that you lose the benefit of opcache and you'd have to parse the .env file on every request as @SpiritLevel mentioned.
The benefit I can see is that you could load them into your env vars earlier in your server config and they'd be shared, but some people don't have the ability to configure their server in that way.

if(defined('SS_DATABASE_USERNAME')) {
  if(getenv('SS_DATABASE_USERNAME')) {
    cryAndDie();
  }
  setenv('SS_DATABASE_USERNAME', SS_DATABASE_USERNAME);
}

👍  for this idea; Some vars should be allowed to be made immutable, so this addresses it acceptably.

@dhensby you are getting lots of feedback on this one!
Following on from @micmania1, and the conversations here and here, it seems that for production mode it would be a good idea to cache the environment vars loaded from .env upon the first request and then use these cached values for all subsequent requests; apparently, this is what Laravel does. And, for test and dev modes, insist that the .env file is read every request so that changes take immediate effect, without having to update the cache.  :) I also note there are some security concerns discussed in those above-linked conversations. There is no spoon but there are lots of rabbit holes...

OK - thanks for the feedback, I'm glad to see that this is generally being met with approval. There are some concerns being raised too, which I think I'll summarise as such:

No support for "server" wide .env file
No conditional logic available in .env file
We shouldn't make the upgrade path to 4 harder than it needs to be and removing _ss_environment.php is a too much

So, before I get into responding to these concerns I'd like to lay a few of the objectives of this PR so hopefully we can all consider it from the same standpoint and there's no ambiguity about what we are trying to achieve:

Standardise SilverStripe so it's more inline with the 12 factor app
Remove (one of) SilverStripe's idiosyncrasies to become more inline with the wider PHP ecosystem
Remove code complexity and maintenance burden

Also, it's important to remember that .env is basically a development environment shim for real environment variables and is not intended for prod.
1. No support for "server" wide .env file
This is possible and can be done by adding your own snippet as I mentioned [here[(https://github.com/silverstripe/silverstripe-framework/pull/6337#issuecomment-263873656). However, if you have environment variables that are shared amongst your entire server then this sounds like a perfect example of when a environment variable would be best.
2. No conditional logic available in .env file
I view this as bad practice and only limited to a few valid use cases (all pretty much on development environments):

Setting a DB name based on site being accessed (this can be done with SS_DATABASE_CHOOSE_NAME instead)
Setting $_FILE_TO_URL_MAPPING - we've somewhat agreed this should be deprecated

3. Reducing upgrade friction
I agree this will be a major change and so we should probably provide some compatibility for the old files and constants to be used but these should definitely be triggering deprecation warnings to encourage people to move away from the _ss_environment.php file.
In the interest of reducing code complexity and maintenance this should be pretty simple poly fill IMO. Something like:
$envFileLocation = findEnvirontmentFileLocation();
if ($envFileLocation) {
    throwDeprecationWarning();
}
$constants = get_defined_constants();
include $envFileLocation;
$newConstants = array_diff_key($constants, get_defined_constants());
foreach ($newConstants as $constant => $value) {
    if (getenv($constant) === null) {
        loadConstantIntoEnvironment($constant, $value);
    }
    else {
        trigger_error('Environment variable "' . $constants . '" already set', E_USER_WARNING);
    }
}

If there are other concerns, please raise them and I'll look at incorporating them into the PR.

The more I think about this the less I think providing BC is valuable:

I have a ~/Sites folder with 50-odd projects and a single _ss_environment.php file. This is a helpful use case

You'll only ever be setting a .env on 4.0 sites, it's not like your 50 sites are suddenly going to break because 4.0 doesn't use _ss_env anymore. If there's a concern about when you do have 50 SS 4 sites, then these shared vars should be first class environment variables on your machine rather than in the .env per site.
In SS 4 we're doing a lot of coard cutting in regards to old APIs and I'm not sure why this should be one we retain when it provides a difficult reminder of the past.

If we don't have support for the _ss_environment file in SS4, then we can put both files side by side on a server. That seems of benefit to me and so I'd support that.
I'm not sure what it means for people who have written code that relies on defined constants in their modules, however. As you say, perhaps the upgrader can help, but I'm not sure how it would get a list of defined constants to rewrite.

If we don't have support for the _ss_environment file in SS4, then we can put both files side by side on a server. That seems of benefit to me and so I'd support that.

This is the conclusion I'm coming to.
As for constants from thirdparty modules, I'm afraid they'd have to switch to env vars or use some custom config option - which will just be as much of the pain as the rest of it, the upgrader can do what I've done in my latest commit - look at the constants immediately added by the _ss_environment.php and write them to .env

No support for server wide .env file
This is possible and can be done by adding your own snippet as I mentioned here. However, if you have environment variables that are shared amongst your entire server then this sounds like a perfect example of when a environment variable would be best.

I would rather that this was included on-install rather than requiring manual code to enable. Several reasons:
Developer bootstrapping:
My reasoning is that it should be able to quickly composer create-project a new site without having to go through all the "extra set up steps" in order to get a site running. I never ever need to touch my _ss_environment.php file in root, and I'd hope to not have to do too much additional work in 4.0 either.
I see that you can use global environment variables, but those are nowhere near as flexible or easy to update as a text file. (no rebooting, editing system config files, restarting apache).
Source control management
We should never have environment configuration in source control. That also means not mixing uncontrolled environment files mixed with other source controlled files in the same directory.
Security
Config vars, for a similar reason to above, should not be anywhere near web-accessible folders.
Upgrade paths
Not supporting .env in places where users once relied on _ss_environment.php being accessible means additional upgrade steps.
I would propose something like this is main.php:
// load site-specific config before parent config
$paths = [ BASE_PATH, dirname(BASE_PATH) ];
foreach ($paths as $path) {
	if (file_exists($path . '/.env') {
		(new \Dotenv\Dotenv(BASE_PATH))->load($path, '.env');
	}
}

@tractorcow from where I sit what this PR lets us do is almost perfectly analagous to using the _ss_environment.php the only difference is where this config sits (a file in a parent directory or a settings file creating real env vars). All of the points you raise are either true now or with this PR or are not problems that should be addressed in this PR.

I would rather that this was included on-install rather than requiring manual code to enable. Several reasons:

There will be no manual code to enable if you have your environment pre-configured (as is the case now) othwise you'll need to perform a one-time configuration.

My reasoning is that it should be able to quickly composer create-project a new site without having to go through all the "extra set up steps" in order to get a site running. I never ever need to touch my _ss_environment.php file in root, and I'd hope to not have to do too much additional work in 4.0 either.

This is exactly the same now as it is with this PR. I don't see that there are any extra steps if your server is pre-configured. I also don't follow why if you "never ever need to touch [your environment] file" why a one time set up of server environment variables is seen as such an inconvenience - it adds no extra steps or hassle to the composer create-project example and it allows you to put project related config where it belongs (with the project).

We should never have environment configuration in source control. That also means not mixing uncontrolled environment files mixed with other source controlled files in the same directory.

This isn't a problem for this PR to solve - it seems to be something to address not only in the SilverStripe eco system but PHP and development as a whole. It is something we do quite extensively. The PHP community seems to agree that excluding files using .gitignore seems to be somewhat normal and accepted as a means of allowing (sensitive) files to exist on the file system without being added to the VCS.

Not supporting .env in places where users once relied on _ss_environment.php being accessible means additional upgrade steps.

Yes, this is true - but almost everything we're doing in 4 is adding upgrade steps. I've addressed this in more detail in an earlier comment. There will be additional upgrade steps just by virture of including this PR in whatever form.
Your proposal
If that is the clincher, then I'll make that change though I think it's bad for several reasons:

It breaks from the norm of using a .env which is confusing to developers and separates our project from the wider PHP community. This retains some idiosyncrasy that we're trying to remove.
We have to check one file that we shouldn't be checking as it is, now we'll be checking two. At least with the current set up the idea is that the _ss_environment.php should exist so we can justify looking for it, in prod the .env should not exist.

Maybe we should wrap the .env searcher in if (getenv('SS_ENVIRONMENT_TYPE') == 'live')

@dhensby how does this affect performance (see comment: https://github.com/silverstripe/silverstripe-framework/pull/6337#issuecomment-264036980)?
Also, what I haven't seen addressed is that dotenv is not intended to be used in production but it seems your proposal would do that? See comment by @SpiritLevel here which links to some good resources: https://github.com/silverstripe/silverstripe-framework/pull/6337#issuecomment-264050784

Ok, I'm happy my complaints have been addressed. :) I understand there are still a few other things to consider before merging this PR, but I'll give my approvel. :P

@micmania1 I think there's a performance gain here because we're doing less disk reads to find environment files. If it's not used in production I expect it to be faster than what we currently have - though we're probably talking intangible differences here.
As per my last comment: "Maybe we should wrap the .env searcher in if (getenv('SS_ENVIRONMENT_TYPE') == 'live')" - however I've decided against this - whilst users shouldn't use it in prod, shared hosts may have now way at all to set env vars and so this is the last resort and not something I think we should block devs from doing.
Whilst we'd like to enforce best practices, being overly ideological isn't a good thing and more likely to turn people off than see the benefits of doing this properly. Ultimately if the cost is half a millisecond for those "doing it wrong" then that's the choice they've got.

OK - things left to address:
[ ] Replacing $_FILE_TO_URL_MAPPING
[ ] PR for https://github.com/silverstripe/silverstripe-installer
Please let me know if there's anything else to add

Looks good @dhensby :)

Milestoning at alpha 5, since we need to get alpha 4 out today.

You could allow your .env file to declare a custom php script for inclusion.
SS_EXTRA_INCLUDE=/var/sites/extra_include.php
And you can define any non-trivial bootstrapping in there.

Add to that, SS_EXTRA_INCLUDE could include non-php source files (such as other .envs).

@tractorcow I think the SS_EXTRA_INCLUDE is flawed for a few reasons - mostly the fact that it can only be set once is the biggest issue.
At the moment we can resolve these problems without needing to modify this PR.

@micmania1 I've also added a new commit that allows a first class env var to be set (SS_IGNORE_DOT_ENV) which will skip the loading of environment vars from the .env file. This will prevent the needless search for the file and thus mitigate any performance impact of doing so.
Whilst .env shouldn't be used on live, I don't think we should explicitly block it because

It's impossible to reliably determine what environment type we are on this early in the bootstrap
It would be useful for those on hosting infrastructure that doesn't allow the setting of first class ENV vars
The way this library is integrated will not override existing env vars (so there's little risk in allowing it on live environments)

@tractorcow I think the SS_EXTRA_INCLUDE is flawed for a few reasons - mostly the fact that it can only be set once is the biggest issue.

Discussed this with @dhensby and we agreed that it can be added back in with a module, so it doesn't need to be a part of core.

@dhensby can we use .env to set the hostname of the server for CLI mode? It would be a bit more flexible than a hard coded array of phony headers.

@dhensby can we use .env to set the hostname of the server for CLI mode? It would be a bit more flexible than a hard coded array of phony headers.

Yes, using SS_HOST

Yes but, what I mean is set that against $_SERVER. At the moment $_SERVER['HOST_NAME'] and getenv('SS_HOST') contradict one another. Unless I've mis-read the code.

Looks good! I'd like to see more upgrading notes to make the transition smoother:

Needs to link to more detailed docs, and an example on how to rewrite the old format to the new one.
Should mention that devs need to check if their webservers are configured to deny requests to dot-prefixed files if the environment file is located in the webroot (or move it out of the webroot). This wasn't a problem before with PHP files, since they would execute on webserver requests, but not leak any information.
Needs to point out conditional logic as bad practice (no longer possible), and suggest a better alternative
Mention the removal of $_FILE_TO_URL_MAPPING (and how to achieve this now)

For SS_HOST, this now requires a project specific .env file, correct? It's probably not a big deal, since I can't recall a case where the mapping is actually relevant. I've used it for Behat at some point, but it's best practive to configure the hostname through behat.yml anyway.

Needs to link to more detailed docs, and an example on how to rewrite the old format to the new one.

I've added docs under environment management that show the new format. I've added to the changelog to link to this.

Should mention that devs need to check if their webservers are configured to deny requests to dot-prefixed files if the environment file is located in the webroot (or move it out of the webroot). This wasn't a problem before with PHP files, since they would execute on webserver requests, but not leak any information.

Added security issues section to environment management docs

Needs to point out conditional logic as bad practice (no longer possible), and suggest a better alternative

I'm not sure where to put this, it doesn't really make sense to put it in environment management docs ("Don't do this thing you can't do any more coz it's bad but if you have to do it this way").

Mention the removal of $_FILE_TO_URL_MAPPING (and how to achieve this now)

Added to change log

I'm not sure where to put this, it doesn't really make sense to put it in environment management docs ("Don't do this thing you can't do any more coz it's bad but if you have to do it this way").

In the 4.0.0.md upgrading guide - doesn't make sense as permanent documentation, but at the point of an upgrade it's relevant.

OK - I've addressed all the feedback apart from the URL issues

I'm happy for us to merge as-is and pick up SS_HOST vs SS_BASE_URL as a separate ticket.

:') Can't believe it - whoop

I've opened the follow-up issue

Awesome to see this merged! Buuuuut: It broke all travis builds apart from framework, since that's the only one that no longer relies on travis-support: https://github.com/silverstripe/silverstripe-travis-support/issues/41. And funnily enough, we're using conditional logic in the _ss_env there ;) @dhensby, do you have time to look at this?

I'll look at it today.


bug fix php 7.2after Segmentation fault

This pull request is fix bug for  php 7.2 after  when php scripte execute  cause error of Segmentation fault.


Manual whitespace compression instead of compiled Regex

Description
Manual whitespace compression instead of Regex to improve performance of AWS4Signer.CanonicalizeHeaders method that called frequently
Motivation and Context
Method AWS4Signer.CanonicalizeHeaders is called frequently. More than 50% of its time is regular expression execution (AWSSDKUtils.CompressSpaces)
Testing
I have a test project with BenchmarkDotNet that shows significant imrpvement of CompressSpaces method if processing is done manually in a simple manner. Performance gain is higher on longer strings.
Screenshots (if appropriate)

Types of changes

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

[x] My code follows the code style of this project
[ ] My change requires a change to the documentation
[ ] I have updated the documentation accordingly
[x] I have read the README document
[ ] I have added tests to cover my changes
[x] All new and existing tests passed

License

[x] I confirm that this pull request can be released under the Apache 2 license

How can I get paid

This was merged and released with version <IP_ADDRESS> of AWSSDK.Core.


[BUG]How to apply these to my current Shopify store?

Describe the bug
It seems that I can't find a way/config to deploy this awesome project based on my current shopify store.
To Reproduce
I have a shopify store, and how can I apply these hydrogen front end project  to replace my current project ?

@williamyorkl Hi! You need to update the shopify.config.js file with your store information as mentioned here: https://shopify.dev/custom-storefronts/hydrogen/getting-started#update-information-about-your-shopify-storefront
That said, Hydrogen is still in developer preview so you can start building your custom storefront already but it's not yet recommended for production.
If you find any issue, please report it in this repo with a way to reproduce it 👍


[Don't merge] Add ID in admin petition show

Ammy requested

I think the request for this was really about the list view....  Although
also useful on show page...
On 14 Jul 2015 18:16, "Henry Hadlow"<EMAIL_ADDRESS>wrote:

You can view, comment on, or merge this pull request online at:
https://github.com/alphagov/e-petitions/pull/320
Commit Summary

Add ID in admin petition show

File Changes

M app/views/admin/petitions/_petition_details.html.erb
https://github.com/alphagov/e-petitions/pull/320/files#diff-0 (4)

Patch Links:

https://github.com/alphagov/e-petitions/pull/320.patch
https://github.com/alphagov/e-petitions/pull/320.diff

—
Reply to this email directly or view it on GitHub
https://github.com/alphagov/e-petitions/pull/320.

OK I'll add that in tomorrow...

Now part of https://github.com/alphagov/e-petitions/pull/324


Flakes are not mentioned in official documentation

Problem
Other than a few tangential mentions, flakes are not mentioned in the official documentation.
This is a problem because their prevalence results in new users' exposure to them, which has them wondering whether they should be learning how to use them at this stage.

Checklist

[x] checked latest Nixpkgs manual (source) and latest NixOS manual] [source]nixos-source)
[x] checked open documentation issues for possible duplicates
[x] checked open documentation pull requests for possible solutions

Proposal
Flakes should be mentioned in the nix manual. It should be stated that they are yet experimental. And a link to further documentation provided.

Co-authored-by @a-kenji

This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/usability-study-session-4/21422/1

This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2022-10-22-documentation-team-meeting-notes-12-nixcon-edition/22689/1


Customizable Status Icon Colors

Adding a feature to let you change status icon colors to anything you or the server owner prefers. This makes the interface more personal, letting players and admins adjust the look to match their style or the server theme.

Closed due to repo clean up.


SPLAT-1391: promote vSphere from tech preview

depends on:

[ ] https://github.com/openshift/api/pull/1733
[ ] https://github.com/openshift/client-go/pull/274
[ ] openshift/cluster-config-operator#400

/payload ?

/test e2e-vsphere-ovn

/test e2e-vsphere-multi-zone-operator
/test e2e-vsphere-operator
/test e2e-vsphere-ovn-etcd-scaling

/payload 4.16 nightly informing

/hold

/test unit

/test images

/retest

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi https://github.com/openshift/cluster-config-operator/pull/400,https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400,openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400,openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400

/payload-abort

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400 openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400 openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-csi openshift/cluster-config-operator#400 openshift/api#1733
/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-ovn openshift/cluster-config-operator#400 openshift/api#1733
/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-serial openshift/cluster-config-operator#400 openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-csi https://github.com/openshift/cluster-config-operator/pull/400 https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-ovn https://github.com/openshift/cluster-config-operator/pull/400 https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-serial https://github.com/openshift/cluster-config-operator/pull/400 https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-ovn https://github.com/openshift/cluster-config-operator/pull/400 https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-ovn https://github.com/openshift/cluster-config-operator/pull/400 https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-ovn openshift/cluster-config-operator#400 openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-csi https://github.com/openshift/cluster-config-operator/pull/400 https://github.com/openshift/api/pull/1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-aws-csi openshift/cluster-config-operator#400 openshift/api#1733

/payload-job-with-prs periodic-ci-openshift-release-master-nightly-4.16-e2e-vsphere-ovn-csi openshift/cluster-config-operator#400

/test unit

/test unit

/test unit

/hold cancel

/test e2e-vsphere-operator
/test e2e-vsphere-multi-zone-operator

/hold
e2e-vsphere-operator and e2e-vsphere-multi-zone-operator tests are timing out.  from reviewing the logs, it looks like the operation that is timing out nearly completes.  placing a hold to investigate if we can improve the signal here.

/test unit

/test e2e-vsphere-operator

/test e2e-vsphere-operator

/hold cancel
the vsphere operator test is timing out.  I'm going to look at what we can do to improve this in https://issues.redhat.com/browse/SPLAT-1411


Allow cmp completion on tag wrapping

Checklist

[ x] Have you read through :h nvim-surround to see if there might be any relevant information there?

Is your feature request related to a problem? Please describe.
In the fronted world tags could be very long (especially with some tools like styled-components). It is annoying to print it from scratch if they are existed in the buffer already.
Describe the solution you'd like
Cmp completion for buffer would be cool feature to prevent retyping.

This is something that I would love as well, and seems related to this discussion. If anyone has ideas as for how this could be done, feel free to let me know!

@kylechui
https://github.com/nvim-neo-tree/neo-tree.nvim
I'm not sure that it can helps but file creation works with ability to use cmp in this plugin. Check it please does it make sense or not in context of our discussion.

@timsofteng Does it work in the plugin that you linked? I looked through the issues and it seems to not work there either.

Merging this into #145


Permissions Settings

This is my second issue for the review of EC601.
When I visited your website, I found that you ask the users for a lot of permissions. To really go through your website, I created a separate dummy account because some of the permissions you were asking was unnecessary (and actually unreasonable). One of the permissions that made me not want to share my information with you was "see, edit, and permanently delete your YouTube videos, ratings, comments and captions". I think you can change your permission settings so that users do not have to give you this type of control over their personal data.
Thanks!

Sorry for your concern, but if we want to visit your personal data(like how many videos you have uploaded), we must ask for these permissions from you and Google.
If you feel uncomfortable about this, you can try other function on our site which not require you to sign in. Our site is still in progress, we are trying to build more interesting functions.
Again thanks a lot for your advise!


A bunch of new icons

Added icons for:

YNAB,
Standard Notes,
Squarespace,
Nexus Mods,
ID.me, and
Fidelity.

In every case except for ID.me and Nexus Mods, I downloaded the 1000x1000 icon PNG for the corresponding iOS app from Apple Services Marketing Tools.
Also, while I'm here, have you ever considered using ImageOptim to compress PNGs and other images losslessly? I have very little experience with iOS dev, so I'm not sure if you're already using it (or a similar tool), but I was able to reduce the size of IssuerIcons/ by 4.7MB (-50%). I've isolated those changes in 0b79349; feel free to drop them.
Thanks for you work! I love the app.

Oof, upon pressing the "Create Pull Request" button I realize that app icons are bordered. I'll mark this as a draft and ping once I've fixed that, sorry...

Okay, all fixed! (Except for Fidelity, since I couldn't find a nicer icon and don't have Photoshop to tweak it myself; feel free to drop it. I'm leaving it in since I saw similar icons in the directory.)

ImageOptim generally isn't used to compress images in the IssuerIcons directory: see point three of this comment.

Didn't know that, thanks for the context! I'll push shortly with that commit dropped.

Thanks for the icons @natanlao, and sorry for taking so long to look at this!


WIP: Fabo/1154 use explorer validator page

Closes #1154, #1100

❤ Thank you!

Keybase is throttling this PR: GET https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=[do-not-modify] 429 (Too Many Requests)


fix: lets add optional slack notification configuration

/approve

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: jstrachan
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [jstrachan]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


[Bug]: CSS output extra details about lang() dir()

System Info
System:
OS: macOS 14.4
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900KF
Memory: 6.79 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.8.0 - /usr/local/bin/node
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 9.9.0 - /usr/local/bin/pnpm
bun: 1.1.24 - /usr/local/bin/bun
Watchman: 2<IP_ADDRESS> - /usr/local/bin/watchman
Details
After update to rsapck version > 0.1.4 , build app then output css that has extra unnessary content:

Here is the origin css:
.__editor_block_special {
	padding-inline-start: 0;
	padding-inline-end: 0;
	margin-inline-start: var(--editor_padding_x);
	margin-inline-end: var(--editor_padding_x);
}

Tried custom LightningCssMinimizerRspackPlugin options:
optimization: {
	minimizer: [
		new LightningCssMinimizerRspackPlugin({
			minimizerOptions: {
				exclude: {
					langSelectorList: true,
					dirSelector: true
				}
			}
		})
	]
}

Still dir selector exsit:

Temp resolution is downgrading rspack version to 1.0.4 or set targets to chrome >= 120:
optimization: {
	minimizer: [
		new LightningCssMinimizerRspackPlugin({
			minimizerOptions: {
				targets: 'chrome >= 120'
			}
		})
	]
}

Reproduce link
No response
Reproduce Steps
see above.

Refer to https://github.com/web-infra-dev/rspack/pull/7811.

Refer to #7811.

Seem not to solve the problem for default downgrade application css. This default behavior is unacceptable.

Hi, you should set a proper targets for lightningcss, as lightningcss will downgrade modern CSS features to fit to the current target browsers.

Hi, you should set a proper targets for lightningcss, as lightningcss will downgrade modern CSS features to fit to the current target browsers.

This behavior is unreasonable and unacceptable.

If lightningcss does not downgrade the CSS, it will not work in legacy browsers.
If you have any suggestions on the transformation results of lightingcss, please file an issue in the lightningcss repository: https://github.com/parcel-bundler/lightningcss

My concern stems from rspack's "default settings" here, which are unrelated to lightningcss. Rspak should establish a default configuration that prevents lightningcss from arbitrarily downgrading CSS on its own.
This aligns with developers' understanding of packaging tools like webpack, without the need to delve into any messy details beyond packaging.

I totally understand your claim. Unfortunately, lightningcss does not currently allow to do this. refer to https://github.com/parcel-bundler/lightningcss/issues/792


Reloading WMTS layer in OpenLayers 6.4.3 and newer

Hello, I am sorry for double posting this. I already asked on StackOverflow  but I did not get any answer. So I am trying my luck here because it seems to me as this could be actually a bug. I am just kindly asking you to check my trying if I am doing something wrong or confirming if it is a bug, please.
Describe the bug
I'm trying to reload the WMTS layer after changing some tiles on the remote WMTS server.
The problem is that I am not able to reload tiles in the current viewport (or in the current zoom level). Other lower resolution tiles are getting reloaded correctly. The issue is that tiles in the viewport redraw but a request to verify ETag is not made. A suspicious thing is that if I disable cache in browser's network tab tiles in the viewport are getting requested correctly.
I am using following snippet for cache invalidation, I do have more layers of different type:
const source = layer.getSource(); // WMTS layer, returns WMTS source

if (source != null) {
  source.getTileCacheForProjection?.(this.map.getView().getProjection())?.clear();
  source.clear();
  source.tileCache.clear();
  source.refresh?.();
  source.changed();
}

layer.changed();

I tried the snippet in OL v6.3.1 where it worked correctly but not in 6.4.3, 6.14.1 (I use in master branch), or 6.15.1.
My WMTS server does use ETag. Here is two examples of the response header with ETag set
HTTP/1.1 200 OK
Server: Microsoft-HTTPAPI/2.0
Access-Control-Allow-Origin: *
Cache-Control: private, max-age=0, must-revalidate
Content-Disposition: inline; filename=ows-data.png
Content-Length: 64795
Content-Type: image/png
ETag: a22c283e43ab4143
X-Frame-Options: SAMEORIGIN
Date: Thu, 04 Aug 2022 14:20:00 GMT

HTTP/1.1 304 Not Modified
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 04 Aug 2022 14:33:56 GMT

Server correctly returns 304 for lower resolution tiles and 200 with payload for those that changed.
Expected behavior
Cache will invalidate properly and ETag is properly revalidated for tiles in viewport.

Ahocevar, thank you for the quick response. Yes, that is my case, I have the WMTS layer reprojected. I've tried your snippet but no success.
Can I help you fix this bug? With my manager approval, I can contribute to the source code, it would be nice if you could direct me where to start looking. Or I can help with testing at least, I have the environment ready.

@petrgon Can you please try the fix in #14013? According to the tests I added there, it should fix your problem.

Thank you Ahocevar for the try, but I am sorry, it does not work. I was testing it primarily using your snippet layer.getSource().refresh().
It is improvement, originally when I did layer.getSource().refresh(); nothing re-rendered. Now it does something. I can see tiles in viewport being unloaded (I can see gray background color) and loaded again. But no ETag validation request for tiles in viewport is made.
I can see some requests being made for low-res tiles. But the behavior in nondeterministic. When I call layer.getSource().refresh(); multiple times I can see the same repeating number of requests for ETag validation being made (e.g. 45-3-0, it depends on zoom level).
As I said, these tiles are low resolution tiles and they contains correct map data (I am switching between satellite tiles with snow and without snow). But no request is being made for tiles in viewport they always keep the same amount of snow level as before.

@petrgon Are you sure you tested the correct version, i.e. v7.0.0?
Also, just to rule out the chance that your browser caches more than you think (which I think it does, because your server does not send a Last-Modified: header): what happens when you clear the browser cache before calling refresh()? In that case, you should see all tiles getting refetched. And if that's the case, you'd have to double-check the cache related headers from your server.
You can try it out here: https://codesandbox.io/s/scaleline-indiana-east-forked-7hdii8?file=/index.html. Also note that when you change the ol dependency's version from v7.0.0 to v6.15.1, no request will be made upon refresh() at all, which was the probem I fixed.

Thank you @ahocevar for your help. I cloned the OL repo and checkouted the master, I verified that the commit fae9e90 is there. Then I built it using  npm run build-package and installed it using npm install w:\external\openlayers\build\ol\ (path to the build output). As a confirmation that I used correct branch was the need of updating ol-mapbox-style. In the packaged.json, I can see that the ol package targets to the local filesystem. The project works fine (except this issue) after all these steps.
✔ I can also confirm that something did change. Calling layer.getSource().refresh(); gives me a visual feedback that it tries to refetch the map data. It didn't before your commit.
⚠ The issue is that no HTTP request is made to validate the ETag. Tiles that are loaded after layer.getSource().refresh(); are the same as before. I don't know where these tiles come from. Unfortunately, I don't even know how to find out. I agree that this doesn't have to be an issue of OL anymore.
I'll do more investigation on my side. I'll be in touch. Thank you again for your cooperation.


[Refactor] Install rf on ExchangeNode if its offsprings deny the rf and PlanNodes always adopts small rf

Fixes #issue
What type of PR is this:

[ ] BugFix
[ ] Feature
[ ] Enhancement
[x] Refactor
[ ] UT
[ ] Doc
[ ] Tool

Does this PR entail a change in behavior?

[] Yes, this PR will result in a change in behavior.
[x] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

[ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
[ ] Parameter changes: default values, similar parameters but with different default values
[ ] Policy changes: use new policy to replace old one, functionality automatically enabled
[ ] Feature removed
[ ] Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

[ ] I have added test cases for my bug fix or my new feature
[ ] This pr needs user documentation (for new or modified features or behaviors)

[ ] I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

[x] I have checked the version labels which the pr will be auto-backported to the target branch

[x] 3.2
[x] 3.1
[x] 3.0
[ ] 2.5

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

@mergifyio rebase main

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

@mergifyio rebase

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

@mergifyio rebase

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

@mergifyio rebase

[FE Incremental Coverage Report]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/planner/RuntimeFilterDescription.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/planner/ExchangeNode.java
1
1
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)


Modifying Indices at Runtime

The current documentation states that the cache configuration cannot be changed. In the wiki I found the page [https://cwiki.apache.org/confluence/display/IGNITE/Allow+Configuration+Settings+Change+At+Runtime ](Allow Configuration Settings Change At Runtime).

Is the topic of changing the cache configuration at runtime still on your agenda?
Was changing the indices at runtime one candidate or is this even possible already?

Thank you very much

Hi @fbutter

Is the topic of changing the cache configuration at runtime still on your agenda?

We have some properties that can be changed in runtime. But not cache configurations. Which settings do you need to be changed?

Was changing the indices at runtime one candidate or is this even possible already?

You can create/drop indexes in runtime using ddl SQL queries: https://ignite.apache.org/docs/2.15.0/sql-reference/ddl#create-index


Custom output formatter

as requested at #92, this PR changes the rendering strategy so clients can inject the output format for each test

ouch! the build failed because I'm using the new strings.Builder from 1.10.
Should I upgrade the golang version in the travis config or use any other method to build strings compatible with 1.9?

@rakyll Why is taking so long to answer my question?

Can you replace the use of strings.Builder and make sure it builds with Go 1.9?

Thanks!


Empty experience bottle giving larger variant than expected

v1.3.0 (pretty sure it was happening in v1.2.3 also)
loss_percentage: 0.0 (have not tested at other percentages)
All other xp bottle related configurations are default.
No other plugins installed.
Expected: At 0 experience, drink large experience bottle to hit level 30, anvil/enchant down to lower level (say 27), use empty xp bottle and get medium experience bottle and some leftover experience/levels.
Actual: At 0 experience, drink large experience bottle to hit level 30, anvil/enchant down to any level (went down to 9 for one of my tests), use empty xp bottle and still get large experience bottle and no leftover experience/levels.
This seems to happen for any variant of experience bottle. If I die to reset my experience to 0, I am not able to store any experience unexpectedly regardless of actions before death. Then, once I get to level 10, even if I spend 2 levels enchanting an item and go down to level 8, I can still bottle a small experience bottle and drink it back up to level 10.
Same results regardless of gaining experience using regular xp (villager trading, killing mobs, mining, bottles o' enchanting, etc) or Vane experience bottles, and losing experience from anvil or enchanting table. Additionally, gaining a small amount of experience or levels does not prevent this from happening (E.g., start at level 10, enchant down to 8, level up to 9, I am still able to get a small experience bottle). Losing experience from death or bottling experience seems to prevent the issue temporarily until you gain back to a variant level.
https://github.com/oddlama/vane/blob/26e53758c00af43d1c3d3c13b243fc0f14ae2c8f/vane-trifles/src/main/java/org/oddlama/vane/trifles/items/EmptyXpBottle.java#L97
I'm not really familiar at all with Vane code or Paper API but did some quick poking around and this might be the issue. player.getTotalExperience() is apparently the players "score" (the one that displays on the death screen), not their actual xp. I'm guessing your approach of subtracting xp might also be subtracting from the score (and death resets your score iirc), but subtracting levels (anvil, enchanting table) does not and that is the disconnect. Seems in line with the current behavior I am experiencing. Found a few threads similar to this. Sounds like there isn't a simple way to get the desired value and need to do a few calculations instead.
We have been loving Vane, thanks for your hard work!

Wow thanks for the detailed report and the kind words! You are absolutely right, I wrongly assumed that player.getTotalExperience() returns the current amount of experience points when instead it does something slightly different than what the name suggests - as you already pointed out correctly.
Funnily enough, the utility functions by "Jikoo" which were posted to the thread you linked to, also miscalculate the experience due to a formula simplification mistake :P. I notified the owner, and implemented the correct formulas for vane.
Thanks again for the report, the issue is fixed in vane v1.3.1.


[Event Request] table 5409 "Prod. Order Routing Line" - OnCalculateRoutingForwardOnAfterCalculateProdOrderDates

local procedure CalculateRoutingForward()
var
    ProdOrderLine: Record "Prod. Order Line";
    ProdOrderRoutingLine: Record "Prod. Order Routing Line";
begin
    ...
            CalcProdOrder.CalculateProdOrderDates(ProdOrderLine, true);
            OnCalculateRoutingForwardOnAfterCalculateProdOrderDates(Rec, ProdOrderLine);  //A111F000.Event20.02
            AdjustComponents(ProdOrderLine);
    ...
end;

[IntegrationEvent(false, false)]
local procedure OnCalculateRoutingForwardOnAfterCalculateProdOrderDates(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; var ProdOrderLine: Record "Prod. Order Line")
begin
    //A111F000.Event20.02
end;

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 46829.

Missing implementation, reactivated

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 49745.


Fix sample code

Fix data class
Fix val:

I'm closing my PR because I made a mistake on my account...


What is the best way to capture metadata for cops?

Hello friends, I'm not sure if my question fits better here or in the RuboCop project itself. Let's start here:
I'm building some smart cops that are crossing metadata from different perspectives of the application.
Initially, I build a mechanism to capture data from code and then I reuse it into cops to make them smart, understanding the context.
So, let's start with the capture system:
module RuboCop
  # RuboCop overrides for capturing information from files using NodePattern.
  module Capture
    module_function

    # Search for a node pattern on a given set of files
    # @return [Array<Object>] with results that matches or captures
    # @param files [Array<String>] nil for use
    #
    # @example "Extract all class names from app/models folder"
    # RuboCop::Capture.all(
    #   pattern: '(class $_ ...)',
    #   files: Dir.glob('app/models/**/*.rb')
    # ).flatten.map(&:source) #   ["ModelA", "ModelB", ...]
    #
    # Or use from:
    #
    # @example "Extract all class names from app/models folder"
    # RuboCop::Capture.all(
    #   pattern: '(class $_ ...)',
    #   from: 'app/models/*.rb'
    # ).flatten.map(&:source) #   ["ModelA", "ModelB",...]
    # Or use from:
    def all(pattern:, files: nil, from: nil)
      node_pattern = RuboCop::NodePattern.new(pattern)
      files = files_from(from) if from && files.nil?
      files.map do |file|
        FromFile.new(pattern: node_pattern, file: file).search
      end
    end

    # @return [Array<String>] with all files from recursive search.
    # @example "Factories from all engines"
    # RuboCop::Capture.files_from('engines/*/spec/factories')
    # @see https://apidock.com/ruby/Dir/glob/class
    def files_from(dir)
      Dir.glob("#{dir}/**/**.rb")
    end

    # This class searches and captures
    # node or data from AST using [RuboCop::NodePattern].
    # @example "Extract all class names from app/models folder"
    # RuboCop::Capture::FromFile.all(
    #   pattern: '(class $_ ...)',
    #   files: Dir.glob('app/models/*.rb')
    # ).flatten.map(&:source) #   ["ModelA", "ModelB", ...]
    #
    # @example "Extracting class name from single file"
    #  RuboCop::Capture::FromFile.new(
    #    pattern: '(class $_ ...)',
    #    file: 'app/models/talent.rb'
    #  ).search => s(:const, nil, :Talent)
    class FromFile
      include RuboCop::AST::Traversal

      attr_reader :pattern, :file
      def initialize(pattern:, file:)
        @pattern = pattern.is_a?(String) ? RuboCop::NodePattern.new(pattern) : pattern
        @file = file
      end

      # @return [Array<Object>] captures from node
      # @param pattern String with the node pattern
      # @param node [RuboCop::AST::Node]
      def search(pattern = self.pattern, node = ast_from_file)
        match = pattern.match(node)
        if match
          match == true ? node : match
        elsif node.nil?
          nil
        elsif node.children.nil?
          []
        elsif node.descendants.any?
          node.descendants.flat_map { |e| search(pattern, e) }.flatten.compact
        end
      end

      # @return [RuboCop::AST::Node] from #processed_source
      def ast_from_file
        processed_source.ast
      end

      # @return [RuboCop::ProcessedSource] from #file using RUBY_VERSION
      def processed_source
        RuboCop::ProcessedSource.new(IO.read(file), RUBY_VERSION.to_f, file)
      end
    end
  end
end

And then I can start capturing things. Example, Let's say I'd like to capture all factory names from an specific folder:
 # @return [Array<String>] with the definition of factory class names' from a
    # given folder.
    def factory_names(from:)
      (@factories_names ||= {})[from] ||=
        RuboCop::Capture.all(
          pattern: '(send nil? :factory ({sym str} $_) ... )',
          from: from
        ).flatten.compact.uniq
    end

Then I can build a cop to check if some factories from rails engines are used outside of the boundaries of the domain. Ideally, a rails engine should have the domain isolated and do not know about the factories of other engines or the main rails application. The inverse is also valid, so I have two cops to check if the main app is touching engine code and another to check if the engine code is using the main app code.
      class AvoidRailsModelsOnEngines < Cop
        MSG = 'Do not use models from rails inside the engines.'.freeze

        def_node_matcher :rails_model?, <<~PATTERN
          (send (const {nil? cbase} #forbidden_model?) ...)
        PATTERN

        class << self
          # @return [Array<String>] with all class names from models
          def rails_models
            capture_const_name(from: model_files)
          end

          # @return [Array<String>] with all filenames from models ignoring concerns
          def model_files
            Dir.glob('app/models/**/**.rb').reject { |e| e =~ %r{/concerns/} }
          end

          # @return [Array<String>] with the definition of class names' from a
          # given folder.
          def capture_const_name(from:)
            (@consts_from ||= {})[from] ||=
              begin
                results = RuboCop::Capture.all(pattern: '(class $_ ...)', files: from)
                results.flatten.compact.flat_map(&:source).uniq
              end
          end
        end

        def on_send(node)
          return unless rails_model?(node)

          add_offense(node.children.first)
        end

        private

        def forbidden_model?(name)
          models.include?(name.to_s)
        end

        def models
          (self.class.rails_models - engine_models)
        end

        def engine_models
          self.class.capture_const_name from: files_from_current_engine
        end

        def files_from_current_engine
          all_files_from_engine_folder.reject { |e| e =~ %r{/concerns/} }
        end

        def all_files_from_engine_folder
          dir = File.dirname(processed_source.path)
          folders = dir.split('/')
          engines_folder_index = folders.index('engines')
          return [] unless engines_folder_index

          folder_engine = folders[0, (engines_folder_index + 2)]
          Dir.glob(File.join(*folder_engine, '**', '**.rb'))
        end
      end

When I run RuboCop sequentially it works like a charm, caching the @consts_from, but if I need to introduce a parallel process it becomes heavy and slow down blocking all threads until captures all cases in all threads separately.
I'm not very familiar with the caching system and I'm not sure how can I build such captures in a way that it would process only once. I don't know exactly what is the best way to warm up this cache in a way that we don't lock all cops to work.
For now, my solution was just to isolate the cops into a separated .rubocop.yml configuration and just run them isolated disabling all other cops, but I'd love to hear any tips on how to better enhance the capturing system into the RuboCop ecosystem in a way that it would not hurt to run along with all other cops.

Transferring to main gem.
My summary is: you want to write a Cop that checks a set of files my_engine/* using information gathered from a (distinct?) set of files my_app/*, right?
There's clearly not an easy way to do this right now. This feels related to #7968 but goes beyond that. It feels outside the scope of RuboCop tbh, but could make for a nice gem?

My summary is: you want to write a Cop that checks a set of files my_engine/* using information gathered from a (distinct?) set of files my_app/*, right?

Yes.

but could make for a nice gem?

I agree.


Enable Changelog Verification in Java Repo

Add Changelog / Release Notes verification to the build / release pipeline.

/azp run java - spring


test(bulk-model-sync): increase timeout of JS tests

The test can handle random changes was often failing due to timeouts.
It fails because one test checks a hundred random cases.
kotlin.test does not support parametrized tests. Kotest would support it, but the Annotation Spec does not support Kotlin multiplatform.
Not wanting to decide on another testing style and rewrite the test, I just increased the timeout.
e.g. https://github.com/modelix/modelix.core/runs/23384531208

:tada: This PR is included in version 7.1.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Race condition(s) in HttpEventActor

HttpEventActor.limiter is accessed asynchronously.
Fixed in b85cef0890bd2389ea2857b6167d80cc696c1b1f.

/cc @aquamatthias backport?

Cherry picked on 0.14 and 0.15.


sqlitepp::database construct  error with  memory leak?

I had a question with the constructor of sqlite3pp::database obeject.
The sqlite_open_v2() function is called in  by  function sqlite3pp::connect() in file sqlite3pp.ipp. It means also called by sqlite3pp::database constructor function.
  database::database(char const* dbname, int flags, char const* vfs) : db_(nullptr), borrowing_(false)
  {
    if (dbname) {
      auto rc = connect(dbname, flags, vfs);                      ///< sqlite3_open_v2() is called here
      if (rc != SQLITE_OK)
        throw database_error("can't connect database");   ///< if exception throws, sqlite3_close() will not called
    }
  }

But if there is error occured, like a illegal path, the constructor function will throw exception. And sqlite3_close() function will not called, which was contrary to sqlite3 docs(https://www.sqlite.org/capi3ref.html#sqlite3_open). Sqlite3 docs declares： Whether or not an error occurs when it is opened, resources associated with the database connection handle should be released by passing it to sqlite3_close() when it is no longer required.
In fact , I can catch exception and csalled sqlite3_close() by myself. But I need to get raw sqlite3 obeject managerd by sqlite3pp. I don't know if it was designed, or there is better way to solve this question?
Thanks for help!
By the way, I tried use illegal path to make exceptions while constructing. It did have some memory leak, perhaps 70-100KB each 100 times if I  did not called sqlite3_close(). The  enviroment is win10, vs2015.

Good catch! I just pushed the change to close the db if the open is failed in the ctor.


compendium browser buttons for actorsheet

added pre filtered compendium browser buttons to actorsheet (inventory and spellbook)
added handlebars helper for lazy people like me to debug templates easier
added some localization text

Some more frontend related people might want to check the button styling. I have now idea how to make that look good

Unfortunately the only section that works for me is Weapons, all else open without filters. I don't know what else you changed, or if this is a bug on my end (somehow) 🤷♂

UI issue of note, is that the original add button is being shove awkwardly to the left. Also, a
means to identify to two would be beneficial. Perhaps renaming the original text to "Add custom"?

UI issue of note, is that the original add button is being shoved awkwardly to the left. Also, a means to identify between the two would be beneficial. Perhaps renaming the original text to "Add custom"?

Strange as this is what it looks for me:

What is different between your and my installment? maybe we need to check this together @Iankid

Looked the same for me. Did you commit your CSS?

yes, only change I did was the one in actor.less file which "fixed" it for me.
Still might need someone to do the css

Ah, it's quick insert's fault

Even looks good with Quick Insert!


missing_required_file should trigger when translations.txt exists and feed_info.txt does not

Describe the problem
feed_info.txt is required when translations.txt is provided, but missing_required_file is not triggered in this case.
Describe the new validation rule
IF translations.txt is provided AND feed_info.txt is not present, trigger missing_required_file.
In this scenario, missing_recommended_file should not be triggered.
Sample GTFS datasets
https://gtfs.irail.be/nmbs/gtfs/latest.zip
Severity
No response
Additional context
No response

Closed from #1803


contourf with lat-lon centers?

I have a set of data values that indicate the center of the grid boxes instead of the edges.
Using pcolormesh I can specify the lon, lat lists as the edges and it automatically interprets the data list as the centers (since it has one less value).
For example: len(lats) = 91, len(lons) = 181, len(data) = (90, 180)
basemap.pcolormesh(lons, lats, data, latlon=True)

This works fine and plots properly, however:

pcolormesh is very slow; I would prefer to use contourf.
pcolormesh does not provide interpolation so the basemap looks pixelated.

How can I create a contourf plot using the center of the grid boxes instead of the edges? If I change the lat, lon lists to be the centers instead of the edges to match the data list then I get missing data at the edge longitudes and latitudes.
Technically I could interpolate from grid box centers to grid box edges manually by averaging the neighboring centers to get the edges but I was hoping there was something out of the box I could use?
Or maybe there is some way to speed up pcolormesh and also apply some sort of smoothing/interpolation?
Code sample:
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

lons = np.arange(-180.0, 180.0 + 1, 2)
lats = np.arange(-90.0, 90.0 + 1, 2)
lons, lats = np.meshgrid(lons, lats)
data = np.random.rand(90, 180)

# This works to plot center of grid boxes
bm = Basemap(projection='robin', lon_0=0, resolution='c')
bm.pcolormesh(lons, lats, data, latlon=True)
plt.show()

# contourf does not work to plot grid box centers
# bm = Basemap(projection='robin', lon_0=0, resolution='c')
# bm.contourf(lons, lats, data, latlon=True)
# plt.show()

On 2018/05/29 5:52 AM, avipersin wrote:

I have a set of data values that indicate the center of the grid boxes
instead of the edges.
Using pcolormesh I can specify the lon, lat lists as the edges and it
automatically interprets the data list as the centers (since it has one
less value).
For example: len(lats) = 91, len(lons) = 181, len(data) = (90, 180)
|basemap.pcolormesh(lons, lats, data, norm=self.norm, cmap=self.cmap,
latlon=True) |
This works fine and plots properly, however:

pcolormesh is very slow; I would prefer to use contourf.
pcolormesh does not provide interpolation so the basemap looks
pixelated.

How can I create a contourf plot using the center of the grid boxes
instead of the edges? Technically I could interpolate from grid box
centers to grid box edges manually by averaging the neighboring centers
to get the edges but I was hoping there was something out of the box I
could use?

Can you just interpolate your lats and lons to get your grid on the centers?
Eric

Or maybe there is some way to speed up pcolormesh and also apply some
sort of smoothing/interpolation?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/matplotlib/basemap/issues/406, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFMhfhDNwmdt113S8M64NPj1V1qRyxWks5t3W6qgaJpZM4URwzK.

Yes, technically you can do that but then your lons are [-179, -177...177, 179] and your lats are [-89, -87...87, 89] which creates a map that is missing data all around the sides.

You can also do -181 and 181 etc by wrapping and then set the limits to +/-180.

@avipersin  longitude wraps at +/- 180 so if you originally have data at -180, -178 ...  176, 178,  then the data for newdata[-181] = newdata[179] = (data[-180] + data[178])/2.  Including that extra halow lets you get data to the edges.  (I'll assume that you don't care about missing values at +/-90 degrees latitude, becayse that would be silly).
I'm going to close because this isn't a bug, but feel free to carry on the conversation (though in the future, user-support really belongs on stackoverflow).

@jklymak I'm not sure I understand what your saying to do. The original data is actually at lon=[-179, -177... 177, 179] which are the center of the grid boxes.
In this case, if I understand you correctly, you are proposing I create a newdata variable. newdata[-180] = newdata[180] = (data[-179] + data[179]) / 2?

... something like that.  It depends how you want your data centered.  If you are fine w/ it centered where you originally have data:

newlon = np.hstack((lon[0]-2, lon, lon[-1]+2))
newdata = np.hstack((data[:, -1], data, data[:, 0]))
bm = Basemap(projection='robin', lon_0=0, resolution='c')
bm.contourf(newlon, newlats, newdata, latlon=True)

I like the idea of centering where I have data originally.  But I can't seem to get it working, how do I specify limits?
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

lons = [x for x in range(-179, 179 + 1, 2)]
lats = [x for x in range(-89, 89 + 1, 2)]
data = np.random.rand(90, 180)

newlon = np.hstack((lons[0] - 2, lons, lons[-1] + 2))
newlat = np.hstack((lats[0] - 2, lats, lats[-1] + 2))
newlon, newlat = np.meshgrid(newlon, newlat)

newdata = np.hstack((data[:, -1:], data, data[:, [0, ]]))
newdata = np.vstack((newdata[-1], newdata, newdata[0]))

bm = Basemap(projection='robin', lon_0=0, resolution='c', llcrnrlon=-180, llcrnrlat=-90, urcrnrlon=180, urcrnrlat=90)
bm.contourf(newlon, newlat, newdata, latlon=True)
plt.show()

    if fix_wrap_around and itemindex:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Oh, hmmm.  Its possible basemap is mad about the lon at -181.  So, just set to -179.9999

In case others come across this, the solution is to set lats to [-90... 90] and lons to [-180 ... 180] anything beyond those ranges will throw an error.
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

lons = [x for x in range(-179, 179 + 1, 2)]
lats = [x for x in range(-89, 89 + 1, 2)]
data = np.random.rand(90, 180)

newlon = np.hstack((lons[0] - 1, lons, lons[-1] + 1))
newlat = np.hstack((lats[0] - 1, lats, lats[-1] + 1))
newlon, newlat = np.meshgrid(newlon, newlat)

newdata = np.hstack((data[:, -1:], data, data[:, [0, ]]))
newdata = np.vstack((newdata[-1], newdata, newdata[0]))

bm = Basemap(projection='robin', lon_0=0, resolution='c')
bm.contourf(newlon, newlat, newdata, latlon=True)
plt.show()

It would be nice if contours could be plot the same way as pcolormesh.  With pcolormesh the x and y lists can be 1 greater than the values list; pcolormesh is smart enough to interpret the values in this case as grid box centers.
See here: https://stackoverflow.com/questions/43128106/pcolormesh-ticks-center-for-each-data-point-tile
Why can't that same functionality be applied to contour plots?

Pcolormesh and contourf are fundamentally different operations, even though they can be used for similar purposes.  Pcolormesh fills quadrilaterals specified by their boundaries; contour draws lines based on values specified on a grid of points.  It is up to the user to provide the appropriate grid for each.


Add files via upload

@Axcelers First stage of verification passed, official domain is beverlyschools.org as far as I verified. This is just an informational note. Pull request is still in the review. I appreciate your patience while waiting for the final decision. Proof of domain ownership: https://bms.beverlyschools.org/apps/news/article/1646016

@philipto Any update?

@Axcelers Thank you for your patience while waiting for a review and processing your request. Pull request merged.