proposal: spec: pipe operator with explicit result passing

Go Programming Experience
Experienced
Other Languages Experience
Elixir, JavaScript, Ruby, Kotlin, Dart, Python, C
Related Idea

[X] Has this idea, or one like it, been proposed before?
[ ] Does this affect error handling?
[ ] Is this about generics?
[ ] Is this change backward compatible? Breaking the Go 1 compatibility guarantee is a large cost and requires a large benefit

Has this idea, or one like it, been proposed before?
Yes, several times. This variant directly addresses the main issues brought up in those proposals.
Does this affect error handling?
Not directly, though it possible could in some cases.
Is this about generics?
Not directly, though it addresses a situation that has arisen as a result of generics.
Proposal
When a pipe operator has been proposed before (#33361), the primary issues with it were

Not enough interest.
Not explicit enough.
Might lead to APIs being written specifically to accommodate it, thus potentially making them awkward for no reason.

I think that the first point is arguable as a reason not to consider a feature, but more importantly I think that the situation there has changed and I think that #49085's continued discussion is good evidence that some way to fix the issue that a pipe operator would address is a very popular idea. With generics being added and now iterators, too, some way to write chains of function/method calls in a left-to-right or top-to-bottom manner has, I think, gained a fair bit of usefulness that it didn't have back in 2019 (#33361). Simply using methods like many other languages, such as Rust, do, has a lot of problems that have been pointed out in the above issue, but functions have none of those problems. Their only issue in this regard is simply syntactic.
Points 2 and 3, however, I think are very solvable in a simple way: Add a special variable that is defined for the scope of each piece of the pipe that contains the value of the previous expression instead of magically inserting function arguments. For example, assuming that the bikeshed is painted piped:
a() |> f1(piped, b) |> f2(c, piped)

The first |> operator creates a new scope that exists only for the expression immediately to its right, in this case a call to f1(). In that scope, it defines a variable, piped, containing the result of the expression to its left, in this case just a(). The second |> operator creates a new scope that shadows the existing piped, introducing a new piped variable containing the result of the expression to its left, in this case a() |> f1(piped, b). And so on with a longer pipeline.
This completely fixes problem 2, as it now makes piping extremely explicit. It mostly fixes problem 3 as it makes the operator significantly more flexible, reducing the need for writing APIs specifically to accommodate it. I think this not completely solvable, though, as, at some point, someone will always write something that they probably shouldn't have.
It also allows the pipe operator to become non-exclusive to function calls. Any single-value expression now becomes valid at any point in a pipeline, allowing even things like
a() |> f1(piped, b) |> S{Value: piped} |> f2(c, piped)

For a more practical example, here's some iterator usage:
// Problem: Horrendously unreadable and uneditable.
xiter.Filter(
	func(v int) bool { return v > 0 },
	xiter.Map(
		func(v string) int {
			n, _ := strconv.ParseInt(v, 10, 0)
			return int(n)
		},
		strings.SplitSeq(input, "\n"),
	),
)

// Using multiple explicit variables:
// Problem: Better than the last one in terms of readability, but
// still difficult to edit by, for example, adding or removing
// operations in the middle because of needing to avoid variable name
// reuse if types change and also being sure to pass the correct one
// to the next in the chain.
lines := strings.SplitSeq(input, "\n")
ints := xiter.Map(lines, func(v string) int {
	n, _ := strconv.ParseInt(v, 10, 0)
	return int(n)
})
ints = xiter.Filter(ints, func(v int) bool { return v > 0 })

// With this proposal:
ints := strings.SplitSeq(input, "\n") |>
	xiter.Map(func(v string) int {
		n, _ := strconv.ParseInt(v, 10, 0)
		return n,
	}, piped) |>
	xiter.Filter(func(v int) bool { return v > 0 }, piped)

Side note: I'm not a huge fan of needing to put the |> operator at the end of a line. I think Elixir's way of doing it with the operator at the beginning of each of the subsequent lines looks way better. Unfortunately, Go's semicolon insertion rules kind of make this necessary unless someone can come up with a way to do it that doesn't involve special-casing the |> operator, which I definitely think would be unnecessary. For comparison's sake, here's that same iterator chain written the other way around:
strings.SplitSeq(input, "\n")
|> xiter.Map(func(v string) int {
	n, _ := strconv.ParseInt(v, 10, 0)
	return n,
}, piped)
|> xiter.Filter(func(v int) bool { return v > 0 }, piped)

Language Spec Changes
A section would have to be added about the |> operator. It shouldn't directly affect any existing parts of the spec, I don't think.
Informal Change
The |> operator allows expressions to be written in a left-to-right manner by implicitly passing the result of one into the next in the form of a variable called piped that is scoped only to the right-hand side of each usage of |>, shadowing any existing variables named piped in parent scopes, including previous |> usages in the same pipeline.
Is this change backward compatible?
Yes.
Orthogonality: How does this change interact or overlap with existing features?
It allows a compromise between adding generic types in method calls (#49085) and function calls having poor ergonomics for certain use cases.
Would this change make Go easier or harder to learn, and why?
Slightly harder as the idea of the specially-scoped variable and its automatic shadowing of its counterparts in previous pipeline stages would have to be explained.
Cost Description
Tiny compile-time cost. No runtime costs. Slight increase in language complexity. Slight increase in potential for poorly written code as some people might misuse the operator.
Changes to Go ToolChain
All tools that parse Go code would have to be updated. gofmt and goimports would be affected the most.
Performance Costs
Compile-time cost is minimal. Runtime cost is nonexistent.
Prototype
No response

The way I'm understanding the proposal is that the following example from the proposal text...
a() |> f1(piped, b) |> f2(c, piped)

...would behave approximately like the following:
(func () {
    piped := a()
    piped := f1(piped, b)
    return f2(c, piped)
})()

Does that match what you were intending?
Do you expect that the |> operator would require that its left operand produce only one return value, or do you imagine there being some way to capture multiple return values and propagate them all forward together? (Or perhaps something else entirely that allows diverting extra return values into some other control path for error handling?)

The point about shadowing piped is well taken indeed ... I was trying to keep it as succinct as possible but really I suppose the second :> should've been expanded as its own func () { ... } too, rather than squashing them all together.
That does, however, raise an interesting point about the design:
This design does implicitly shadow the symbol piped, presumably by creating a small nested scope just for the rhs of each |> operator. It's a little quirky to have a nested scope just for one operand, without some braces explicitly marking its bounds, but I admittedly can't think of any way to make that scope more explicit that doesn't quickly degenerate into something a lot like the desugaring I tried in my previous comment.
So I guess the key question here would be: is the readability improvement of the overall feature sufficient to overcome the (admittedly subjective) readability decrease caused by an implicit scope created by some syntax that isn't like anything else in today's Go. :thinking:

I admittedly can't think of any way to make that scope more explicit that doesn't quickly degenerate into something a lot like the desugaring I tried in my previous comment and above.

This is pretty much what happened to me, too. I tried to come up with syntaxes that would involve {}, for example, but it quickly became way more trouble than it was worth.
Another difference with the desugared version is that anonymous functions like that would need to have return types.

So I guess the key question here would be: is the readability improvement of the overall feature sufficient to overcome the (admittedly subjective) readability decrease caused by an implicit scope created by some syntax that isn't like anything else in today's Go.

I don't think the scoping is a readability problem. That's just a technical detail. Thinking about it simply as "piped is the result of the expression to the left of the |>." is more than good enough and makes it quite simple to reason about.
There are some potential complications if someone tries to do something with anonymous functions or change the order of operator precedence with parentheses. Something like
f() |> func() {
  f2() |> stuff(piped) // piped is f2(), not f().
}()

// or

f() |> (f2() |> stuff(piped)) |> f3(piped)

In other words, someone explicitly creating a new scope inside of the pipeline could be a bit confusing. In the latter case, I think that's pretty simple to just not allow. Could give a error: nested pipelines are not allowed or something.
In the former case, though, that could be a problem with calling a function that takes a function argument. For example,
strings.SplitSeq(input, "\n") |>
  xiter.Map(
    func(v string) string { v + piped }, // This is weird.
    piped,
  )

Maybe it's possible to not allow access to piped from inside of anonymous functions? In other words, it would not be in scope if a new subscope was created. Alternatively, maybe give a more explicit error if an attempt is made to access it from a manually created subscope such as an anonymous function. I don't think disallowing pipelines inside of anonymous functions inside of pipelines altogether makes sense, as creating a pipeline in such a situation is not uncommon in Elixir when performing, for example, a flat map.

To be more specific about what I was concerned about with this implicit scope, some details:

Unless I'm already familiar with this syntax, there's nothing here to tell me what piped represents, where it came from, and where it goes out of scope. There are no keywords I can search for to learn more, except for this piped variable.
If I ask a gopls-supported editor to "go to declaration" on that piped variable, it would presumably need to just send me to the previous expression in the pipeline, because there is no explicit declaration of that variable. That is a small clue as to what is going on with this syntax, but not a very strong one.
Each new pipe step effectively shadows the previous piped symbol, which isn't normally allowed in Go unless there's a nested scope. Of course, there is a nested scope here, but unless the reader is already familiar with this syntax it isn't clear where that scope starts and ends.

I don't mean to say that any of what I've been saying is a showstopper. Just some reactions I had while trying to understand the meaning of this new syntax from your proposal trying to put myself in the shoes of someone who doesn't have this proposal text to help them understand what it means.
 Making it less concise makes it less valuable as a language feature, because the conciseness is the whole point of this.

In my earlier comment I alluded to https://github.com/golang/go/issues/21498 in a throwaway code comment in my code example, but it occurs to me that if we did have a more concise anonymous function syntax then it might be more defensible to do something like the earlier proposal https://github.com/golang/go/issues/33361, with the requirement that the rhs of |> must be something that can be called with all of the return values from the lhs expression, and the expectation that most of the time the rhs would be a "lightweight anonymous function".
There's still lots of debate over there about exactly which syntax to use for those functions, so I'll just pick one arbitrarily from comments near the end of that issue for an example:
a() |>
    |aResult| f1(aResult, b) |>
    |f1Result| f2(c, f1Result)

Or, the less contrived examples from the older proposal:
s := strings.TrimSpace(x) |>
    |trimmed| strings.ToLower(trimmed) |>
    |lowered| strings.ReplaceAll("/old/", "/new")

http.HandleFunc("/",
    LogMiddleware(IndexHandler) |>
    |m| SomeOtherMiddleware(m) |>
    |m| RequireAuthMiddleware(m)
)

I will concede right up front that I don't think this is substantially more readable than the original proposal, but it does at least avoid an implicit declaration of an arbitrary name in favor of having the author choose an argument name explicitly, and it supports expressions that generate more than one result. It also hopefully removes some of the mystery of what's going on for someone who was already familiar with the shorthand anonymous function syntax.
(Some of the other candidates for lightweight anonymous function syntax include the -> atom between the arguments and the result expression, which I think would make this more confusing to read due to the mix of alternating |> and -> tokens. But that's a general hazard of using assorted ASCII punctuation symbols for operators.)

I think the proposed syntax is still unreadable compared to a simple for loop:
var ints []int
for s := range strings.SplitSeq(input, "\n") {
    if n, _ := strconv.ParseInt(s, 10, 0); n > 0 {
        ints = append(ints, n)
    }
}

and of the syntaxes listed above, I think the intermediate variables one is more readable since each operation is more clearly marked. maybe I just don't mind naming the variables p0, p1, p2, ..., and letting the unused var checker catch failing to pass it to the next operation.
and I don't see the point of f() |> |name| g(name), just use real intermediate variables instead of trying to create a one-liner.

and I don't see the point of f() |> |name| g(name), just use real intermediate variables instead of trying to create a one-liner.

The problem isn't trying to create a one-liner. It's ability to edit the code later. Using intermediate variables is highly error-prone. For example, let's say I'm constructing some pipeline that needs to do a map and then a filter, and then I come back later and need to insert a new filter in between the existing map and filter. The following happens:
mapped := xiter.Map(mapFunc, seq)
filtered := xiter.Filter(filterFunc, mapped)

// later

mapped := xiter.Map(mapFunc, seq)
filtered := xiter.Filter(insertedFilterFunc, mapped)
filtered = xiter.Filter(filterFunc, mapped) // Accidentally left mapped the same.

It might seem trivial in an example like this, but in larger, more complicated pipeleines it can be a real issue.

I think the proposed syntax is still unreadable compared to a simple for loop:

That's a valid argument, but there are things that literally can not be done with the for loop variant because it requires an intermediary slice. Iterators allow you to pass unevaluated loops around as data. That being said, an argument could certainly be made, given that iterators are just functions in Go, that you could write that as
ints := func(yield func(int) bool) {
  for s := range strings.SplitSeq(input, "\n") {
    if n, _ := strconv.ParseInt(s, 10, 0); n > 0 {
      if !yield(n) {
        return
      }
    }
  }
}

and instead of constructing a pipeline of map/filter/whatever function calls. That's essentially what I've been doing myself in my code because of how unergonomic such pipelines currently are.

@apparentlymart
I like that. Even without anonymous functions, just changing it to require a manual naming of each pipeline stage is a good one. That also allows you to put the name on the next line, somewhat avoiding the problem with previous lines ending with |> instead of next lines starting with it, as I think that putting that at the end causes some readability issues as I mentioned in the original proposal. It also avoids the problems with editing pipelines that I mentioned above that would happen with simple intermediate variables, as well as allowing name reuse even when types change.
One thing that could be confusing, though, is what exactly the scope of those names is if the naming is part of the |> syntax itself and not simply an anonymous function argument. Does it continue into the next stage of the pipeline?

Since I was imagining these as just normal anonymous functions, of course for me these symbols exist only inside the function just like any other function argument.
That does admittedly mean that if you want to make additional use of some value at a later pipeline stage then that would need to be done manually somehow, rather than the symbol automatically being in scope. None of the motivating examples we discussed so far required that sort of thing, so I didn't try to solve for it.
My initial instinct is that if you need more than just directly propagating the results from one expression into the directly-following expression then you should probably use a different technique so you can manage the symbols more explicitly. This proposal is already in a tricky part of the concise vs. readable vs. maintainable tradeoff and so I expect that complicating it any further would topple the scale.


Encrypted file workflow

@benhylau

A file is uploaded to the webhook, and stored unencrypted on the disk. AA is populated with its metadata.
(Optional) The user runs genkey file and an encryption key is stored in the key folder with the name <cid>.key
The user runs encrypt bafy1..., encrypting the file with a new random key. The encrypted file is stored under its CID (bafy2...) in the encrypted files folder.
The key is stored under bafy2....key.
AA now has a relationship stored between the unencrypted and encrypted assets. The encrypted asset has additional metadata like  encryption_type: secretstream.
The user runs upload drive:/foo bafy2.... The encrypted file is uploaded to Google Drive. That upload is logged to AA under the encrypted file's CID, under the attribute uploads.

Now that the encrypt tool has been committed, this workflow is actually possible and works.

Decryption

Verifier person gets the file from Google Drive
They can assume the file is encrypted with secretstream, or use the attr CLI tool against our AA instance to verify the encryption type by looking at the encryption_type attribute.
They must contact Starling Lab out of band to receive the key. Possibly it was already sent to them, for example included in that private Google Drive folder.
They run decrypt -i bafy2... -k bafy2....key -o my_clear_file and the decrypted file is now available.
Due to secretstream, they can be sure the encrypted file bytes were not modified or truncated, and the decrypted output is the whole original file unmodified.

Good point. I was assuming they wouldn't have access to bafy1... as it is secret. But even without access, they can perform a final verification step by creating a CID for their decrypted file, and comparing that against the CID of the original plaintext file, bafy1.... This CID will be available to them in AA, for example listed as a parent relationship of bafy2....
Due to the secretstream encryption algorithm, there should be no scenario where the decrypted file does not match the original. However checking the hash is still important, in case Starling Lab accidentally sent the wrong encrypted file, or the verifier accidentally decrypted the wrong one.


AMG: Set service-account token default TTL to 1 day

Related command

az grafana service-account token create
General Guidelines

[x] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
[x] Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
[x] My extension version conforms to the Extension version schema

Thank you for your contribution! We will review the pull request and get back to you soon.


[New Feature] Commands to support mp4 to mp3 conversion

Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
I have a lot of live music videos in my bilibili fav that I would like to be able to convert to audio format to make it easier for me to listen to it in other music programs.
Describe alternatives you've considered
I think ffmpeg already provides this capability, so implementing it shouldn't be very difficult. What we might be uncertain about now is which command Fav needs to add to support it
Additional context
No

Actually, fav download video and audio separately and merge them with ffmpeg.  You may think add fav pull --audio naturally.
However, current implementation is through SaveLocal trait, which only supports one kind of resource.
https://github.com/kingwingfly/fav/blob/729e9fc6b30fd9559032ac4cb407de26385f301e/fav_utils/src/bili/local.rs#L26-L27
In this case, it only supports videos.
Although it's easy to add a download_video method, it seems not graceful, and fav daemon, which is the command I used most, cannot know whether I only want audio or not, maybe leading fav to do wrong thing.
Then I think the best way may be follow the Unix Philosophy:
for file in *.mp4; do ffmpeg -i "$file" -vn -c:a copy "${file%.mp4}.m4a"; done

Because audios from bilibili are aac-encoded, so just copy as m4a is OK.

Actually, fav download video and audio separately and merge them with ffmpeg. You may think add fav pull --audio naturally.
However, current implementation is through SaveLocal trait, which only supports one kind of resource.
https://github.com/kingwingfly/fav/blob/729e9fc6b30fd9559032ac4cb407de26385f301e/fav_utils/src/bili/local.rs#L26-L27
In this case, it only supports videos.
Although it's easy to add a download_audio method, it seems not graceful, and fav daemon, which is the command I used most, cannot know whether I only want audio or not, maybe leading fav to do wrong thing.
Then I think the best way may be follow the Unix Philosophy:
for file in *.mp4; do ffmpeg -i "$file" -vn -c:a copy "${file%.mp4}.m4a"; done

Because audios from bilibili are aac-encoded, so just copy as m4a is OK.

Very well, I will try to use a shell script to replace this process. Meanwhile, your answer has made me very interested in this downloading process.


chore(docs): spelling and grammar fixes

What ❔

Why ❔

Checklist

[ ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
[ ] Tests for the changes have been added / updated.
[ ] Documentation comments have been added / updated.
[ ] Code has been formatted via zk fmt and zk lint.
[ ] Spellcheck has been run via cargo spellcheck --cfg=./spellcheck/era.cfg --code 1.

Closing as stale


flutter has exited unexpectedly

Flutter crash report; please file at https://github.com/flutter/flutter/issues.
command
flutter build bundle --suppress-analytics --target F:\EXP\quiz\lib\main.dart --filesystem-scheme org-dartlang-root --track-widget-creation --depfile F:\EXP\quiz\build\app\intermediates\flutter\debug/snapshot_blob.bin.d --asset-dir F:\EXP\quiz\build\app\intermediates\flutter\debug/flutter_assets --debug
exception
FileSystemException: FileSystemException: Deletion failed, path = 'F:\EXP\quiz\build\app\intermediates\flutter\debug/flutter_assets' (OS Error: Access is denied.
, errno = 5)
#0      _Directory._deleteSync (dart:io/directory_impl.dart:207:7)
#1      FileSystemEntity.deleteSync (dart:io/file_system_entity.dart:466:47)
#2      ForwardingFileSystemEntity.deleteSync (package:file/src/forwarding/forwarding_file_system_entity.dart:72:16)
#3      writeBundle (package:flutter_tools/src/bundle.dart:202:15)
<asynchronous suspension>
#4      assemble (package:flutter_tools/src/bundle.dart:195:9)
<asynchronous suspension>
#5      build (package:flutter_tools/src/bundle.dart:128:9)
<asynchronous suspension>
#6      BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:89:11)
<asynchronous suspension>
#7      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:401:18)
<asynchronous suspension>
#8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:335:33)
<asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#10     _rootRun (dart:async/zone.dart:1124:13)
#11     _CustomZone.run (dart:async/zone.dart:1021:19)
#12     _runZoned (dart:async/zone.dart:1516:10)
#13     runZoned (dart:async/zone.dart:1463:12)
#14     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#15     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:326:20)
#16     CommandRunner.runCommand (package:args/command_runner.dart:196:27)
<asynchronous suspension>
#17     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:401:21)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#19     _rootRun (dart:async/zone.dart:1124:13)
#20     _CustomZone.run (dart:async/zone.dart:1021:19)
#21     _runZoned (dart:async/zone.dart:1516:10)
#22     runZoned (dart:async/zone.dart:1463:12)
#23     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#24     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:361:19)
<asynchronous suspension>
#25     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:111:29)
#26     new Future.sync (dart:async/future.dart:224:31)
#27     CommandRunner.run (package:args/command_runner.dart:111:11)
#28     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:241:18)
#29     run.<anonymous closure> (package:flutter_tools/runner.dart:60:20)
<asynchronous suspension>
#30     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142:29)
<asynchronous suspension>
#31     _rootRun (dart:async/zone.dart:1124:13)
#32     _CustomZone.run (dart:async/zone.dart:1021:19)
#33     _runZoned (dart:async/zone.dart:1516:10)
#34     runZoned (dart:async/zone.dart:1463:12)
#35     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
<asynchronous suspension>
#36     runInContext (package:flutter_tools/src/context_runner.dart:43:24)
<asynchronous suspension>
#37     run (package:flutter_tools/runner.dart:51:10)
#38     main (package:flutter_tools/executable.dart:51:9)
<asynchronous suspension>
#39     main (file:///E:/b/build/slave/Windows_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#40     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#41     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

flutter doctor
[✓] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17763.292], locale en-IN)
    • Flutter version 1.0.0 at S:\flutter
    • Framework revision 5391447fae (3 months ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at S:\SDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!

Duple of: https://github.com/flutter/flutter/issues/23519


Remove lodash

Prior to creating a pull request, please follow all the steps in the contributing guide.
Related #3032
Description of what's changed/fixed.
Because lodash was only used by packages/workbox-build/src/templates/sw-template.ts and was just using lodash.template, I rewrote it in a simple function to remove lodash dependency.

Closing this PR due to maintenance clean up.


prestige button not working

Got this error when pressing the prestige button in the skill menu:
[Skill Prestige] This mod failed in the Input.ButtonPressed event. Technical details:
InvalidOperationException: Sequence contains no matching element
at System.Linq.ThrowHelper.ThrowNoMatchException()
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)
at SkillPrestige.Framework.Menus.SkillsMenuExtension.OpenPrestigeMenu(Skill skill) in E:\Personal Files\Git Repos\SkillPrestige\SkillPrestige\Framework\Menus\SkillsMenuExtension.cs:line 151
at SkillPrestige.Framework.Menus.SkillsMenuExtension.<>c__DisplayClass6_0.b__0() in E:\Personal Files\Git Repos\SkillPrestige\SkillPrestige\Framework\Menus\SkillsMenuExtension.cs:line 97
at SkillPrestige.Framework.Menus.Elements.Buttons.TextureButton.OnButtonPressed(ButtonPressedEventArgs e, Boolean isClick) in E:\Personal Files\Git Repos\SkillPrestige\SkillPrestige\Framework\Menus\Elements\Buttons\TextureButton.cs:line 52
at SkillPrestige.Framework.Menus.SkillsMenuExtension.OnButtonPressed(ButtonPressedEventArgs e, Boolean isClick) in E:\Personal Files\Git Repos\SkillPrestige\SkillPrestige\Framework\Menus\SkillsMenuExtension.cs:line 42
at SkillPrestige.ModEntry.OnButtonPressed(Object sender, ButtonPressedEventArgs e) in E:\Personal Files\Git Repos\SkillPrestige\SkillPrestige\ModEntry.cs:line 90
at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101

thank you for your report,
did you test it on a new savegame or an existing one?
Do you use one ore both of the luck and magic prestige extensions?
If you use an existing save can you provide it to me?
I guess the issue is related to how the skill prestige Basemod manage to check if a skill is the right one

A totally new save with just the magic and the magic prestige mod found here https://forums.stardewvalley.net/threads/unofficial-mod-updates.2096/page-27#post-23768.


[ADD] Class for treating flattened embedding weights with a pre-conditioner

As requested by @yorkerlin, this PR adds the functionality to treat flattened weight matrices of embedding layers.
With this option, we can reshape W (2d) into vec(W) (1d), and use a pre-conditioner that consists of a single Kronecker factor (usually equipped with diagonal structure). This allows training embedding layer weights with inverse- and root-free RMSProp.

Added tests, thanks!


tools for processing YT-Storyboad-1B

Inspiring work about multimodal transformer!
Would you please share how to download storyboard images and subtitles from youtube videos? It would be better if you release your YT-Storyboad-1B dataset!

Thank you for your interest in our work. We have provided the collection tools for YT-Storyboad-1B dataset. Please check it out.


Put default configuration in /etc/newrelic rather than /var/db/newrelic

Currently, the Dockerfile copies the integration config to /var/db/newrelic-infra/integrations.d/nri-kubernetes-config.yml:
https://github.com/newrelic/nri-kubernetes/blob/c87090aa031b06c1c714e529008ea3fa63f4c8d7/Dockerfile#L12
This makes it hard for the user to override this file, specially when the helm chart is in use. This file could instead be dropped in /etc/newrelic-infra/integrations.d/, where the user is allowed to create (and therefore override) files with the integrations_config property of the helm chart.

Also to support the possibility to change the interval of the integration the config file should be changed to the new configuration format (v4)  since the current one defines the interval in the definition.yml file.

Indeed, we need to keep this in mind. However the change should not be very complex, and there would be no breakage since there are no packages for nri-kubernetes.

Now in "develop" the configuration is hosted in "FilePath = "/etc/newrelic-infra/integrations.d/""


docstring support

Description
Please render Python docstrings in cells as Markdown above the cell.
"The functions in this cell..."

I'm coming to Marimo as an old time Python programmer. I'm loving the predictable execution order—thanks!—but it feels odd to have to create dedicated cells to provide narrative text before some code.
Python, you see, has long provided a method for exactly this purpose: the humble docstring (Pandas docs).
def __():
    """This text is a function's docstring."""
    return

Please render my docstrings as Markdown above the code whenever the code is hidden.
Suggested solution
I dug into the app.cell decorator, and confirmed it could take the function's docstring and put it somewhere useful. I tried hacking it in as a replacement for an empty last_expr, but that's a terrible idea. What if you need both? You'll know what to do. It might even be quick, and fun.
Alternative
Marimo could support plain Markdown cells with always-hidden code, provide a WYSIWYG editor for them, and provide an upgrade path by spotting the characteristic shape of the older way of doing it:
@app.cell(hide_code=True)
def __(mo):
    mo.md("Automatic Markdown would be _so nice_.")
    return

That's has less of your "everything you type is Python" vibe, though.
Additional context
If you put a string at the top of a Python file, that string becomes that module's documentation, available as __doc__. You'll see it if you run help on the REPL, and it's the basis for the automatically rendered docs for the Python standard library and other Python packages.
You can also get to it from inside your Python code:
>>> import os, sys, inspect, textwrap
>>> doc = inspect.cleandoc(sys.__doc__)
>>> print(textwrap.fill(doc, 78, max_lines=2))
This module provides access to some objects used or maintained by the
interpreter and to functions that interact strongly with the [...]
>>>

The same is true of a function:
>>> import marimo
>>> app = marimo.App()
>>> @app.cell
... def __():
...     """This would be awesome rendered to Markdown and displayed
...     above the cell."""
...
>>> doc = inspect.cleandoc(__.__doc__)
>>> print(textwrap.fill(doc, 78))
This would be awesome rendered to Markdown and displayed above the cell.
>>>

Ruff's Black-compatible formatter can handle Markdown fenced code in docstrings as of astral-sh/ruff#9030. So, this change would go particularly well with #546 to cover the edge case of someone putting Python code in their Python docstrings.
The MyST Markdown parser includes support for LaTeX markup for math and equations, and can be used across any project's documentation including its docstrings with sphinx-autodoc2's autodoc2-docstring and other supported extensions. Imagine, out of the box, being able to type the following into the top of a cell:
"""
Since Pythagoras, we know that {math}`a^2 + b^2 = c^2`.

```{math}
:label: mymath
(a + b)^2 = a^2 + 2ab + b^2

(a + b)^2  &=  (a + b)(a + b) \\
        &=  a^2 + 2ab + b^2
```

The equation {eq}`mymath` is a quadratic equation.
"""

… and have it come out like this:

Thanks for taking the time to write such a thoughtful feature request.
Re: rendering docstrings as markdown
We may be able to support something like this; an implementation quirk of our runtime is that cells are represented as just a block of code, not wrapped in a function ... but we could keep them as functions, which would let us easily access the docstring and include it as part of the cell's output.
Stepping back, as a user, which would you prefer: rendering docstrings as markdown, or a WISYWIG markdown editor?

I thought about this recently because I have the pattern
@app.cell
def _my_fn(np, other_libs):
  def fn(a,b,c):
    """doc string"""
    # logic
    return whatever
  return fn

and then in my __init__
def unwrap_mo(fn):
  return fn()
from notebook import  _my_fn
my_fn = unwrap(_my_fn)

to enable easier importing from another notebook and using fn directly. Proposal for less friction:
@app.fn
def my_fn(a, b, c, *, np, other_libs): # Abuse * to separate user vs graph arguments
    """doc string"""
    # logic
    return whatever

Which is much cleaner than the nested functions for off editor changes.
In editor, the cell could render the doc string as markdown output. Need a bit of thought into how to make args editable, but name is already present, so maybe cue off name? Allow the user to set name to something like my_fn(a,b,c) which is then appropriately parsed. This is nice because it'll be instantly compatible with the markdown format too, since name is already carried. Plus doesn't need any UI change.
Implementation-wise, @app.fn could just make a cell under the hood, wrap the function in a formatter as output, and then declare my_fn as the only def.
assertions

name does not contain a , *, since that's used for graph defs
args do not interfere with global defs (potentially lead to confusion)


Volumes not working on Mac Kitmatic

Expected behavior
I would expect the Finder window that comes up to interactively work with the Docker container.
Actual behavior
The container will not even boot.  In the container log it flashes '0 logs for this container', but I never get any more info and the container never starts.
Information about the Issue
macOS Sierra 10.12.2
iMac 5K
Steps to reproduce the behavior

Download the "hello-world-nginx' image
Click on the folder under the "VOLUMES" section of the right sidebar
Try to start the container

I'm unable to reproduce this - I can mount any of my Desktop folders as volumes and get the proper behavior.
Where is volume located?

Sorry I should have updated the bug.  I figured it out later.  The problem was that I didn't have "File Sharing" in my "Mac Docker" app setup correctly.    So it seems you have to have the root of the files shared out via "Mac Docker" before you can use them via Kitematic.  Once I shared them out from "Mac Docker" they all started working fine.


Migaloo v4

Migaloo v4 will be released "a week or two" after v3.
This will allow the v3 release to contain no changes other than upgrading x/wasm, ibc-go, and cosmos-sdk.
#138
That is quite frankly more than enough.

#142
#150

makes sense for v4 I think


yarn generate Throws error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type, check the docs for extending types

When running yarn generate, after generating the prisma client, yarn throws this error and stops. Prisma and nexus version used are the default ones when creating a project via CLI, node version is 16.14.0

Using 'pal c' to create a "full-stack-nextjs" project has the same problem

I found the error too, the prisma package version of paljs is not a correct one , 3.16 for node14 should be reverted to 3.15
Just overwrite the prisma with:
yarn install<EMAIL_ADDRESS><EMAIL_ADDRESS>

I temporarily solve this issue by following the steps I listed in another issue, hope this helps!

This issue request is in #284

Issue still exists. Project was created on CLI using the full-stack-nextjs
Error shows:
return new Error(`${name} was already defined and imported as a type, check the docs for extending types`)
           ^
Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type, check the docs for extending types


Add collaborators to this repo

Comment below to be added as a collaborator
We will all be using this repository today. Even though it's public right now, you will not be able to make changes until you're given the correct permissions. We've automated this process via the GitHub API. Once you comment, we will add you as a collaborator.
You'll start to receive a lot of emails. (❗) You can slow these down immediately by clicking the Unwatch button at the top of the page and selecting either the Participating and @mentions or Ignore option.

hello

test

🙏

Hello, nice to meet you 👍

git gud

hello

Hi All

Hi All


Add uv tool upgrade-all

I think it would be helpful to add a uv tool upgrade-all subcommand to upgrade all installed tools, like pipx upgrade-all.

You can do uv tool upgrade --all.

Ah, thanks. Sorry I missed that.


Implement distributed event dispatcher

The event dispatcher will need to be implementation agnostic with a SQL Event dispatcher variant.

This should use C# async/await.

Raised #108 to fix the issues with the memory based implementation.


Post to Slack when ci.yml fails on main

See https://github.com/hypothesis/checkmate/pull/735 for the failing tests

Rebased...


No documentation to pass in postgres ssl certificate

How do we pass in the certificate for ssl connections while using postgres connector?

My environment has option for postgres or mongo. But both of them require me to pass a certificate to authenticate. Is it possible to use prisma in my scenario?

@mavilein @do4gr @nikolasburk @timsuchanek Can one of you please take some time and help us answer this query. Even I have the same issue. Our database needs to be called with certificates and when I pass these certificates there is nothing that happens. Looks like Prisma drops these certificates and thus no connection gets established. Can you help us out here?

@yesprasad : Thanks for pinging. 🙏 We currently don't support SSL certificates but we are working on it right now: https://github.com/prisma/prisma2/issues/568

Hope to see this in prisma2


Unauthenticated mode for GitHub

If GitHub() is called with no username/password-pair and no token, don't add authorization=None to headers.

Thanks for your contribution! What issue does this solve?

It resolves bad credentials (authorization=None), if i want to use the github api to fetch data without authenticating.
Without the patch:
>>> gh = GitHub.GitHub()
>>> rc, data = gh.repos["jpaugh"]["agithub"].tags.get()
>>> rc
401
>>> data
{u'documentation_url': u'https://developer.github.com/v3', u'message': u'Bad credentials'}
>>>

With the patch:
>>> gh = GitHub.GitHub()
>>> rc, data = gh.repos["jpaugh"]["agithub"].tags.get()
>>> rc
200
>>> data
[{u'commit': {u'url': u'https://api.github.com/repos/jpaugh/agithub/commits/7c6b4e5a41d1667bca309fea64af0a7671805a63', u'sha':
...

Awesome!


Sourcemap doesn't recover original names

See https://github.com/rollup/rollup/issues/101

fixed in 0.7.0


upgrade intl version to  0.18.0

Because awesome_notifications 0.7.4+1 depends on intl ^0.17.0 and no versions of awesome_notifications match >0.7.4+1 <0.8.0, awesome_notifications ^0.7.4+1 requires intl ^0.17.0.
And because every version of flutter_localizations from sdk depends on intl 0.18.0, awesome_notifications ^0.7.4+1 is incompatible with flutter_localizations from sdk.
So, because mana_local_news depends on both awesome_notifications ^0.7.4+1 and flutter_localizations from sdk, version solving failed.
exit code 1
I can not able to build project because of this awesome notofications using intl 0.17.0 version

dependency_overrides:   intl: ^0.18.0
i have seen fix thank you


user_status inside the select tag

previously when we want to change the status we don't get option when we want to change the user-status .
so I provided options when user want to change the status with active and inactive options. here is the image

part of :#15689

Could you squash your commits, please?

I have run this locally. And there are a few things that need to be fixed:

The select box needs styling.
When you click in a status option it's not really changing the user status, as you can see buddy list in the side.
After you click in the selection box and then in the status option, the user popover should be closed.
I'm not sure about the 4th point, but:
In my opinion, if the user is "Active" then the only option that should be shown in the dropdown is the "Inactive" option. But if that is not the case, then I guess it should have an empty option tag to give a space between the dropdown options and the selection box.

I am sorry about the commit message, I forgot to delete it correctly.while sqashing.

It is unusable for me. Clicking the select status box hides the whole popover. Also, the select box needs to be properly aligned. Add some right padding. Your commit message should be as described in https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-messages

You should reference the issue in the PR description, not in the PR title.

You should add a GIF showcasing the new UI to the PR description.

@Gittenburg should I have to make changes in it.

I don't understand what you mean. Another thing I just noticed is that we should display "Unavailable" instead of "Inactive".

If you mean this PR by "it", yes the commit message should say "part of" instead of fixes and we should name the select option "Unavailable" instead of "Inactive"

Is this the only change that I have to do.

I still find $(".status_info option:selected").val() very weird, $(".status_info").val() should do the same.

I still find $(".status_info option:selected").val() very weird, $(".status_info").val() should do the same.

It's all done .so should I stop working on this PR

@Gittenburg ,
Is this okay.

The icon next to the user name  should also update when you change your status.

The icon next to the user name  should also update when you change your status.

hey tried and, I add the code "" in between line like this {{this.description}}
But before when we change the status the popover just hide so it changes
Now in this PR when I add this code  , the popover does not closes show it does not show when we choose option . change is shown only then when popover is once closed and opened again .
so do you have any other idea what should I do to change when option is choose

You can add an id to the <span class="{{user_circle_class}} ...> and then change the CSS class with jQuery on status change.

@Gittenburg
It's done .

Looks good! The commit messages still need to be fixed according to https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-messages (can be done with an interactive git rebase).

Squash both commits.
Change the first line of the commit message to user_popover: Use <select> for active/unavailable setting.
Fix the typos.

Hey you should not merge master, you should rebase your branch on top of master.

Hey you should not merge master, you should rebase your branch on top of master.

first I have rebased a commit , but then I am getting the error in production so I pull the changes from master so one, extra commit is made but then I squash both the commit and push the commit back

@timabbott , can you check if this okay .

As I mentioned in PMs, the commit doesn't follow our commit guidelines.  I think you just updated the PR description rather than the commit message?

@timabbott , I have updated the commit message .

@timabbott can you review it.

@timabbott can you review.


Add note about where to find up to date info

I came across this repository in search of federated pull request for gitea (https://github.com/go-gitea/gitea/issues/184), and at the outset this project as a whole seems to be dead.
But it isn't! 🌱
I've updated the readme with @bill-auger's response from https://github.com/forgefed/forgefed/issues/24#issuecomment-461371494
cc @yookoala @Arkanosis

the forum information needs updating actually - the socialhub forum has not worked out as well as we had expected - as of last week, there is a new forum on the FENEAS website; which has a primary category for ForgeFed discussions
https://talk.feneas.org/c/forgefed
there is sufficient reason to believe that it will be better-maintained and reliable going forward; and that it would be best to start using that one before there become too many links pointing to the socialhub forum - we expect that the FENEAS will be the stable community forum into the future
i have updated the pinned issue #24 with the new information - the entire "ForgeFed Community Forum" section should be changed in this PR

there is also an updated README on the notabug repo https://notabug.org/peers/forgefed
ideally this and the notabug repos should be mirrors of each other

i suppose i should have tried this sooner; but i was able to mirror the notabug repo as a second repo to this 'forgefed' organization - i will try to keep them in sync for now
https://github.com/forgefed/forge-fed

@bill-auger ah that's definitely a start! 🎉
i'll leave this open in case the person with write access wakes up from their slumber and decides to perform one last action as maintainer :~

@bill-auger might be worth the effort to write in the description field github has that it's a mirror, and link to the notabug repo in the website field

its not possible - the only thing that anyone else can do on this repo is to moderate the bug tracker - but no work was ever added to this repo, so there will be no bugs filed - and there is a proper discussions forum now; so there is not much to do on this repo at all, unless koala wants to revive it someday

@bill-auger ah sorry, i meant on your newly created repo. surely it should be possible to direct folx to the notabug repository both in the description and website fields there ^_^

looks like this has since moved also?
https://socialhub.network/t/moving-to-talk-feneas-org/629
On Fri, Jul 5, 2019, 3:46 AM Alexander Cobleigh<EMAIL_ADDRESS>wrote:

I came across this repository in search of federated pull request for
gitea (go-gitea/gitea#184 https://github.com/go-gitea/gitea/issues/184),
and at the outset this project as a whole seems to be dead.
But it isn't! 🌱
I've updated the readme with @bill-auger https://github.com/bill-auger's
response from #24 (comment)
https://github.com/forgefed/forgefed/issues/24#issuecomment-461371494
cc @yookoala https://github.com/yookoala @Arkanosis
https://github.com/Arkanosis
You can view, comment on, or merge this pull request online at:
https://github.com/forgefed/forgefed/pull/26
Commit Summary

add note about where to find up to date info

File Changes

M README.md
https://github.com/forgefed/forgefed/pull/26/files#diff-0 (19)

Patch Links:

https://github.com/forgefed/forgefed/pull/26.patch
https://github.com/forgefed/forgefed/pull/26.diff

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/forgefed/forgefed/pull/26?email_source=notifications&email_token=AABZCVZC76ZWHCE26YDGL4LP54KAJA5CNFSM4H6JW35KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5QTATA,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABZCV35URDPO44M2UGJXPLP54KAJANCNFSM4H6JW35A
.

techknowlogick -
that one change is not enough - the preceding paragraph also
mentions socialhub as the forum host
i have updated the pinned issue #24 with the new information -
the entire "ForgeFed Community Forum" section should be changed
in this PR

@bill-auger not sure if by "wipe" you mean delete or overwrite, but this repo has quite a few stars & watchers which could help with getting more people onboard.

just a confusion of terminology - "this" thing that has "stars"
and "watchers" is not a "repo" -  it is a forge website (a
project management tool), which is used by some, but not all,
contributors to the over-all forge-fed project - there is much
more to a forge than a VCS repo - a forge may include a git
repo, but also several other optional things that are orthogonal
to version control, such as a wiki, this issue tracker, mailing
lists, forums, and other bells and whistles
the actual "repo" containing contributions to the forge-fed
project is currently mirrored on three different forges: github,
pagure, and notabug (and on several of the contributors local
machines) - currently, the only project management tool that can
be easily shared across different forges is the VCS repo; but
that is exactly the problem that forge-fed aims to solve

What would it take to get said person to transfer ownership of the repo and/or org?

there is no ownership of an organization - that is exactly
what distinguishes them from repos under per-user namespaces -
organization have a permissions system which determines which
people can perform certain actions, such as write access to
certain repos
what it would take, is about 20 seconds and 3 mouse clicks, if
that person wanted to do it - but AFAIK, he has not read or
interacted with this bug tracker or the repo in over a year
FWIW, the current repo is mirrored on several different servers
now, including another repo associated with this github
organization, and there is a proper web forum for discussions
now, and also a mastodon presence; so there is not such urgency
to maintain this repo as there was last year

Uggh, what happened to this repo now?
Why was not this PR merged?
Can anyone clean up the confusion.

I just came in here thorough links (gitea) and only see troubles in this PR, but really don't want to read it all. Mark this as deprecated, if you have a new repo??

rugk -
please do read threads before posting - your questions have been
asked and answered already - you should not expect anyone to
answer them again only for your benefit - that is common
netiquette

This is a huge thread and I've asked for a small summary…
Also there are multiple threads/issues in here already and this does not really help anyone, if one has to dig through a whole repo to find out what's up here…

yes this repo fell into an unfortunate state of neglect - that
is why there is a single "pinned issue" explaining the current
status - it is the most that can be done with this repo
https://github.com/forgefed/forgefed/issues/24

Merging can be performed automatically with 1 approving review.

AFAIK you just need to review it. But approving! Not only comment…

@rugk I approved it, and it showed me a different message saying that only an admin can merge pull requests.


Uptime cannot display days

As the fig shows, some detail information is loss

ill look into this tommorow

fixed it but found another issue where the program would crash if the console title has foreign characters, once thats fixed ill have a new release up

fixed in v1.1.2

uptime can't display months either, working on a fix for this

fixed in v.1.1.3


Deploying Definition/Composition using Helm conflicts with secret injection for provider

What problem are you facing?
I deploy my definitions and and compositions using a Helm chart. I also use KCL in my Composition.
When rendering the helm chart to deploy all the compositions/definitions, it errors out because it thinks the secret reference is a sprig function
Excerpt from Composition
              headers = {
                "Authorization" = [ 'Bearer {{ bearerToken:crossplane-system:http-provider-config-gitlab }}' ]
                "Content-Type" = ["application/json"]
                "User-Agent" = "Crossplane"
              }

Error from Helm Template:
helm template . --set image.repository=xpkg.upbound.io --set gitlabProvider.enabled=true --set httpProvider.enabled=true | yq  -y '. | select(.kind == "DeploymentRuntimeConfig")' | kubectl apply --context kind-kind -f -
Error: parse error at (crossplane-compositions/templates/apis/XLdapGroup/ldap-kcl-composition.yaml:45): function "bearerToken" not defined

Use --debug flag to render out invalid YAML
error: no objects passed to apply
make: *** [Makefile:18: install-providers] Error 1

How could Crossplane help solve your problem?
Moving credentials to a ProviderConfig like other providers would improve this instead of codifying in the DisposableRequest.spec.forProvider.headers

Hi,
To resolve this error, you can escape the curly braces so that Helm doesn’t try to process them as template syntax.
Here’s how you can modify your Composition to escape the curly braces:
headers = {
  "Authorization" = [ 'Bearer {{`{{`} bearerToken:crossplane-system:http-provider-config-gitlab {{`}}`}}' ]
  "Content-Type" = ["application/json"]
  "User-Agent" = "Crossplane"
}

While keeping credentials in ProviderConfig works for most providers, in this case, each Request manages a different resource with unique sensitive data, making it too dynamic. Keeping secrets within each Request offers better flexibility and control.
Please give the escaping method a try and let me know if it resolves your issue. If you have any further questions or concerns, feel free to reach out.

That did the trick. your example was missing one closing brace on the left side...but managed to sort it out. I had look at escaping mechanisms...i was doing it wrong.
"Authorization" = [ 'Bearer {{`{{`}} bearerToken:crossplane-system:http-provider-config-gitlab {{`}}`}}' ]

Thanks for the help. Closing issue


Yuiknb

Make sure you've ran one of the remap-functions BEFORE you open up a new issue. This is mandatory for the files you need for this issue
Describe your desired behaviour / problem:
What button do you want to remap and what new function should be available?
Attach a picture of your screen, including the buttons beside it (IDs must be readable / shown!):
Drag and drop a picture here and wait for the upload to be finished!
Attach the configurationmanager.res file out of the /backup/buttons folder:
Drag and drop the mentioned file here and wait for the upload to be finished!

Merci

Invalid request. No details provided.


Feature Request: Expose getCurrentLocation function

I'm using the react-routers match function both client side and server side (I have my reasons). At the moment I'm doing this:
import { createLocation, createHistory } from 'history';

const history = createHistory();
const appLocation = createLocation(
  location.pathname + location.search
);

Which works but isn't very clean IMHO. It would be cool if getCurrentLocation was exposed on the history instance so I can turn the above into:
import { createHistory } from 'history';

const history = createHistory();
const appLocation = history.getCurrentLocation();

As always, I'm willing to submit a PR if authors are interested in this.

Can't you just take the location from the first history.listen callback?

history.listen is called internally in react-router.

Similarly, we have our reasons for not exposing getCurrentLocation. match was never intended to be public API.
Instead of describing how our API should change, why don't you try describing what you're trying to do? There's probably a better way to do it.

match was never intended to be public API

This seems to imply that there is another way to do server side rendering using React-Router that allows for 302/404/500's, but match is what the current docs state. If this is not the intended public api for server rendering that allows for redirects, that what is the appropriate api?

why don't you try describing what you're trying to do?

I'm running an Universal React app. IMHO that means the api client side and server side shouldn't be vastly different. With that being said it seems the best way to do that is to use match client side as well as server side.
match requires a location object to work, while client side, Router requires a history object. So I end up creating both a history object and a location object client side to initiate my app to preserve the symmetry that I love while building Universal JavaScript apps. While I can create both a History object and a Location object client side, it is hacky to have to create both of them separately when History can create one internally and return it to me synchronously.

Gah, sorry. I misspoke. match is definitely public API. getCurrentLocation isn't.

Yes, that makes sense now, but what is the issue with adding a synchronous method to retrieve the current location object? Or what would be a better solution for the use case above?
https://github.com/rackt/react-router/issues/1990 demonstrates there is a demand for a better solution to the isomorphic problem. Perhaps getting match to pull the location object from the history object when it is not present?
// server
match({ location, routes }, (err, redirectInfo, renderedProps) => {
 // send response
});

// client
// match does not find a location object but does find a history object, so it pulls
// the required location object out of that.
match({ history, routes }, (err, redirectInfo, renderedProps) => {
 // send response
});

Either way there is going to be a need for a synchronous API to retrieve the location object.

I'd like to keep getCurrentLocation private in case we need to make it async at some point in the future. Specifically, I'm thinking of React Native which doesn't have a sync method for retrieving data from persistent storage. Instead, all we have is AsyncStorage. If we use that on React Native, then getCurrentLocation will need to be async in some cases and sync in others. This is complexity I'd like to avoid in the public API. Instead, our public API is simply "call listen and we'll call the callback as soon as we possibly can".
I agree, however, that there is demand for a better solution to the server rendering problem. But this isn't it.

I see. I have a solution that would involve changes to match that would make this unnecessary. Should I open an issue on react-router or maybe y'all have an idea of already in the works?


gmime3: 3.0.5 -> 3.2.0

Motivation for this change
Things done

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

[ ] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

@GrahamcOfBorg build notmuch

Success on x86_64-darwin (full log)
Attempted: notmuch
Partial log (click to expand)
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1/lib/libnotmuch.5.1.0.dylib: fixing dylib
/nix/store/d0j1mhfmgz6xbv3fabz92aq9gj3zm3y6-notmuch-0.26.1

Success on x86_64-linux (full log)
Attempted: notmuch
Partial log (click to expand)
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1
shrinking /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1/lib/libnotmuch.so.5.1.0
shrinking /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1/bin/notmuch
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1/lib  /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1/bin
patching script interpreter paths in /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1
/nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1/bin/notmuch-emacs-mua: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/xn5gv3lpfy91yvfy9b0i7klfcxh9xskz-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1...
/nix/store/dhbggacw74aq5hsr01120g8h23pz2467-notmuch-0.26.1

Success on x86_64-linux (full log)
Attempted: gmime3
Partial log (click to expand)
/nix/store/6pksg1i3apd87nisfws6w5jd33ha88wi-gmime-3.2.0

Success on aarch64-linux (full log)
Attempted: gmime3
Partial log (click to expand)
/nix/store/dzpkknp3w4j613j1a0zgl52cyxkk5wbh-gmime-3.2.0

Success on x86_64-darwin (full log)
Attempted: gmime3
Partial log (click to expand)
rmdir: failed to remove '/nix/store/csbr0dlyqbnc67hicmdsss693169d762-gmime-3.2.0/share': Directory not empty
Patching '/nix/store/33kcw6yazwsg1w02fr2wnswqnxhds8s0-gmime-3.2.0-dev/lib/pkgconfig/gmime-3.0.pc' includedir to output /nix/store/33kcw6yazwsg1w02fr2wnswqnxhds8s0-gmime-3.2.0-dev
Moving /nix/store/csbr0dlyqbnc67hicmdsss693169d762-gmime-3.2.0/share/gir-1.0 to /nix/store/33kcw6yazwsg1w02fr2wnswqnxhds8s0-gmime-3.2.0-dev/share/gir-1.0
Removing empty /nix/store/csbr0dlyqbnc67hicmdsss693169d762-gmime-3.2.0/share/ and (possibly) its parents
strip is /nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/csbr0dlyqbnc67hicmdsss693169d762-gmime-3.2.0/lib
patching script interpreter paths in /nix/store/csbr0dlyqbnc67hicmdsss693169d762-gmime-3.2.0
strip is /nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/33kcw6yazwsg1w02fr2wnswqnxhds8s0-gmime-3.2.0-dev/lib
patching script interpreter paths in /nix/store/33kcw6yazwsg1w02fr2wnswqnxhds8s0-gmime-3.2.0-dev

Success on aarch64-linux (full log)
Attempted: notmuch
Partial log (click to expand)
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1
shrinking /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1/bin/notmuch
shrinking /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1/lib/libnotmuch.so.5.1.0
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1/lib  /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1/bin
patching script interpreter paths in /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1
/nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1/bin/notmuch-emacs-mua: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/adw9jx59wnrh5659wz43nbjya3m4b3gl-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1...
/nix/store/rvpfk08mkll5znw7hvxpshkzjsy61dpi-notmuch-0.26.1


ls: nicer ls output

no error when teuthology.log is missing (provisioning)
leave off pid

Signed-off-by: Sage Weil<EMAIL_ADDRESS>

@susebot run deploy


[Bug]: Citrix Workspace source is outdated

What happened?
It seems that https://downloadplugins.citrix.com/ReceiverUpdates/Prod/catalog_win.xml no longer shows the latest version.

https://github.com/vedantmgoyal2009/winget-pkgs-automation/issues/246

Version
2112.512
What PowerShell edition/s are you running Evergreen on?
Windows PowerShell
Which operating system/s are you running Evergreen on?
Windows 10
Have you reviewed the documentation?

[X] Troubleshooting at: https://stealthpuppy.com/evergreen/troubleshoot/
[X] Known issues at: https://stealthpuppy.com/evergreen/issues/

Verbose output
🚀  gea CitrixWorkspaceApp -Verbose
VERBOSE: Get-EvergreenApp: Function exists: C:\Program
Files\WindowsPowerShell\Modules\Evergreen\2112.512\Apps\Get-CitrixWorkspaceApp.ps1.
VERBOSE: Get-EvergreenApp: Dot sourcing: C:\Program
Files\WindowsPowerShell\Modules\Evergreen\2112.512\Apps\Get-CitrixWorkspaceApp.ps1.
VERBOSE: Get-FunctionResource: read application resource strings from [C:\Program
Files\WindowsPowerShell\Modules\Evergreen\2112.512\Manifests\CitrixWorkspaceApp.json]
VERBOSE: Get-EvergreenApp: Calling: Get-CitrixWorkspaceApp.
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [UseBasicParsing: True].
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [MaximumRedirection: 1].
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [DisableKeepAlive: True].
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [UserAgent: CitrixReceiver/<IP_ADDRESS> WinOS/10.0.18362].
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [Method: Default].
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [Uri:
https://downloadplugins.citrix.com/ReceiverUpdates/Prod/catalog_win.xml].
VERBOSE: Invoke-RestMethodWrapper: Invoke-RestMethod parameter: [ContentType: application/json; charset=utf-8].
VERBOSE: GET with 0-byte payload
VERBOSE: received 3590-byte response of content type text/xml
VERBOSE: ConvertTo-DateTime: Converting: [2022-01-05].
VERBOSE: ConvertTo-DateTime: Attempting to convert date format to: en-US.
VERBOSE: ConvertTo-DateTime: Returning date: [1/5/2022].
VERBOSE: ConvertTo-DateTime: Converting: [2021-12-09].
VERBOSE: ConvertTo-DateTime: Attempting to convert date format to: en-US.
VERBOSE: ConvertTo-DateTime: Returning date: [12/9/2021].
VERBOSE: ConvertTo-DateTime: Converting: [2019-03-12].
VERBOSE: ConvertTo-DateTime: Attempting to convert date format to: en-US.
VERBOSE: ConvertTo-DateTime: Returning date: [3/12/2019].
VERBOSE: ConvertTo-DateTime: Converting: [2019-04-23].
VERBOSE: ConvertTo-DateTime: Attempting to convert date format to: en-US.
VERBOSE: ConvertTo-DateTime: Returning date: [4/23/2019].
WARNING: Get-CitrixWorkspaceApp: HDX RTME for Windows version returned is out of date. See
https://stealthpuppy.com/evergreen/issues/ for more information.
VERBOSE: Get-EvergreenApp: Output result from: C:\Program
Files\WindowsPowerShell\Modules\Evergreen\2112.512\Apps\Get-CitrixWorkspaceApp.ps1.

Version : <IP_ADDRESS>48
Title   : Citrix Workspace - Current Release
Size    : 215492528
Hash    : 3c47eb94bd89611d48d65b51a8e6d083e32defbe6b4ea9c69ece9c2844bc60f2
Date    : 1/5/2022
Stream  : Current
URI     : https://downloadplugins.citrix.com/ReceiverUpdates/Prod/Receiver/Win/CitrixWorkspaceApp<IP_ADDRESS>48.exe

Version : 19.12.6000.9
Title   : Citrix Workspace - LTSR CU6
Size    : 79105640
Hash    : c5abca7edb8076410151914e36f583f75bfca9d8f2b7798f84aa6ac4457f9b4f
Date    : 12/9/2021
Stream  : LTSR
URI     : https://downloadplugins.citrix.com/ReceiverUpdates/Prod/Receiver/Win/CitrixWorkspaceApp19.12.6000.9.exe

Version : <IP_ADDRESS>3
Title   : HDX RTME for Windows - Current Release
Size    : 45862912
Hash    : 3589e4faf1495e6ee3f3f538cf4c3f77576dd35af8b0238ac3b6f916aa483027
Date    : 3/12/2019
Stream  : Current
URI     : https://downloadplugins.citrix.com/ReceiverUpdates/Prod/CitrixRTME/Win/CitrixRTME_<IP_ADDRESS>3.msi

Version : 2.4.3000.3
Title   : HDX RTME for Windows - LTSR CU3
Size    : 45314048
Hash    : 690c39203845c2aa7b22045fb4a3a4dcc309045fb064a0f4d1c0902c3902246f
Date    : 4/23/2019
Stream  : LTSR
URI     : https://downloadplugins.citrix.com/ReceiverUpdates/Prod/CitrixRTME/Win/CitrixRTME_2.4.3000.3.msi

This will be Citrix making some changes to the update feed, which they often do. The feed will likely be updated again in a few days and show the current release again.

Okay, I should have seen Known Issues earlier😅

I updated the known issues with that one just today, so likely you've seen that after my update.

Earlier, there was something about 403 error.

An error in the docs, I'm pretty sure it's a 404 that sometime pops up, so changed it to 404.


Adds option to ignore case

Adds option to ignore words' cases. Useful in case you want to count, for example, "she" and "She" together.

Good work! Thanks~

I was trying to use this feature, but it seems not to be available on npm yet, do you mind publishing a new version there @fengyuanchen?
Thank you!

@xicombd OK! I will release one soon.


[profile] Log-Out behavior from user's profile

Description
This is the current behavior for profile page which is accessible for logged-in users only:

Profile Page not-logged-in => Login Screen and main menu highlights "Profile", URL: /login
Profile Page logged-in => Carbonmark user data and main menu highlights "Profile", URL: /users/<Address_or_handle>
Log-Out while on Profile => Show User page and main menu highlights "Marketplace", URL: /users/<Address_or_handle>

See this discussion here too

Problem
@0xemc @ladytrekker yes I agree it is confusing, I raised this during dev but it was low priority and we had bigger UX issues to solve :)
I think if you are on your profile page logged in (https://www.carbonmark.com/users/jabby) and I click the LOG OUT button, I should be redirected to https://www.carbonmark.com/users/login
(note: this is the behaviour on the Portfolio page)
Originally posted by @jabby09 in https://github.com/Atmosfearful/bezos-frontend/issues/434#issuecomment-1496050752
Questions

[ ]  How should the navigation in the main menu behave when looking at different user's profile? What is the URL? What is highlighted? (compare with the current behavior described above)
[ ] Do we need a new URL structure for this and introduce /profile? E.g. user which is not logged in: users/<Address_or_handle>, user which is logged in looking at own profile: /profile/<Address_or_handle> ?
[ ] How to detect at which point while browsing carbonmark a user is logging out? A user can log-out from any page at the moment?
[ ] When a user logs out => the page is re-rendered, we therefore need to know from which page the re-fresh was triggered (or pass a callback to the web3 modal?) and decide what to do/redirect to which URL depending on the former URL => Please write down a complete list for each page

Some answers to the questions:

How should the navigation in the main menu behave when looking at different user's profile? What is the URL? What is highlighted?

The "Marketplace" tab in the nav should be selected. The vast majority of the time, I suspect a user will navigate to someone's profile by clicking their username on a project details page or on a project listing. Especially since I don't think our search bar works for finding other users at the moment, only for searching projects.

Do we need a new URL structure for this and introduce /profile? E.g. user which is not logged in: users/<Address_or_handle>, user which is logged in looking at own profile: /profile/<Address_or_handle> ?

Given the future design plans we have for the profile, I think we definitely need a /profile.

How to detect at which point while browsing carbonmark a user is logging out? A user can log-out from any page at the moment?

I like the ability to logout from any page. I'm not sure this is a question for me, though, because I don't know what engineering will be required to detect when a user has logged out.

When a user logs out => the page is re-rendered, we therefore need to know from which page the re-fresh was triggered (or pass a callback to the web3 modal?) and decide what to do/redirect to which URL depending on the former URL => Please write down a complete list for each page

From Profile
when a user logs out while on their profile page, they're redirected to: https://www.carbonmark.com/users/login
From Portfolio
when a user logs out while on their portfolio page, they're redirected to: https://www.carbonmark.com/portfolio/login
From any other page
when a user logs out on any other page, they shouldn't be redirected. However they will lose the ability to complete a purchase. When logged out, all project cards will look like this (These designs are in the figma as well):

Clicking the "login to buy" launches the login modal.

this will all change with new onboarding flow


onError not firing when no envrionment id is specified

Perhaps I am wrong but I was under the impression that when there is an error initalizing flagsmith, the onError call back is called. Here is my step, which on purpose doesn't have envrionment Id.
handleFlagsError has logic depending on the envrionment that I want to confirm with a unit test. The following is the code:
const handleFlagsError = (e) => {
  console.log('reached error handler');
};

const initializeFlagSmith = () => {
   flagsmith.init({
    environmentID: Config.FS_ENVID,
    api: 'url',
    asyncStorage: AsyncStorage,
    cacheFlags: true,
    onError: handleFlagsError,
    defaultFlags: TabletConfigurations
  });
  flagsmith.startListening(30000);
};

now I understand envrionment ID is required but i am not seeing logs in my console. Now in my test I am doing:
Config.FS_ENVID = undefined;
initializeFlagSmith();

I don't see console from handleFlagsError but I do see Please specify a environment id which is thrown out I believe by flagsmith itself. I was hoping to see simply:
    'reached error handler'
hope I made sense.

Hey @sammysium, sure that makes sense. I'll look at having it trigger the onError too, this was originally intended for errors during flag retrieval but I see your point.

the fix seems good enough for now @kyle-ssg thanks so much.


Support value and range value patterns

The UIA value pattern allows access to the value of a text edit control. This will let the screen reader read the current content; full support for text editing will come later. The range value pattern is for progress bars and sliders.
As part of this work, I had to refactor the UIA implementation to use a separate struct for each pattern, to avoid method name conflicts.

Ready for review again. When I started again this morning, I decided that the concept of numeric value should be explicitly decoupled from range in our own API, even though they're coupled in UIA.


Execute queries with POST

I've tried this excellent app but unfortunately it doesn't work with this graphql server implementation https://github.com/apollostack/graphql-server
The problem is, that 'graphql-server' accepts only POST method and this app execute queries with GET method.

@tadejstanic I've just released 0.3.2 with POST/GET method switch. Let me know if it works for you.

It works! Thx


[Advanced] [Logs] What if the system will send the logs directly to developers?

What we have if the user faces with some errors on SS?
How it looks now: If this happens, the user has to go to Advance -> Logs and send logs.
What if we automate this process? And if the error appears, system gathering errors to reports and send it developers like Microsoft does. Also it will help to predict the user's misbehaviour.

Now error logs are periodically sent to Hub


Need to help about trigger-rule

I have some information as below:
alertmanager: level=debug ts=2020-07-01T03:00:45.377Z caller=dispatch.go:473 component=dispatcher aggrGroup="{}/{send_webhook=~"^(?:true)$"}:{alertname="Server_Down"}" msg=flushing alerts=[Server_Down[2e70eb5][active]]
now I need to set trigger-rule like this:
{
"and":
  [
    {
      "match":
      {
        "type": "value",
        "value": "refs/heads/master",
        "parameter":
        {
          "source": "payload",
          "name": "ref"
        }
      }
    },
    {
      "match":
      {
        "type": "regex",
        "regex": ".*",
        "parameter":
        {
          "source": "payload",
          "name": "repository.owner.name"
        }
      }
    }
  ]
}

But I don't know how to do this.
Can anyone help me to config exacly trigger-rule
Thanks you so much!

It looks like you are showing a log message from an alertmanager system, which I'm not familiar with.  I'm not sure what you're wanting webhook to do.  webhook doesn't parse log messages.

It looks like you are showing a log message from an alertmanager system, which I'm not familiar with. I'm not sure what you're wanting webhook to do. webhook doesn't parse log messages.

Thanks for your answer,
Exactly, it is alertmanager system, so I want to use trigger-rule for match with a label such as alertname...or a label I define... but after a long time investigate, I don't know how to do. Can you give me some solution in this case?
Thanks you so much!

I'm assuming you're talking about this:  https://prometheus.io/docs/alerting/latest/configuration/#webhook_config
It would be helpful to see a complete JSON payload from alertmanager.
Looking at the alertmanager docs, I think a potential trigger rule might look like this:
{
    "match":
    {
        "type": "value",
        "value": "mylabel",
        "parameter":
        {
          "source": "payload",
          "name": "alerts.0.labels"
        }
    }
}

If the labels field can have multiple labels in it's value, you may need to use a regex rule.  It all depends on what alertmanager is sending.

@moorereason  Thanks you so much for support me,
Follow your suggestion I setup as below:
- id: reboot
execute-command: /opt/webhook/reboot.sh
command-working-directory: /opt/webhook
trigger-rule:
and:
- match:
type: value
value: send_webhook
parameter:
source: payload
name: alerts.0.labels
I has define my label as send_webhook but when Alertmanager system notify, nothing happen with my webhook.
Can you support me in this case?
Thanks you

Can you provide us with the verbose webhook logs when a request is received?  What version of webhook are you running?  If you are using v2.7.0, you can show debug logs that would be particularly helpful here.

I'm using the latest version 2.7, here the logs when I run with debug mode:
**[webhook] 2020/07/03 09:54:46 [cd55ba] 404 | 15 B | 182.908µs | <IP_ADDRESS>:9000 | POST /hooks/root
[webhook] 2020/07/03 09:55:16 [6e4bb8] incoming HTTP POST request from <IP_ADDRESS>:60110

[6e4bb8] POST /hooks/root
[6e4bb8] Content-Length: 1083
[6e4bb8] Content-Type: application/json
[6e4bb8] User-Agent: Alertmanager/0.21.0
[6e4bb8] id:
[6e4bb8] {"receiver":"webhook","status":"firing","alerts":[{"status":"firing","labels":{"alertname":"Server_Down","alias":"test-server","instance":"<IP_ADDRESS>:9100","job":"test","send_webhook":"true","severity":"critical"},"annotations":{"description":"test-server has been down for more than 1 minutes","summary":"Instance test-server down"},"startsAt":"2020-07-02T16:56:05.366565107+07:00","endsAt":"0001-01-01T00:00:00Z","generatorURL":"http://bientt1-monitor-stack.novalocal:9090/graph?g0.expr=up{instance%3D~".*%3A9100"}+%3D%3D+0\u0026g0.tab=1","fingerprint":"2e70eb50e042907f"}],"groupLabels":{"alertname":"Server_Down"},"commonLabels":{"alertname":"Server_Down","alias":"test-server","instance":"<IP_ADDRESS>:9100","job":"test","send_webhook":"true","severity":"critical"},"commonAnnotations":{"description":"test-server has been down for more than 1 minutes","summary":"Instance test-server down"},"externalURL":"http://bientt1-monitor-stack.novalocal:9093","version":"4","groupKey":"{}/{send_webhook=~"^(?:true)$"}:{alertname="Server_Down"}","truncatedAlerts":0}
[6e4bb8]

< [6e4bb8] Not Found
< [6e4bb8] Hook not found.**
Could you help me define a right trigger-rule with labels
Thanks you so much.

< [6e4bb8] Hook not found.

Based on your previous comments, it looks like you've created a reboot hook, but the request from alertmanager is hitting /hooks/root instead of /hooks/reboot.

Thanks for your support @moorereason ,
Here the full logs I run with your suggest, It's run success with no trigger-rule, can you help add the right trigger-rule:
`[webhook] 2020/07/07 10:33:15 [bfa131] reboot hook triggered successfully

[e96fed] POST /hooks/reboot
[e96fed] Content-Length: 1121
[e96fed] Content-Type: application/json
[e96fed] User-Agent: Alertmanager/0.21.0
[e96fed] id:
[e96fed] {"receiver":"webhook","status":"firing","alerts":[{"status":"firing","labels":{"alertname":"Memory_Free_Low","alias":"prometheus-server","instance":"<IP_ADDRESS>:9100","job":"prometheus-server","severity":"warning"},"annotations":{"description":"5.5%","summary":"Instance prometheus-server is high memory usage"},"startsAt":"2020-07-07T10:33:05.366565107+07:00","endsAt":"0001-01-01T00:00:00Z","generatorURL":"http://monitor-stack.novalocal:9090/graph?g0.expr=100+-+100+*+((node_memory_MemFree_bytes+%2B+node_memory_Buffers_bytes+%2B+node_memory_Cached_bytes)+%2F+node_memory_MemTotal_bytes)+>%3D+5\u0026g0.tab=1","fingerprint":"acabc112b21104a4"}],"groupLabels":{"alertname":"Memory_Free_Low"},"commonLabels":{"alertname":"Memory_Free_Low","alias":"prometheus-server","instance":"<IP_ADDRESS>:9100","job":"prometheus-server","severity":"warning"},"commonAnnotations":{"description":"5.5%","summary":"Instance prometheus-server is high memory usage"},"externalURL":"http://monitor-stack.novalocal:9093","version":"4","groupKey":"{}/{}:{alertname="Memory_Free_Low"}","truncatedAlerts":0}
[e96fed]

< [e96fed]
[webhook] 2020/07/07 10:33:15 [e96fed] 200 | 0 B | 937.166µs | <IP_ADDRESS>:9000 | POST /hooks/reboot

[bfa131] POST /hooks/reboot
[bfa131] Content-Length: 1055
[bfa131] Content-Type: application/json
[bfa131] User-Agent: Alertmanager/0.21.0
[bfa131] id:
[bfa131] {"receiver":"webhook","status":"firing","alerts":[{"status":"firing","labels":{"alertname":"Server_Down","alias":"test-server","instance":"<IP_ADDRESS>:9100","job":"test","send_webhook":"true","severity":"critical"},"annotations":{"description":"test-server has been down for more than 1 minutes","summary":"Instance test-server down"},"startsAt":"2020-07-07T10:33:05.366565107+07:00","endsAt":"0001-01-01T00:00:00Z","generatorURL":"http://monitor-stack.novalocal:9090/graph?g0.expr=up{instance%3D~".*%3A9100"}+%3D%3D+0\u0026g0.tab=1","fingerprint":"2e70eb50e042907f"}],"groupLabels":{"alertname":"Server_Down"},"commonLabels":{"alertname":"Server_Down","alias":"test-server","instance":"<IP_ADDRESS>:9100","job":"test","send_webhook":"true","severity":"critical"},"commonAnnotations":{"description":"test-server has been down for more than 1 minutes","summary":"Instance test-server down"},"externalURL":"http://monitor-stack.novalocal:9093","version":"4","groupKey":"{}/{}:{alertname="Server_Down"}","truncatedAlerts":0}
[bfa131]

< [bfa131]
[webhook] 2020/07/07 10:33:15 [bfa131] executing /opt/webhook/reboot.sh (/opt/webhook/reboot.sh) with arguments ["/opt/webhook/reboot.sh"] and environment [] using /opt/webhook as cwd
[webhook] 2020/07/07 10:33:15 [bfa131] 200 | 0 B | 1.226279ms | <IP_ADDRESS>:9000 | POST /hooks/reboot
[webhook] 2020/07/07 10:33:15 [e96fed] executing /opt/webhook/reboot.sh (/opt/webhook/reboot.sh) with arguments ["/opt/webhook/reboot.sh"] and environment [] using /opt/webhook as cwd
[webhook] 2020/07/07 10:33:15 [e96fed] command output: Shutdown scheduled for Tue 2020-07-07 10:34:16 +07, use 'shutdown -c' to cancel.
[webhook] 2020/07/07 10:33:15 [e96fed] finished handling reboot
[webhook] 2020/07/07 10:33:15 [bfa131] command output: Shutdown scheduled for Tue 2020-07-07 10:34:16 +07, use 'shutdown -c' to cancel.
[webhook] 2020/07/07 10:33:15 [bfa131] finished handling reboot`

Try this:
- id: reboot
  execute-command: /opt/webhook/reboot.sh
  command-working-directory: /opt/webhook
  trigger-rule:
    and:
    - match:
        type: value
        value: true
        parameter:
          source: payload
          name: alerts.0.labels.send_webhook

Thanks you @moorereason,
I follow your suggestion, It's worked!!!
Thanks you so much,
Have a nice day :)


Adding MonsterHub

This pull request was created using the https://discordbots.co.uk/edit menu.

The final box says "any comments", not "put the entire source into the box"

There's not much useful commands~~, and it has a link to .org~~
It works tho, so it's ok.


Add GH Action

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@5f5dab1). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master       #4   +/-   ##
=========================================
  Coverage          ?   87.50%
=========================================
  Files             ?        9
  Lines             ?      424
  Branches          ?        0
=========================================
  Hits              ?      371
  Misses            ?       53
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f5dab1...d66dad3. Read the comment docs.


manifest: hostap: Pull build configuration checks in crypto_alt

This pulls in configuration checks that are added in crypto_mbedtls_alt.c, supp_psa_api.c and tls_mbedtls_alt.c. It also pulls in hmac_prf256 PSA API invocation for sha256_prf_bits API.

Manifest update will be part of https://github.com/zephyrproject-rtos/zephyr/pull/80098


scene: add support for direct scan-out

Check if only a single node intersects with the output viewport
and all of its properties match. In this case, attempt direct
scan-out.

Will https://github.com/swaywm/sway/issues/6149 also be a problem here?

Hm, yeah, forgot about that. Done.


Added  to the list of names and wrote the search functionality

Hi, I added my name to the list of names and decided it'd be cool to be able to search for any contributor. Anticipating your review.

Hi Bolaji!
Well done! 🥳
Please split the search functionality and the name change into different commits.
Please open a new PR for another, and remember to make a branch as you work on your changes! 🙏
If you want, I can remove one of the files and merge this PR. You can do it too.


Use checkExpected for all test result checking.

This should simplify the way we check test result and make tests more unified.

@Maxwell-Alexius You might want to check this, since you'll write a lot tests when implementing APIs


Can't send "from" an email containing brackets

We are seeing errors in production when sending email via Mailtrap where the from address includes brackets. For example
mail(from: "foo (bar<EMAIL_ADDRESS>
Leads to this

I tried writing a failing test, I couldn't get it to crash, but it does fail:
diff --git a/spec/mailtrap/mail_spec.rb b/spec/mailtrap/mail_spec.rb
index 6bd5f88..301d545 100644
--- a/spec/mailtrap/mail_spec.rb
+++ b/spec/mailtrap/mail_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe Mailtrap::Mail do
     let(:message) { Mail::Message.new(**message_params) }
     let(:message_params) do
       {
-        from: 'Mailtrap Test<EMAIL_ADDRESS>+        from: 'Mailtrap (Test<EMAIL_ADDRESS>         to: 'To 1<EMAIL_ADDRESS><EMAIL_ADDRESS>         cc<EMAIL_ADDRESS>Cc 2<EMAIL_ADDRESS>         bcc<EMAIL_ADDRESS><EMAIL_ADDRESS>@@ -23,7 +23,7 @@ RSpec.describe Mailtrap::Mail do
       }
     end

-    its(:from) { is_expected.to eq({ name: 'Mailtrap Test', email<EMAIL_ADDRESS>}) }
+    its(:from) { is_expected.to eq({ name: 'Mailtrap (Test)', email<EMAIL_ADDRESS>}) }
     its(:to) { is_expected.to eq([{ name: 'To 1', email<EMAIL_ADDRESS>}, { email<EMAIL_ADDRESS>}]) }
     its(:cc) { is_expected.to eq([{ email<EMAIL_ADDRESS>}, { name: 'Cc 2', email<EMAIL_ADDRESS>}]) }
     its(:bcc) { is_expected.to eq([{ email<EMAIL_ADDRESS>}, { email<EMAIL_ADDRESS>}]) }

So I suspect there's something wrong in the gem here, and maybe the test just isn't accurately replicating how Action Mailer works.

You should quote the display name if it contains parenthesis, they are a special character according to the RFC; the relevant part is:
display-name = phrase
phrase          =   1*word / obs-phrase
word            =   atom / quoted-string
atom            =   [CFWS] 1*atext [CFWS]
atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
                       "!" / "#" /        ;  characters not including
                       "$" / "%" /        ;  specials.  Used for atoms.
                       "&" / "'" /
                       "*" / "+" /
                       "-" / "/" /
                       "=" / "?" /
                       "^" / "_" /
                       "`" / "{" /
                       "|" / "}" /
                       "~"

Or you can use the email+name form, and I'm pretty sure we will quote it for you:
{ email<EMAIL_ADDRESS>name: 'Mailtrap (Test)' }

But I admit that stripping the parens is sketchy, will look into it.

Ah, even more interesting - from the same RFC - is that contents of the parens are considered comments. Fascinating!

Also, strings of characters that are treated as comments may be included in structured field bodies as characters enclosed in parentheses.

https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2

However it seems that the actual cause of your error is an empty From header. Looking at the code, I don't see other possible ways to reproduce.
PR with better error message incoming.

@ghiculescu I believe invalid email address caused the error for you. I'll work on the fix.

This script confirms that your fix fixes that crash, if the from is blank.
require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  gem "rails", path: "/Users/alex/code/rails" #github: "rails/rails", branch: "main"
  gem "mailtrap", "2.1.1"
end

require "action_mailer/railtie"
require "minitest/autorun"

class TestApp < Rails::Application
  config.load_defaults Rails::VERSION::STRING.to_f
  config.root = __dir__
  config.eager_load = false
  config.hosts << "example.org"
  config.secret_key_base = "secret_key_base"
  config.logger = Logger.new($stdout)
end

require "mailtrap/action_mailer"
::ActionMailer::Base.add_delivery_method(:mailtrap, Mailtrap::ActionMailer::DeliveryMethod)
ENV["MAILTRAP_API_KEY"] = "test"

class TestMailer < ActionMailer::Base
  def hello_world
    @message = "Hello, world"
    mail from: "", to<EMAIL_ADDRESS>delivery_method: :mailtrap do |format|
      format.html { render inline: "
<%= @message %>
" }
      format.text { render inline: "<%= @message %>" }
    end
  end
end

class BugTest < ActionMailer::TestCase
  test "renders HTML and Text body" do
    email = TestMailer.hello_world
    email.deliver_now
  end
end

But I'm really really sure it wasn't blank in my case... let me try and get a working replication.

I believe invalid email address caused the error for you

Yep... this is it.
This from works fine: "foo (bar<EMAIL_ADDRESS>This crashes: "foo bar<EMAIL_ADDRESS>It seems like your commit has fixed the crash, so thank you!

@ghiculescu I've just pushed a new version 2.1.2. It includes the improved error handling for invalid emails.


Allow passthru param on ws.destory()

Fix from https://github.com/openshift/console/pull/11288 propagated into the SDK.
Effectively the issue in OpenShift Console was the .onDestory callback was waiting for a param that was supposed to be provided by the .destory() call made a few lines above.
Kinda surprised the GenericHandler<never> type didn't cause a TS issue with us having a variable in the .onDestory(timedOut) callback 🤔

/cc @florkbr
This is the issue I mentioned yesterday to you.

/lgtm

:shipit:


boards: arm: nrf52840: default IEEE802154_NRF5 if IEEE802154 enabled

As the nRF52840 supports 802.15.4 natively, we should default y
for IEEE802154_NRF5 if IEEE802154 is enabled.
Signed-off-by: Michael Scott<EMAIL_ADDRESS>

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@61439b0). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #8324   +/-   ##
=========================================
  Coverage          ?   64.46%
=========================================
  Files             ?      421
  Lines             ?    40163
  Branches          ?     6769
=========================================
  Hits              ?    25891
  Misses            ?    11154
  Partials          ?     3118

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61439b0...ae87aeb. Read the comment docs.