Abstracting out vulkan resource reader class

CI gfxreconstruct build queued with queue ID 80108.

CI gfxreconstruct build queued with queue ID 80123.

CI gfxreconstruct build # 3481 running.

CI gfxreconstruct build # 3481 failed.

CI gfxreconstruct build queued with queue ID 80515.

CI gfxreconstruct build # 3484 running.

CI gfxreconstruct build # 3484 passed.

CI gfxreconstruct build queued with queue ID 81370.

CI gfxreconstruct build # 3485 running.

CI gfxreconstruct build # 3485 passed.

CI gfxreconstruct build # 3486 running.

CI gfxreconstruct build # 3486 passed.

CI gfxreconstruct build queued with queue ID 83604.

CI gfxreconstruct build # 3493 running.

CI gfxreconstruct build # 3493 passed.

CI gfxreconstruct build queued with queue ID 83807.

CI gfxreconstruct build # 3495 running.

CI gfxreconstruct build queued with queue ID 83823.

CI gfxreconstruct build # 3496 running.

CI gfxreconstruct build queued with queue ID 83982.

CI gfxreconstruct build # 3500 running.

CI gfxreconstruct build # 3500 passed.

CI gfxreconstruct build queued with queue ID 85562.

CI gfxreconstruct build # 3519 running.

CI gfxreconstruct build queued with queue ID 85580.

CI gfxreconstruct build # 3520 running.

CI gfxreconstruct build queued with queue ID 85599.

CI gfxreconstruct build # 3521 running.

CI gfxreconstruct build queued with queue ID 85626.

CI gfxreconstruct build # 3522 running.

CI gfxreconstruct build # 3522 passed.

CI gfxreconstruct build queued with queue ID 85714.

CI gfxreconstruct build queued with queue ID 85731.

CI gfxreconstruct build # 3524 running.

CI gfxreconstruct build queued with queue ID 85794.

I have a disagreement between my clang-format and the one used by the checker although I believe I am using the correct version (9)

I have a disagreement between my clang-format and the one used by the checker although I believe I am using the correct version (9)

You can cut-and-paste the diff out of the CI job log and apply it as a patch.  Let me know if I can help with detail on how to do that.

CI gfxreconstruct build # 3525 running.

CI gfxreconstruct build # 3525 passed.

CI gfxreconstruct build queued with queue ID 87106.

I couldn't get the big picture of what the changes were without diving into code details. Function headers and a description of parameters might help. (But I realize most of gfxrecon is written with minimal function headers and param descriptions.)

Good point. I'll add some description in functions and their parameters

CI gfxreconstruct build # 3530 running.

CI gfxreconstruct build queued with queue ID 87121.

CI gfxreconstruct build # 3531 running.

CI gfxreconstruct build # 3531 failed.

CI gfxreconstruct build queued with queue ID 87672.

CI gfxreconstruct build # 3537 running.

CI gfxreconstruct build # 3537 passed.

CI gfxreconstruct build queued with queue ID 87709.

CI gfxreconstruct build # 3538 running.

CI gfxreconstruct build # 3538 passed.

CI gfxreconstruct build queued with queue ID 87833.

CI gfxreconstruct build # 3539 running.

CI gfxreconstruct build # 3539 passed.

CI gfxreconstruct build queued with queue ID 88257.

CI gfxreconstruct build # 3545 running.

CI gfxreconstruct build # 3545 passed.

oops forgot to squash and merge...


invoking validation check on form fields in profile

invoking  call to validate form fields in profile to include name, birthday and email fields - appeared not to be invoked previously
adjust validation check on email field to update field only after ajax call to check unique email address is done
remove obsolete code from profile.html
fixed hard coded instrument id code in assessment session list section to get it dynamically from api

Wonderful catch.  Explains that log message we saw.
I'd be in favor of removing the blocks of commented out code, unless you anticipate needing them again soon?

Paul - yes - I have removed the commented out code - since it no longer applies.


[Discussion] Using this library together with WebViews

It seems like a lot of people try to use this library together with WebViews in order to implement custom web browsers. However, it seems to be non-trivial to properly use WebView's together with the library's recycling mechanism that reuses previously inflated views to display the contents of different tabs when they are not visible anymore. The following issues are related to this problem:

https://github.com/michael-rapp/ChromeLikeTabSwitcher/issues/5
https://github.com/michael-rapp/ChromeLikeTabSwitcher/issues/17
https://github.com/michael-rapp/ChromeLikeTabSwitcher/issues/18

I don't have enough experience with the WebView class to give good advices on this issue. I even hadn't WebViews in mind when I implemented this library. Therefore this issue is meant to be a platform for discussing this problem. It would be great, if those that are interested in using this library together with WebView's could share their experiences here. Even better, if someone would create a simple example project at Github different people would be able to enhance it, which will hopefully result in a satisfying solution to be used by everyone. I will do my best to comment on issues and give advices about how to use this library properly.
I think that the recycling mechanism of the library works great as it is and there is no need to add any workarounds to get it to work together with WebView's. Of course there is a chance that there might be any bugs related to it. If that's the case, I will do my best to fix them.
In my opinion the following things must be tackled:

It is necessary to save the state of a WebView in memory or on the local storage. This includes the visited URL, the history and the content of the displayed website.
If the WebView class does not provide a suitable way to store/restore its full state out of the box, it is necessary to implement this by ourselves.
For displaying the previews of tabs it might be helpful to display a "screenshot" of the website rather than actually using the WebView to render the website.
Frequently reloading the URL of the WebView is no option as this will result in a bad user experience due to the fact that network requests are time consuming.

I hope that some people will contribute to this issue and share their opinions and experiences in order to solve this problem.

Hi ,
I have enough experience with webview and I can contribute to this issue and I really need to do that beacuse I developed a browser based on this library, just need to handle reload issue at various instant.
As per you mentioned recycling mechanism: " it seems to be non-trivial to properly use WebView's together with the library's recycling mechanism that reuses previously inflated views to display the contents of different tabs when they are not visible anymore".
Can you tell me ?
The classes name that responsible for recycler view bheaviour so that i can move forward to handle webview in this library.

Recycling mechanism
The basic idea of the recycling mechanism is really simple:

Whenever the content of a tab becomes visible (either because it is selected and therefore shown fullscreen, or because it becomes visible while scrolling through the tabs) the view that is necessary to display the tab's content is added to the tab's container layout. This is achieved in one of the following ways:

If no recyclable view are available, it is inflated from scratch using the onInflateView-method of your TabSwitcherDecorator-implementation. Afterwards the TabSwitcherDecorator's onShowView-method is invoked. It is meant to adjust the appearance of the inflated view depending on the tab it belongs to.
If a recyclable view is available, the onInflateView-method is NOT called. Instead, the existing view is used. However, the onShowView-method is invoked in order to adjust the view to display the correct content. Implementing the onShowView-method to correctly is crucial to be sure that the correct content is displayed. This is because the recycled view is still in the same state as it was when it was used for the last time (probably it was used to display the content of another tab).

Once the content of a tab becomes invisible, the view that displays its content is removed from the tab's container layout. However it is retained in a cache and might be reused as described above. Only if the device runs out of memory the cached views are eventually destroyed.

Because of this mechanism it is not necessary to inflate an individual view for each tab. As there is no chance that all tabs are visible at the same time, the number of inflated views is kept to a minimum. This enables to use a large number of tabs without occupying too much memory. Furthermore, inflating views is relatively time consuming and therefore it is desirable to reuse existing views to achieve a better performance and smother scrolling behavior.
The mechanism I described above is very similar to how RecyclerViews work in Android. When using a RecyclerView, the views that are used to display individual list items are also reused internally. The TabSwitcherDecorator's onInflateView-method corresponds to the onCreateViewHolder-method of the class RecyclerView.Adapter. The onShowView-method corresponds to the onBindViewHolder-method. I think it helps to think about the library's TabSwitcher as a RecyclerView, where the individual tabs behave similar as list items.
Restore mechanism
There is also a built-in mechanism to save the state of a tab when its content is removed and to restore it later when the tab becomes visible again:

When the content of a tab is removed, the onSaveInstanceState-method of your TabSwitcherDecorator is called. It allows to store the state in a Bundle.
When the tab's content becomes visible again, the onShowView-method is called as described above (regardless of a recycled view is used or not). If any previously saved state is available, the corresponding Bundle is passed as a method parameter.

This behavior is similar to restoring the state of a Fragment, where the state can be stored in the onSaveInstanceState-method and the saved state is passed to the onCreateView-method when the fragment's content is recreated.
Implementation details
For recycling views this library uses an instance of the class AbstractViewRecycler. It is responsible for deciding if any recyclable views are available, or if it is necessary to inflate new views. An instance of the class ContentRecyclerAdapter is attached to it. It can be seen as a connection between the ViewRecycler and your custom TabSwitcherDecorator-implementation. It invokes the TabSwitcherDecorator's method such as onInflateView, onShowView and onSaveInstanceState and manages the saved states of all tabs.

@anandmahesh Are you interested in creating a sample project that implements a really simple demonstration of how to use the library together with WebViews? Maybe this would help you to figure out how things need to be implemented without dealing with the complexity of a real app. I would contribute to it if necessary and it could be used as a reference for other developers.

Yes, I am interested in creating a sample project to demonstrate the working of web views with this library and thanks for a brief overview of classes and mechanism.
Give me some time, I will get back to you after creating a demo project.

@amandmahesh Did you make any progress on this issue?

Hello.
Webview cannot fully save state. Using this library is not possible  with webView without disable recycle

Hey,
I 'm using this library in my project with webview but have blinking issue as well as layout inflate issue.
Basically I couldn't use webview in my main activity layout. I am to use switcher view  in my main layout then inflate my desired view using onFlateView() method of Decorator class  where I also have  a frame layout and  for every new Tab I create a object of Webview and attach this webview in frame layout.


Change the DSL interfaces to decouple them from the assertion

Codecov Report

Merging #9 (a3a7b12) into main (8448982) will not change coverage.
The diff coverage is 75.00%.

:exclamation: Current head a3a7b12 differs from pull request most recent head bef7870. Consider uploading reports for the commit bef7870 to get more accurate results

@@            Coverage Diff            @@
##               main       #9   +/-   ##
=========================================
  Coverage     94.05%   94.05%
  Complexity      177      177
=========================================
  Files            35       35
  Lines           303      303
  Branches         22       22
=========================================
  Hits            285      285
  Misses           12       12
  Partials          6        6

Impacted Files
Coverage Δ

...ompere/modelassert/json/dsl/JsonNodeAssertDsl.java
87.50% <ø> (ø)

...odelassert/json/dsl/nodespecific/ArrayNodeDsl.java
66.66% <ø> (ø)

.../modelassert/json/dsl/nodespecific/ArrayNodes.java
100.00% <ø> (ø)

...elassert/json/dsl/nodespecific/BooleanNodeDsl.java
100.00% <ø> (ø)

...odelassert/json/dsl/nodespecific/BooleanNodes.java
100.00% <ø> (ø)

...delassert/json/dsl/nodespecific/NumberNodeDsl.java
100.00% <ø> (ø)

...modelassert/json/dsl/nodespecific/NumberNodes.java
100.00% <ø> (ø)

...delassert/json/dsl/nodespecific/ObjectNodeDsl.java
66.66% <ø> (ø)

...modelassert/json/dsl/nodespecific/ObjectNodes.java
100.00% <ø> (ø)

...re/modelassert/json/dsl/nodespecific/Sizeable.java
100.00% <ø> (ø)

... and 5 more

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 8448982...bef7870. Read the comment docs.


NoMethodError: undefined method `extension' for nil:NilClass when resolving field

After upgrading to the latest versions of graphql and graphql-batch, the resolvers fail to work when they resolve to a lazy value.
› rg graphql Gemfile.lock
154:    graphql (1.9.1)
155:    graphql-batch (0.4.0)

Error:
NoMethodError: undefined method `extension' for nil:NilClass
graphql-batch-0.4.0/lib/graphql/batch.rb:25:in `block in use'
graphql-batch-0.4.0/lib/graphql/batch.rb:23:in `each'
graphql-batch-0.4.0/lib/graphql/batch.rb:23:in `use'
graphql-1.9.1/lib/graphql/define/defined_object_proxy.rb:28:in `use'
graphql-1.9.1/lib/graphql/schema.rb:781:in `block (2 levels) in to_graphql'
graphql-1.9.1/lib/graphql/schema.rb:777:in `each'
graphql-1.9.1/lib/graphql/schema.rb:777:in `block in to_graphql'
graphql-1.9.1/lib/graphql/define/instance_definable.rb:161:in `instance_eval'
graphql-1.9.1/lib/graphql/define/instance_definable.rb:161:in `ensure_defined'
graphql-1.9.1/lib/graphql/schema.rb:265:in `define'
graphql-1.9.1/lib/graphql/define/instance_definable.rb:130:in `redefine'
graphql-1.9.1/lib/graphql/schema.rb:776:in `to_graphql'
graphql-1.9.1/lib/graphql/schema/member/accepts_definition.rb:120:in `to_graphql'
graphql-1.9.1/lib/graphql/schema.rb:718:in `graphql_definition'
graphql-1.9.1/lib/graphql/schema/field.rb:627:in `with_extensions'
graphql-1.9.1/lib/graphql/schema/field.rb:485:in `resolve'

Cause seems to be #99, and this code:
https://github.com/Shopify/graphql-batch/blob/77945d4857f51f05dd36c25d1c599c0cd613a032/lib/graphql/batch.rb#L20-L25
The metadata is empty ({}) on the field, so it cannot load a value to call #extension on. Making the if not match, so that part is skipped, makes everything work again.
The type that caused this error is defined using the new class-based syntax, but not all types in the schema is using that syntax. I don't know if it's relevant or not.
This happens both in my test setup (that uses some fixtures and stubs) and with real queries against the schema, so I don't think it's caused by any weird setup on my end.
We do not use the Interpreter and the schema is set up this way:
module MyApiName
  class Schema < GraphQL::Schema
    query QueryRoot
    mutation MutationRoot

    use GraphQL::Batch
    use GraphQL::Backtrace
  end
end

Moving use on top of the other types (which is mentioned as a bad thing in #99) does not change anything either.
Is there anything else I can do here to help debug this? Is there a workaround I can use?

not all types in the schema is using that syntax

Yeah, that's definitely it, if there are types not using the class-based API, then they won't have .metadata[:type_class] 😖

Is the MutationRoot defined using the new class-based API?

Is the MutationRoot defined using the new class-based API?

I can confirm that it was using the old style.


Fixes inconsistent behaviour when populating hasOne/belongsTo relationships

Fixes #598 & #172.
Use refresh() when populating hasOne/belongsTo relationships to be consistent with how hasMany works.
This prevents unexpected ajax calls when the server returns related records nested inside a parent record.
Breaking Change
Person.hasOne('dog', Dog)
Dog.belongsTo('person', Person)

var person = Person.create({
  name: 'John'
  dog: { name: 'Spot' }
})

Previously the above would trigger 'create' on both the Person and Dog models. If both models are using ajax, it would send two POST requests.
But now 'create' would only be triggered on the Person model, and 'refresh' would be triggered on the Dog model. A POST would only be sent for the new Person record.
Possible Solution
If you include the relation name in the model attributes, the related record will be included on it's way back to the server:
Person.attributes.push('dog') # Or just add it when configuring the model.
JSON.stringify(person) # Now includes the nested `Dog` record.

But this might require server-side changes, and it doesn't work the same for hasMany relationships.
A more ugly workaround that wouldn't require server-side changes:
var person = Person.create({
  name: 'John'
  dog: { name: 'Spot' }
})
person.dog().ajax().create()

I missed this when it came in I guess.
In practice I haven't used the relation module for a while now. So the breaking change wouldn't affect me personally, therefor I feel like my opinion on bringing it in doesn't carry a lot of weight. That said, seems good to me! The possilble solution to the issue of creating both the models for related object seems acceptable. Is there any documentation on the relation module that would need to be updated in accordance with this?

That's a good question! I'll have a look.

Doesn't look like there's any changes needed in the docs. The relation docs are pretty sparse...

@adambiggs want to bring this in for a potential 1.6.2 release?

or does this merit a bigger bump? it's a little tricky to think in terms of semver when non-core modules are involved...

Hmm you bring up an interesting point.
I guess if we are going with strict semver this would warrant a Spine v2.0.0 release... But at the same time that kind of feels weird at this point...
Maybe we can merge this into dev for now and try to get one of the other bigger features in, then do a v2 release? I wouldn't mind taking a stab at #404 or maybe something like my last comment in #444 if you think that'd be worthwhile. Also Promise support would be a great excuse to bump to v2!

I probably don't have tons of time to put into the promise stuff in the next month or so, but man I really want to get to that! I would be glad to chip in as much as I can if you want to push forward with all that. Maybe just adding the PATCH support would be a smaller bit to bite off? then aim for a 1.7 type deal. I don't think anyone is going to get on our case to hard if we're not semver purists.

Anyway, I say go ahead and merge this into dev unless you think I should do a 1.6.2 release with what is in now. Actually... that seems like an okay idea. No point holding up the fixes that are in for some bigger release. I will aim for a 1.6.2 release this evening unless I hear some objections. After all that let's merge this in, and get crackin on some new stuff!

As one of the original reporters of this issue, I tried this new code using the same scenario where I had reported the issue, and find that the code in the pull request has resolved the issue I had, and I am able to access my model's hasOne object properly. I'm good with seeing this merged.

well okay, so 2 and a half months later... I am prepping the 1.6.2 release now. we can start working on a 1.7 release with this and #604 then.

I have tried the changes using my scenario from before, and hasOne works properly as a result of this. How is this and the other issue fix coming along so we know when we can see this released?


Upload files to Server

I am trying to use the following popular file upload lib (https://github.com/blueimp/jQuery-File-Upload) to get the recorded blob data to php server, but couldn't figure out how to call the upload function.
Could anybody point me to the right direction?
thanks in advance,
Lucy

That's a nice plugin. I can add an example but it'll take a day or two since it's christmas ;)

Thanks a lot. :)
Yep, one of the reason I am choosing that lib is the chunked upload feature to improve the memory performance etc. I tried with their example but not able to figure out how to pass the generated blob data. It will be great if you can create an example, much appreciated.
Thanks again,
Lucy

Hi!
This is an outstanding plugin! I have one quick question that is an extension of the one above. After I get the recordedData uploaded and stored offsite, how can I feed the data back into the player on a subsequent page load? Eg. User A records + uploads a video, and User B wants to watch it.
Any help you can provide would be much appreciated!
Thanks!
Patrick

@pmccarren , did you try videojs to play the recorded video? e.g. http://videojs.com/
BTW, did you use blueimp to get the recordedData to server? If so, do you mind to share your code with us? :)
thanks,
Lucy

Hi @zang! I utilized the logic found here: http://bit.ly/1TmDg7k to do an Amazon S3 upload. I've been looking at videojs but am not sure how to load both the audio + video tracks in the chrome browser. (video is a webm blob and the audio is a wav blob). Obviously in the videojs-record demo (https://collab-project.github.io/videojs-record/examples/audio-video.html) you can record a video with audio and play it back. Know how to take the recorded data and load it at a later date? What if someone records with Firefox and someone else wants to play with Chrome? Chrome doesn't support the single track webm+audio format.
Thanks a bunch!!
Patrick

@zang I uploaded an jquery fileupload example just now, could you give it a try and let me know how it works out?

@pmccarren you could use http://ffmpeg.org on the server-side to generate the files for different browsers (mp3, mp4, ogg etc).

 The file uploading works perfectly. However, I got a separate issue when I try to trans-code the video with ffmpeg. It throws an error saying 'invalid duration'. I then run ffprobe and got the following results. Any idea on how to set the duration and bitrate? :)
Input #0, matroska,webm, from '1451315141116.webm':
Metadata:
encoder         : QTmuxingAppLibWebM-0.0.1
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
Stream #0:1(eng): Audio: vorbis, 44100 Hz, mono, fltp (default)
--- A separate question ---
Btw, is there a way to increase resolution from 640*480 to 720p?
thanks again,
Lucy

Hi Patrick, I am planning to use ffmpeg to merge the audio and video for chrome recording. :)

@zang what browser version and platform? Sounds like an issue with the way RecordRTC records these mixed media files.

@zang try setting width and height, it defaults to 640*480 I think.

@thijstriemstra I am on Macintosh Firefox 43.0. and my initialize script is :
var player = videojs("record", { controls: true, loop: false, width: 1280, height: 720, plugins: { record: { audio: true, video: true, maxLength: 60 } } });
The recorded video is still in 640*480.
thanks,
Lucy

That sounds like a separate issue, can you create a new ticket for that?

@zang @thijstriemstra
I implemented setting video constraints in #30

Excellent! :)
@thijstriemstra , I've created a separate issue for the 'invalid duration' via https://github.com/collab-project/videojs-record/issues/31
thanks @thijstriemstra @alsar

Thank you so much for your help!
P.S. As requested, I created a separate ticket for the invalid duration issue. thanks again. :)

Thank you so much for your help!
P.S. As requested, I created a separate ticket for the invalid duration issue. thanks again. :)

Updated to latest script, got a few errors when I setup the recorder with the following script:
var player = videojs("record", { controls: true, loop: false, plugins: { record: { audio: true, video: { width: 1280, height: 720 }, maxLength: 60 } } });

On Chrome Version 47.0.2526.106 (64-bit), I got the following error
Uncaught TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': Malformed constraints object.

On Firefox, I got the following error when playback the recorded video (I don't get this error for 640*480 solution):
The media playback was aborted due to a corruption problem or because the media used features your browser did not support.

On Chrome, I also got the following error when recording both video and audio
Uncaught TypeError: Cannot read property 'split' of undefined

Chrome doesn't support the latest specification for constraints.
You still have to use the "old" syntax for Chrome:
video: {
    mandatory: {
        minWidth: 1280,
        minHeight: 720,
    },
},

@thijstriemstra What about using this shim https://github.com/webrtc/adapter to abstract the differences with constraints between browsers?

@alsar I'd prefer to not to add another dependency but after looking at the code I guess it makes sense not to add all of that compat code to this plugin.

Thanks for testing @zang. I've fixed point 3 and 1 should be fixed once the webrtc adapter is used. Still need to test point 2.

Let's use separate tickets to discuss any other issues, this ticket is about uploading files to the server.

Pls help me. How to upload a video file.  step by step.
plugins:
record:
audio: true,
video: true,

@minhnguyenwp there are obvious examples here: https://github.com/collab-project/videojs-record/tree/master/examples/upload If you can't figure it out, contact me and send me a bitcoin and I'll help you out ;)

Thk master. i did exactly like that. but i need upload a video file and i dont know how to add header options with 'blueimp-file-upload', and a simple php get that data file. would u pls help me.!

@minhnguyenwp this sounds like a blueimp-file-upload issue, and you should ask them or place your question on stackoverflow.

@thijstriemstra can you share upload example for the same for php server


you should be able to run go run . local without flags to emulate a kubefirst local without flags

tl;dr: main should mean main everywhere if nothing directed the cli otherwise.
task: we should have a tight correlation between the kubefirst and go . syntaxes.
fully recognize that this is a nuanced issue, we should plan to meet to discuss the implications on this one if it's not all 👍
the context:
binaries

the kubefirst cli binaries that we produce have default tags of our upstream github repositories like kubefirst/gitops-template. to describe the purpose, kubefirst cli version 1.1.0 should be bound to the gitops-template (and other -template) repos of that same 1.1.0 tag by default. they were built with each other and that makes sense. we are doing this part well.
we offer to our users that they can fork our upstream gitops-template repository and reference their copy during installation, this is possible today by including any combination of gitops-owner, repo, and branch flags. these flags could use cleanup and better description/visualization, but we're functionally able to do this now - no known changes needed on this part.

source

developers need to be in branches of both the cli repo (kubefirst/kubefirst) and template repos like gitops-template in order to make full platform adjustments and test the stack thoroughly. since in this case we are running from source there is no ldflag set for the version/tag, and there are flags available --gitops-branch and --metaphor-branch to override this value anyway. whether an ldflag for version/tag is set or not, if --gitops-branch or --metaphor-branch is provided, it should be honored as the preference over tags/version. i think we're doing this, but this need reconfirmation at conclusion of any changes to this logic.
new contributors need to be in the main branch of kubefirst/kubefirst and run the experience against main everywhere as a default. we have a bug where running go run . local with no flags fails with a panic on the push only to metaphor-frontend, the gitops repo is fine. but metaphor-frontend panics on fallback logic.

due to that last source bullet, the proposal is to have logic so that the push to metaphor-frontend defaults to main if (a) an ldflag is not set for version and (b) the branch flags mentioned above were not used.
the order of precedence proposed:
always wins: specified flag owner, specified flag branch
next winner: ldflags baked in at release used to pull from kubefirst owner and tags for template repos
if neither ldflags are set, nor owner is set: kubefirst is the owner, main branch is the branch pulled from all template repos

this is how to replicate the problem area we need to solve:
current behavior - we tell users in the kubefirst readme that we can emulate kubefirst with go run . but when you run go run . local today:

it fails because you didn’t provide --metaphor-branch and panics on push to new github origin
when you then run go run . local destroy to recover, the command actually succeeds, BUT it fails to remove the 2 git repos it created
then when you go run . clean and run with the flag you collide with the repos that never deleted and have to destroy again to recover, then clean, then if committed enough, what are the flags, etc

fully recognize that this is a nuanced issue, we should plan to meet to discuss the implications on this one if it's not all 👍

if we want to move the discussion for the next release, this PR is doing the job to fix the flag requirement: https://github.com/kubefirst/kubefirst/pull/1120
@johndietz wdyt?

@converge yeah this looks like the functionality im after. any issues including it for 1.11.0?

@converge yeah this looks like the functionality im after. any issues including it for 1.11.0?

awesome!
I spent some time testing different possibilities[1], we can include it for 1.11.0.
[1] with dev. mode code, using binary, binary with ldflag set, adding parameters, without parameters, everything is working as expected for these different cases,


monitor not working

Describe the bug
The monitor command doesn't work; it should start reporting server commands from other connections, but currently it just seems to hang the connection without ever reporting anything. If it isn't implemented, it should probably report a -ERR something ?
Expected behavior
(window 1)
➜ .\redis-cli.exe monitor
OK

(window 2)
➜ .\redis-cli.exe set foo bar
OK

(window 1, updated)
1722003049.957668 [0 <IP_ADDRESS>:53956] "set" "foo" "bar"

Actual behavior
(window 1)
➜ .\redis-cli.exe monitor

(note no OK)
(window 2)
➜ .\redis-cli.exe set foo bar
OK

(window 1)
(no update)

Yes, monitor is not supported due to its impact on critical paths. We should report the error message correctly, though, as the first fix here.

👍 something as simple as -ERR unknown command (or something more specific) would IMO be preferable to the current state, which leaves the caller scratching their head

Added PR to return unknown command error. Thanks for spotting!


Correct date of 2020-07-09 meeting in minutes

I was looking at the history of GenevaERS and noticed that this meeting was out of order in the navigation.

Thank you!


App Deploy: Add Public GitLab Repository support

I've pushed a commit with some minor changes, also noticed the deployment info icon for gitlab appears well to the right, think this might be a merge issue. Will have a look on monday

Icon issue was fixed after restarting local dev server


Support for multiple cluster layers

I would like to request a demo in which multiple cluster layers are added to the same map. At the moment, I can only add one <Cluster> component to the <Map> component. Does this library support adding multiple <Cluster> components?

Hey @fidiego in theory you should be able to have multiple cluster, any thought @Wykks ? I can give it a try and confirm as soon as I have some free time

Well, never tried myself, but I don't see anything preventing this. Have you come across any issues while doing that ?

@fidiego You can find an example of a map with 2 Cluster components at the following url https://www.webpackbin.com/bins/-KtmUplkr7W5brK4FPmt

This is great, thank you @alex3165


Create CSVReader from InputStream

Hey @dehesa, had another idea for a feature.
Specifically, I was looking for some way to create a CSVReader reader from stdin.
Since reading from a URL was already implemented on top of InputStream, it seemed like exposing a public API to accept streams directly could work.
CSVReader(input: InputStream(fileAtPath: "/dev/stdin"))

I also saw there's a FileHandle API could maybe accomplish something similar. But I'm not sure how we'd implement converting a FileHandle -> InputStream
CSVReader(input: FileHandle.standardInput)

I'm just noting this as a possible alternative direction. I'm not too familiar with the differences between the APIs. Please share any historical knowledge if you have any 😄
This PR is a draft attempt at the InputStream approach. Will add tests and clean it up if you think it's a good idea.
Thanks!
@josh

Hi @josh,
Adding an API to read from an InputStream is definitely useful. It would enable the user to read from the console, network sockets, etc. Reading from the console's standard input is specially useful if you want to use CodableCSV in command-line applications.
As you have noticed, the CSVReader initializer which accepts a file URL does use InputStream internally. That stream is then forwarded to the decoder's CSVReader._StreamBuffer, where it is used.
When I was writing the API, I didn't expose the InputStream on purpose. The functionality to read from a file (which you know the end) is different from reading from a stream (where you receive many pauses/ends and maybe a final disconnection). Currently, CSVReader._StreamBuffer only supports the file-reading functionality with the added optimization to read in chunks (to not be calling down the kernel often).
If we want to add support for stdin, we would need to:

Pick the lower level APIs which suit our needs.
Whether readLine(strippingNewline:), InputStream(fileAtPath: "/dev/stdin"), or FileHandle.standardInput. There might be more I am unaware of.

Create a new makeDecoder in the ReaderDecoder.swift file and/or stream buffer.
The buffer will fetch whatever is available in stdin and maybe listen for more?

Verify how CSVReader works with this new reading paradigm.
Specifically, what happens when a request for a new row occurs, but the user hasn't type the row yet (or the piped program hasn't send the answer yet). I guess the correct behavior would be to "freeze-and-wait". In any case, we should test all this and maybe throw new errors.

How does that sound?

Ah, okay, so you're thinking reader initializer call that's specific to stdin. How do you think that could be named? Maybe it's like a special case stream enum? CSVReader(input: .stdin)

Whether readLine(strippingNewline:), InputStream(fileAtPath: "/dev/stdin"), or FileHandle.standardInput. There might be more I am unaware of.

I'll give InputStream an initial go since there's already support for that.
As for readLine:

Standard input is interpreted as UTF-8. Invalid bytes are replaced by Unicode replacement characters.

It would lock you into UTF-8 which may not be a limitation we want.

Specifically, what happens when a request for a new row occurs, but the user hasn't type the row yet (or the piped program hasn't send the answer yet). I guess the correct behavior would be to "freeze-and-wait". In any case, we should test all this and maybe throw new errors.

It looks like InputStream and FileHandle both have non-blocking options via blocks. I don't personally have a use-case for async reads, though that could be an API for later.
I think "freeze-and-wait" blocking aligns nicely with the iterative row reader. I'd like to ensure that either reading from a file or stdin acts the same.
// $ parse-csv path/to/file.csv
let reader = try CSVReader(input: URL(filename))

// $ cat path/to/file.csv | parse-csv
let reader = try CSVReader(input: .stdin)

// handle filename or stdin
for row in reader { print(row) }

Here's some scripts I'm testing with.
// usage: slow-csv <count>
import Darwin

let count = CommandLine.arguments.count < 2 ? 1 : Int(CommandLine.arguments[1])!

for n in 1 ... count {
    usleep(1_000_000)
    print("\(n),\(n + 1),\(n + 2)")
}

// usage: read-csv <count> <filename>

import CodableCSV
import Foundation

let start = DispatchTime.now()

let count: Int
let reader: CSVReader

if CommandLine.arguments.count < 2 {
    count = 1
    reader = try CSVReader(input: .stdin)
} else if CommandLine.arguments.count < 3 {
    count = Int(CommandLine.arguments[1])!
    reader = try CSVReader(input: .stdin)
} else {
    count = Int(CommandLine.arguments[1])!
    let url = URL(fileURLWithPath: CommandLine.arguments[2])
    reader = try CSVReader(input: url)
}

for row in reader.prefix(count) {
    let elapsed = Double(DispatchTime.now().uptimeNanoseconds - start.uptimeNanoseconds) / 1_000_000_000
    print("\(String(format: "%.3f", elapsed))s: \(row)")
}

Producer generates a row every second up to 10 total. The consumer reads the first 5 lines.
$ ./slow-csv.swift 10 | ./read-csv.swift 5

I think this is an interesting test case as it should be possible at best for the consumer to finish in 5 seconds (1 second per line) and also print 1 line every second. At the worst case with no streaming, all the lines will be printed to the screen at once after waiting 10 seconds.

Wait, do your scripts work? 😱 I thought some deeper changes in the way streams are read would be required. That is great!

Ah, okay, so you're thinking reader initializer call that's specific to stdin. How do you think that could be named? Maybe it's like a special case stream enum? CSVReader(input: .stdin)

What you propose is quite elegant and friendly for people that don't know much about streams. However if we can assure the correct work of any InputStream (whether .stdin or network sockets, or whatever), maybe it is worth to expose InputStream. I do quite like your syntax, though. Maybe overloading InputStream with a static property? I am not sure...
extension CSVReader {
    public convenience init(input: InputStream, configuration: Configuration) throws { ... }
}

extension InputStream {
    public static standardInput: InputStream { ... }
}

It looks like InputStream and FileHandle both have non-blocking options via blocks. I don't personally have a use-case for async reads, though that could be a neat API for later.

I don't either and I believe the async reads would require deeper code changes. We can skip that for now.

I think "freeze-and-wait" blocking aligns nicely with the iterative row reader.

I think so too, but since I don't have tons of experience with InputStream, I am a bit wary of what happens on edge cases (or not so edge cases), such as the row delimiter is not a line feed or the user is escaping a field and then press enter in the command-line. How does the CSVReader behaves?
Addressing your scripts, they seem to test the regular usage (which is a good first step). I haven't been able to run them though, since CodableCSV library is not imported. How do you run them? I add the shebang #! /usr/bin/swift at the top and even try to do the -I moduleDirectory, but I am getting fatal errors from the compiler. Could you provide some guidance?

Wait, do your scripts work? 😱 I thought some deeper changes in the way streams are read would be required.

Oh yes, your underlying code works 😁

Addressing your scripts, they seem to test the regular usage (which is a good first step). I haven't been able to run them though, since CodableCSV library is not imported. How do you run them? I add the shebang #! /usr/bin/swift at the top and even try to do the -I moduleDirectory, but I am getting fatal errors from the compiler. Could you provide some guidance?

I use swift-sh to make things either. Otherwise you can make a dummy Package.swift and point to your local project. This is basically what swift-sh does.

I think so too, but since I don't have tons of experience with InputStream, I am a bit wary of what happens on edge cases (or not so edge cases), such as the row delimiter is not a line feed or the user is escaping a field and then press enter in the command-line. How does the CSVReader behaves?

Let me test to be sure. But the row delimiter issue should be fine. InputStream isn't encoding aware so it's not treating line feeds any differently that they would be from reading from a file. If you typed invalid CSV directly in the terminal you should get the same thrown decoding error.

Using my test scripts, there’s a few inefficiencies mostly related to the large chunk size. Need to see if there’s some equivalent to read O_NONBLOCK so we could read data up to the chunk size and not block waiting for the entire chunk to be available.

Hmm, so InputStream nor FileHandler have any partial read APIs exposed. If we wanted to support that'd we'd need to drop down to open/read/select. Maybe out of scope for this PR? Though, one of your ideas was to "Make Foundation optional". We research nonblocking after that.

I think so too, but since I don't have tons of experience with InputStream, I am a bit wary of what happens on edge cases (or not so edge cases), such as the row delimiter is not a line feed or the user is escaping a field and then press enter in the command-line. How does the CSVReader behaves?

✅ Tested $0.delimiters.row = "\t"
✅ Tested a,"bad escape,c that should throw _invalidEscapedField

Ok, I got your scripts running and they do indeed work! 😃 After some head scratching asking myself how comes everything works that well, I reached the conclusion that everything is very synchronous (as you kindly suggested); therefore it is basically the same functionality as with URL. For example: slow-csv 100 | read-csv 2 will first finish the 100 iterations and then just read two rows (I guess it is obvious with hindsight).
For this PR we can ignore any type of asynchronous operation, since most people won't use it that way. Although it would be nice to research that in the future (I will add it to the Ideas project) and we should also document that behavior.

Maybe out of scope for this PR? Though, one of your ideas was to "Make Foundation optional". We research nonblocking after that.

I would like to make the Foundation dependency optional. Foundation is not very popular in the server-side and many projects directly avoid it. Also now that Swift is getting some traction on the Machine Learning community (i.e. Linux and Windows), it would be desirable to make CodableCSV the go-to library for reading/writing CSVs in ML pipelines. For that we need to remove the Foundation requirement and improve performance. You can see in the wiki all the current Foundation dependencies. But I digress; we will think about it once we cross that bridge.
Regarding the code placement and the fatalError message. I am happy to accept the PR as it is right now and I will figure it out (probably tomorrow) once I do the Encoder/Decoder auditing.
Do you want to add something else or should I merge it as it is?

Do you want to add something else or should I merge it as it is?

Sure! I'm down to keep iterating on this idea. I'll let you know if I come up any ideas to improve the processing efficiency.

I would like to make the Foundation dependency optional.

Neat! I'd love to help with this as well.

Thank you for your code and readiness @josh. I appreciate it.

Hey @josh, just as FYI, I have performed the following additions/changes on top of your code:

CSVReader: add a static decode(input:configuration:) supporting InputStream.
CSVDecoder: add support for InputStream.
InputStream: change the stdin property name to standardInput.
CSVReader: wrap the Data(stream:chunk:) error into a CSVError.

I am not 100% convinced on point 3. Swift developers recommend to use full names whenever possible and Apple uses the name standardInput in their FileHandle API. So I went with that, but the short stdin has a place in my heart 😄 Do you have any strong opinions?

Nice changes! I could go either way on stdin and standardInput. Both seem great for their own reasons.

btw, published little CLI tool I just built on this API. https://github.com/josh/csv2json
🙌🏻

It looks pretty cool. Congrats! and you are also using the new Argument Parser. That is in my things-to-learn box.
Let me know if I can help you out with anything.


Add system assigned managed idendity for vm and ELK index clean up

Add system assigned managed identity for vm
-- Add option group in UI to let users choose if they want to add the identity.
-- Update mainTemplate and clusterTemplate to adopt users' choice.
Add ELK index clean up step in the workflow
-- Update build.yml to pass guidValue for generating ELK index so the index can be used later at the added cleaning step.
-- Update gen-parameters-deploy-elk.sh to adopt passed guidValue.

@edburns  Hi Ed, here is the PR for adding sys-assigned managed identity for the configured cluster offer, could you pls review it?
Also added ELK index clean up step to the workflow

@edburns  Hi Ed, here is the PR for adding sys-assigned managed identity for the configured cluster offer, could you pls review it?
Also added ELK index clean up step to the workflow

Hello @edburns, I pushed the changes of ELK deployment changes to this PR, then Zheng and me do not need to solve confilct.


Transaction Cache

Resolves #206
Brief description
Adds a transaction cache
Checklist

[X] I have built this pull request locally
[X] I have ran the unit tests locally
[X] I have manually tested this pull request
[X] I have reviewed my pull request
[X] I have added any relevant tests

Demonstration
2022-03-21 06:55:22.070990 (p2p.Koinos) [p2p/transaction_cache.go:87] <info>: TransactionCache.pruneTransactions: pruned 1 transactions                                                                                2022-03-21 06:55:22.071033 (p2p.Koinos) [p2p/transaction_cache.go:88] <info>: Items currently in transaction cache: 0
2022-03-21 06:55:22.071050 (p2p.Koinos) [p2p/transaction_cache.go:49] <info>: TransactionCache.addTransactionItem: added transaction to cache: ID: 0x12202bce7f56692050d7bcc4b988123a6bcd5b4a7c33ad63da2f0ed3ca2db34efe45
2022-03-21 06:55:22.071064 (p2p.Koinos) [p2p/transaction_cache.go:50] <info>: Items currently in transaction cache: 1

This might be a bit nit-picky, but I'd really like to see a demonstration of this log line:
log.Debugf("Gossiped transaction already in cache - %s from peer %v", util.TransactionString(transaction), msg.ReceivedFrom)
This would ensure that the cache is actually helping prevent what we think it should be preventing.
Other than that, this looks good.

We should also add transactions seen from blocks to the transaction cache.


Phaser CE Version 2.8.2

Please publish to npm @photonstorm

Published and released on here too. Congratulations all.


Transactions - PendingTransaction.isExpired - test for off-by-one error here

Is your feature request related to a problem? Please describe.
Filling an additional issue to provide a link to the code base TODO occurrence.
We'd like to test for off-by-one error here. Should we use <= or < in PendingTransaction.isExpired?

this can probably be closed  @ccjernigan

Closing because pending transactions are being removed.


doc: remove desugaring section as no more need on media3 1.4.1

Summary
doc:  remove desugaring section as no more need on media3 1.4.1
Motivation
Keep doc up to date

Thanks for update!


adds mongodb prometheus exporter scrape timeout config option

What this PR does / why we need it:
this pr allows configuration of scrapeTimeout for the mongodb-exporter
Checklist

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md

@steven-sheehy

cc @steven-sheehy

/ok-to-test
/lgtm


Xcode auto changes of indentation in NightscoutConfigStateModel.swift

@LiroyvH, The reason for this PR is that whenever one builds based on the current code, Xcode will automatically change the indentation of these lines:
https://github.com/LiroyvH/Trio/blob/f902c73c44b500d87560d8e9ca0f3b6454f8ea9f/FreeAPS/Sources/Modules/NightscoutConfig/NightscoutConfigStateModel.swift#L52-L55
The result is a set of uncommitted changes, which will cause issues later when pulling updates. This PR will commit those changes, and then the issue is sorted.


Tutorial 4 - Geophysics (Seismology): Ideas and basic concept

Within the pre-workshop we plan to have a tutorial covering topics regarding geophysics / seismology (see Tutorial 4 in the schedule table at https://hackmd.io/JtJP8TyNQBiEUNGHZwfhhg#Schedule). This issue should help to bundel ideas for topics and the basic structure before starting to work on a JN in PR to avoid double work 🙂. Feel free to edit this issue and add your own ideas :rocket:.
Creator / presenter

@jhtong33
@yvonnefroehlich

Possible topics

focal mechanisms (beach balls): Figure.meca
-> https://www.pygmt.org/dev/gallery/seismology/meca.html
-> https://github.com/GenericMappingTools/pygmt/pull/2550
geology (faults): Figure.plot (line fronts)
-> https://www.pygmt.org/dev/gallery/lines/linefronts.html
anisotropy (bars): Figure.plot (orientated bars), Figur.velo (so far not used by @yvonnefroehlich )
-> https://www.pygmt.org/dev/gallery/seismology/velo_arrow_ellipse.html (actuall on velocity arrows)

I think "seismic anisotropy" might not be simple for non-seismologists.
I have some ideas:

profile, seismicity, and focal mechanisms (maybe Mw>6)
relative plate motion(velo) ?
lithosphere thickness (xyz2grd/grdimage/grdcontour) https://ds.iris.edu/ds/products/emc-cam2016/
geology(faults and volcanos)

I think it is better NOT to explain about focal mechanisms. It is a specific module just for that. For those who are not interested, it will not bring them anything. For those who are interested, I think they can learn it on their own. It is a simple module. I would mention that it exists.

I think "seismic anisotropy" might not be simple for non-seismologists.

I think it is better NOT to explain about focal mechanisms. It is a specific module just for that. For those who are not interested, it will not bring them anything. For those who are interested, I think they can learn it on their own. It is a simple module. I would mention that it exists.

Yeah, probably you are right, focal mechanisms and seismic anisotropy are specifically related to seismology.

For a more general set up we could do something in the direction of:

xyz2grd: Preparing the data to be a GMT-ready grid; depends on the format of the used data
grdimage: Plot the grid with color-coding; add a colorbar
grdcontour: Add contour lines on top of the map
grdprojekt, grdtrack: Mark a profile within the study area, extract and plot the values along this profile in a Cartesian plot (see also https://www.pygmt.org/dev/gallery/images/cross_section.html)

Maybe we can have an “Additional task” section at the end of the tutorial with suggestions for further adjustments and give some links to additional resources or examples:

Chosen another study area with focus on earthquakes, faults, or volcanos and plot the related feature on top of the map.
Add additional things like the plate motion, the beachball of a specific earthquake or anisotropy bars.

In my first-figure tutorial, I have already cover grdimage, makecpt, and colorbar.
I think xyz2grd, grdcontour, grdtrack will be great direction.
Since we have 45 minutes, perhaps we can add simple earthquake profile and basic beachball. (see also https://www.nature.com/articles/s41467-020-14745-8/figures/1)

In my first-figure tutorial, I have already cover grdimage, makecpt, and colorbar.

Ah, nice. And this is actually good, so we can save some time. Then we focus on grdcontour in this tutorial and we do not need to spend much time on explaining makecpt and colorbar again.

I think xyz2grd, grdcontour, grdtrack will be great direction.
Since we have 45 minutes, perhaps we can add simple earthquake profile and basic beachball. (see also https://www.nature.com/articles/s41467-020-14745-8/figures/1)

As we now have a general idea of what we want to teach in this tutorial, I think we can start creating the tutorial. Regarding adding details, I think the easiest way is to (more or less) finish the "xyz2grd, grdcontour, grdtrack" part; and based on how much time we have left we can extend the tutorial regarding more features (seismicity, beachballs, etc.).
What is the best way to work on this tutorial as a team? I think one of us can just start and open a PR with a rough draft and then we go through this and give suggestions and add ideas.


Adding in unintern function

See https://github.com/rustwasm/wasm-bindgen/issues/1386#issuecomment-544530828 for an example use-case for this.

👍


CPLEX Unable to interpret unconstrained variables

Hi all. I'm solving a large optimization problem built with PyPSA. In the past I have used gurobi but am trying to set up cplex so that I can run unlimited number of instances in parallel. In every model I try to solve, CPLEX returns the same error:
CplexSolverError: CPLEX Error  1615: Line 2465: Expected number, found 'i'.
To recreate, I use the linopy optimization example from: https://pypsa.readthedocs.io/en/latest/examples/optimization-with-linopy.html
import pypsa
import cplex

n = pypsa.examples.ac_dc_meshed(from_master=True)

n.optimize(solver_name='cplex')

This code returns the above error. Running this code without specifying a solver defaults to Highs and returns an optimal solution. I ran this in an anaconda environment using python 3.10 and the following package versions:
cplex: <IP_ADDRESS>
linopy 0.3.15
pypsa 0.31.0
From the research I've done, it seems that creating the model using the PyPSA network passes 'inf' on variables with no constraints. CPLEX is interpreting 'inf' as a string rather than a number.
Solutions tried:

Running the above example using Highs
Result: works properly

Building the model and exporting it to csv. Then manually going through all CSV's and replacing 'inf' instances with 1000000. Then running:

n = pypsa.Network()
n.import_from_csv_folder("oct 10")
n.optimize(solver_name='cplex')

Result: CPLEX returns the same error still

Testing CPLEX in the same environment using linopy only in an example problem.

m = linopy.Model()

x = m.add_variables(lower=0, name="x")
y = m.add_variables(lower=0, name="y");

m.add_constraints(3 * x + 7 * y >= 10)
m.add_constraints(5 * x + 2 * y >= 3);

m.add_objective(x + 2 * y, sense="min")

m.solve(solver_name="cplex")

Result: CPLEX runs normally and returns an optimal solution

Converting the PyPSA network to a linopy model and solving:

n.import_from_csv_folder("oct 10")
m = n.optimize.create_model()

linopy.solvers.run_cplex(m)

Result: same CPLEX error as others.
Any and all help is appreciated. Thanks in advance.

Found a partial workaround for my use case doing the following:
n.constraints.remove('Generator-e_sum_max')
This does not work for other examples, such as the basic example I posted. I don't have time to investigate this problem further as I'm just using this workaround to run cplex from now on.


--no-clobber doesn't seem to work on mac

so i just removed it :)

Can you try with cp -n on mac ?

Yep that seems to work :)
Btw this repo looks awesome!! Thanks for open sourcing it!  Any tips on
where to learn a bit about redux?
im looking at this for the time being
https://egghead.io/series/getting-started-with-redux
On Thu, Nov 26, 2015 at 9:20 PM Gildas Garcia<EMAIL_ADDRESS>wrote:

Can you try with cp -n on mac ?
—
Reply to this email directly or view it on GitHub
https://github.com/djhi/my-nutrition/issues/2#issuecomment-159989812.

Thanks :) Glad you like it ! The egghead videos are great but you should read the redux documentation too. @gaearon did an amazing job on it. I'm still learning redux and trying to use it correctly ^^

Yeah, thanks a lot for open sourcing this. I like how all concerns are seperated. I have been investigating / learning new technologies for my next app. This architecture looks promising.

My pleasure! If you have comments and/or suggestions to improve it, please do so. It could be great to create an npm package for some Meteor Redux middlewares

Ouais, je me demandais si tu les as crée ou si ils existaient déjà quelque part ?

Keep the comments in english for the others please ;) I made them from scratch but I think there are better ways to handle the subscriptions. I've seen a comment from @jedwards1211 on meteor forum about a middleware and I would love to see how he did it.


sandbox: prevent bash/zsh/fish shell history reading

[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same change?
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[x] Have you successfully run brew tests with your changes locally?

Way way way too many things still require you to enter passwords into the terminal & not do anything to mask that, which then gets stashed away in your shell history, as well as any servers you ssh into, etc. There's a lot of sensitive information in there, basically.
Since Homebrew doesn't police network usage during builds better to deny read completely & close the small loophole. In reality almost everything in HOME should be blocked off for reading during builds, but there's a bunch of people who prefer to put Homebrew in HOME which this would screw with if we went that broad. We should get there eventually but compatibility baby steps.
Also gets rid of this exceptionally annoying message when you debug builds:
zsh: locking failed for /Users/xyz/.zsh_history: operation not permitted: reading anyway

@MikeMcQuaid @ilovezfs Can someone with the access to do so reopen this please? It was incorrectly closed by Mike's commit message from https://github.com/Homebrew/brew/issues/2502 😄.

@ilovezfs Much appreciated ❤

Apologies!

No worries! It happens 😄. Will try to push some commits here later today.

This is the next big thing on my to-do list now the caveats PR is done with. Likely won't be today but should see some action tomorrow. Mostly posting this so the bot that prowls around & tells people off for leaving Issues/PRs inactive doesn't flag this one 😄.

@DomT4 You may also be interested in https://github.com/Homebrew/brew/pull/2617

@DomT4 in case you didn't see this is probably vaguely interesting: https://github.com/Homebrew/brew/pull/2617

Yeah noticed that earlier & thought about it a bit in this context. I don't think it'll directly impact this too much, but I'll remember to test against your PR if it doesn't get merged by the time I tweak this.

Made changes locally, but still testing through & will need to write up some tests to minimise the risk of breaking things weirdly. Hoping to be happy enough to open it up to review later today 😅

@probot-stale[bot] Thanks for the reminder, I'm a bad human.

This still needs a bunch of review, not least because I've sprinkled it with code comments requesting precisely that heh, and it needs brew tests added, and I want to install a bunch more formulae locally under it first, but thoughts welcome on direction.
Never let it be said that I won't eventually continue work on PRs 😅.

I'm not really sure what Homebrew is doing with /Users/xyz that causes the tests to erupt when deny_read_path "/Users/#{ENV["USER"]}" is in effect. Trying to work out what it wants to read that I've not already whitelisted for one reason or another.

@DomT4 If I were in your 👞 I'd be getting one of the tests that's displaying Operation not permitted in the stderr output and fiddle with it so you can read the whole stderr output and that'll show you what it's not letting you read.

I had a hunch overnight that looks like it may be correct, in terms of the tests wanting to read /Users/xyz itself, which the output looks like it's confirming.
I should be able to change it to deny reading to everything under /Users/xyz rather than /Users/xyz itself which I'm hoping will resolve the issue. There's a ton of different ways to discover username on macOS & there's no reasonable reason to deny things the ability to check HOME or USER exist.

Still very much a WIP but latest push should fix the existing tests.

Apparently not on CI. I'm getting consistently clean runs locally now. Hmm.

Sorry for the delay in replying to review, have had a fair bit going on lately. Appreciate the comments.

In my zshrc because I'm lazy I have functions that flip my active GPG key around depending on whether I'm signing personal stuff or signing code stuff. That's not a super novel idea & there's certainly a chunk of folk who have keys they keep non-public & given Homebrew doesn't police network calls during build it seems kinder to be overzealous on presuming everyone is potentially compromised rather than assuming everyone has good intentions & perfect security. Fundamentally we don't lose anything by protecting those files, so. As long as functionality isn't impeded I think a sandbox potentially too broad is a better option than a sandbox potentially too narrow.

The location of the history files for most of these shells is configurable; we should probably respect that.

If we're going to be conservative about what we deny, perhaps we should deny $HOME/.ssh as well as the shell history files? That's pretty sure to be sensitive.

Given all this I'm increasingly 👎 on the whole idea of this PR. The sandbox doesn't exist to stop the buildsystem from reading random files on disk, it exists to partly stop writing files in random locations and primarily to enforce our prefix/keg system.
If you don't trust software you're installing to not read your configuration files and send them over the network to some malicious source at build-time: why on earth would you trust running the compiled code that can do exactly the same thing without you noticing?
I'm concerned at this point this becomes pretty arbitrary whack-a-mole.

As I have outlined to you in repeated discussions over the years, not just on this topic but on others, my point of view has always been that Homebrew has a strong responsibility to protect within its boundaries.
Yes, we do not protect users from what happens the first time they run a tool, which in some ways is a disappointing side of package management whilst also being a deeply realistic position. Nonetheless we do attempt to protect users with "sane defaults" across the board, whether that's in choosing to pick up upstream/Debian/etc security patches and applying them out-of-band or choosing not to ship known-insecure cryptographic protocols before upstreams formally toss them.
Heck, if my memory doesn't completely fail me, you even consented to turning off ssh password authentication for the CI machines that produced bottles out of minor concerns ssh passwords have some well-known pitfalls. It's not like Homebrew has never proactively taken steps to close potential holes, and that has never been limited to any specific element of the project at least for as long as I've been lingering.
What happens once the brew process and its children have finished executing is beyond Homebrew's remit, I fully appreciate & agree with that point. What happens under the Homebrew umbrella however feels like fair game for considering whether or not things can be tightened up.

Ultimately though, above comment aside, I'm gonna let it be here. I don't foresee a ton of positive feelings on either side if this discussion continues so what's the point in us both ending up there if it achieves nothing. Thanks for the review folks.

It's not like Homebrew has never proactively taken steps to close potential holes, and that has never been limited to any specific element of the project at least for as long as I've been lingering.

There's a pretty big difference between closing known attacks that haven't been used against us and closing unknown attacks that don't seem to have been used against anyone.
In this case, to make this attack you'd need to compromise upstream's source code. If you were going to do that why would you sabotage e.g. the Makefile where this could be dramatically easier to detect and stop than the runtime of the application?

What happens under the Homebrew umbrella however feels like fair game for considering whether or not things can be tightened up.

The point worth remembering (that itself may be worth changing and making a PR for): as-is homebrew/core is the only tap that has the sandbox enabled and it also has bottles for pretty much anything that requires a build-system.

I'm gonna let it be here.

That's fine. I felt it was necessary to respond to the points you'd made in this PR should others want to do something similar in future so they have an understanding of my position.


Cards Not Visible in Dark Mode

When using dark mode, some cards on the page may not be visible due to insufficient contrast between the background and text colors.
Light mode:

Dark mode:

can you assign this issue to me?

I would be happy to solve this problem

If you assign this issue under GSSoC'24-extd, then I would love to work on that.

@icemberg Issues are assigned on a first-come, first-served basis. If a contributor doesn't contribute within 1 week, it will be reassigned to the next person who requested it. You can wait or find another bug/feature to contribute to. Thank you!

@Hamza20203064 Thanks for creating the issue in BuddyTrail!!! The issue has been assigned to you.
Before you start working on your PR, please make sure to:

⭐ Star the repository if you haven't already.
Pull the latest changes to avoid any merge conflicts.
Attach before & after screenshots in your PR for clarity.
Include the issue number in your PR description for better tracking.

Contributors will start at Level 1, and their level will increase based on the quality and quantity of their contributions. The more effort and value you bring, the faster you'll progress. Put forth your best effort to unlock new levels and opportunities!
I'm excited to see your contribution as part of GSSOC EXTENDED 2024! 🎉
Don't forget to follow me on GitHub for more updates.
Happy open-source contributing! 🚀


Use crd:maxDescLen=0 only when required

The workaround is required when applying CRDs in
the cluster but not during other operations like
make manifests, bundle, test etc.
Related: #55

Looks fine to me. We might want to revise this and give it a non-zero number at some point.
We should merge this one, but maybe we can open another PR where we can debate an appropriate non-zero number for this option.


ECONNRESET when using new lambda runtime server and live debugging after 5s

Hello, first of all I really love the option of live development and debugging of lambdas with serverless stack, great work!
After updating to a more recent version of SST, I am running into an ECONNRESET error after 5s of debugging a lambda function with 'sst start' and using breakpoints. I spent some time on debugging and want to share my thoughts about the issue. Also I found a workaround which works for me. It might be a solution but not sure if this is the ideal way to solve it.
Setup

macOS: BigSur 11.6
SST: 0.50.1
CDK: 1.126.0
IntelliJ: 2021.2.2 Ultimate
node: v16.10.0

How to reproduce

Install SST
Create a new SST project with 'npx create-serverless-stack@latest my-sst-app --language typescript'. Error should also happen with JavaScript but did not check.
Start live debugging with 'npx sst start' in IntelliJ by following this example
Set a breakpoint inside of the default lambda function
Access your API with browser/curl/etc.
Wait at least 5s before letting the lambda function run to completion in the debugger.
You will get the following error output in the terminal Uncaught Exception      {"errorType":"Error","errorMessage":"read ECONNRESET","code":"ECONNRESET","errno":-54,"syscall":"read","stack":["Error: read ECONNRESET","    at TCP.onStreamRead (node:internal/stream_base_commons:220:20)","    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)"]}
Browser/curl will show an error of the AWS-Gateway after 30s

Assumption
The ECONNRESET error happens because of the connection between the lambda RuntimeClient and RuntimeServer on the local machine. Also it happens only with SST >= v0.47, so I assume it is related to the new lambda runtime server. It took some time to figure out what happens, because I am quite new to SST and also not a nodejs expert :) Capturing the network traffic between runtime server and client shows that the server closes the TCP connection after 5s. When the lambda execution is continued in the debugger after the server closed the connection, the runtime client tries to re-use the closed TCP connection and gets the ECONNRESET.
The assumption is that we are hitting the problem described at https://nodejs.org/api/http.html#requestreusedsocket.

When sending request through a keep-alive enabled agent, the underlying socket might be reused. But if server closes connection at unfortunate time, client may run into a 'ECONNRESET' error.

In our situation the 'unfortunate time' is nearly always the case, because the nodejs event loop is blocked by the debugger/breakpoint. This results in the server closing the TCP connection after 5s and whenever the execution continues, it hits this 'unfortunate time' by using a closed TCP connection.
Workaround
I fixed it for me by turning off 'keepAlive' for the runtime client by setting this to false: https://github.com/serverless-stack/aws-lambda-nodejs-runtime-interface-client/blob/main/src/RuntimeClient/RuntimeClient.ts#L81 This works because the client does not try to re-use the TCP connection but instead creates a new one all the time. Maybe not ideal but works for me.

Hey @mbld, thanks for digging into this issue!
Let me loop in @thdxr, he's looking into this exact issue.

Wow that's amazing work. I was looking into this issue and hadn't figured out the source of it. I'll fix and get a release out

Looks like there's a keepAliveMsecs and timeout option that we can turn up. I'll experiment and see if they work


Dynamic Turn credentials

Hello all.
I was thinking about creating a mapping between participant identity and turn username. I am using pion/turn as my turn server and i can create a shared store to keep the mapping. However in Livekit you can only set turn credentials through configs and that is not flexible.
My idea was to make ice server generation an interface and provide multiple implementations. One would use the config, one would use shared store as mentioned before and so on... Does this seem interesting to you or it's just me?
Can you help me implement this feature?

I've already solved it but using CoTurn which implements proper dynamic credentials, you only need to create a long-term credential that goes in the livekit config as a fallback. Then your backend service can generate dynamic credentials with a CoTurn secret that is stored in a central database shared by all the CoTurn instances and share it with the clients, your clients have to use the iceServers from your backend services instead of the ones from livekit.

I've already solved it but using CoTurn which implements proper dynamic credentials, you only need to create a long-term credential that goes in the livekit config as a fallback. Then your backend service can generate dynamic credentials with a CoTurn secret that is stored in a central database shared by all the CoTurn instances and share it with the clients, your clients have to use the iceServers from your backend services instead of the ones from livekit.

Hey wolmi, thanks for your reply.
Your solution requires client modification and i vant to stick with Livekit's client SDKs. you also wouldn't be able to create a mapping between the rooms and turn participants. However what i'm suggesting is a will be implemented in Livekit and no client modification is required.

Understand the request. Though this adds quite a bit of complexity to LiveKit and is outside of our design scope. We may consider it in the future, but it's not something that will be available in the near future.


help center: Document viewing read receipts on mobile.

Adds instructions for viewing read receipts in the mobile app.
Fixes #23479.
Screenshots and screen captures:

https://zulip.com/help/read-receipts#view-who-has-read-a-message

Self-review checklist

[x] Self-reviewed the changes for clarity and maintainability

Communicate decisions, questions, and potential concerns.

[x] Explains differences from previous plans (e.g., issue description).
[x] Highlights technical choices and bugs encountered.
[x] Calls out remaining decisions and concerns.
[x] Automated tests

Individual commits are ready for review (see commit discipline).

[x] Each commit is a coherent idea.
[x] Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

[x] Visual appearance of the changes.

@alya This PR is ready for your review.

Looks great to me!

Merged, thanks @drrosa!


Possible bug in Zend\Log\Writer\FirePhp::__construct

It seems to me that this condition should be reversed?

If that is the case the following existing test should trigger that exception: ZendTest\Log\Writer\FirePhpTest.

Okay, i understand what is happening now. the use statement at line 17 is trying too load a class with a relative namespace path. this is invalid.  therefore the FirePhpInterface does not exist. and the check fails. If you use the full namespace path the tests will fail

Checking for a non existing interface, nice catch :+1:


Speech Recognition stop after few Hits

Problem-
Currently it uses https://pypi.org/project/SpeechRecognition/ for speech recognition.
 # for testing purposes, we're just using the default API key
 # to use another API key, use `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")`
 # instead of `r.recognize_google(audio)`
 print("Google Speech Recognition thinks you said " + r.recognize_google(audio))

after few hits of recognize_google() we are not able to use it.
Solution-
Need to implement Deep Learning based model to recognition speech.
Difficulty?
It's time, LOL. I am the only one who is currently working on this project. Contribute on this to make it big.
Read Docs for the contribution https://github.com/Dipeshpal/Jarvis_AI

I have implemented the Transformers word2vec model to do speech recognition. Now we don't need to use mic_input() function, instead of that we can use mic_input_ai().
It has some limitation, like it may not recognize other language except "English". Not very accurate because AI/ML can make mistakes. But it is working perfectly in our use cases.
But till now (Feb 23, 2021) I haven't updated ML Model with hot_word_detect() function. In this hot_word_detect() we are still using google_speech_recognition.
Why? Because mic_input_ai() may not able to recognize words like "Jarvis", "Alexa" so that's why we are still using google_speech_recognition in hot_word_detect().
Any suggestion? Feel free to contact me.
But for now everything is working.


histogram-like density plot, without the histogram bar.

Is your feature request related to a problem? Please describe.
I'd like to duplicate the following code in Seaborn, where I can plot a histogram-like density plot, without the histogram bar.
x = np.random.randn(100)
ax = sns.distplot(x, hist=False, kde = True)
Describe the solution you'd like
Something like this, group by a level.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

This is definitley something we need.

We need this feature.

I like the idea! Like mentioned in this thread, I believe we need to create an ECharts-based histogram plugin to replace the legacy one anyway. It could be one plugin that does both lines and bars, or two different plugins, but they'd be pretty similar in scope, I think.
This isn't a bug, but I think it's a worthwhile Idea, so I'll convert it to an Ideas thread for now, and hope it garners some interest.


Aurorian Slimes' Neat Health Bar Is Too High

This is a small bug, but for some reason, when using the Neat mod (which adds health bars to mobs), it places the Aurorian Slimes' health bars like 2 blocks above their body. It should normally be right above their body, less than a block away, but it's not that way for Aurorian Slimes.
Maybe it has something to do with the fact that slimes have different sizes, and Neat thinks that Aurorian Slimes are the biggest slime size, when in fact, they are the smallest?

Here's an example pic of the regular distance between a neat health bar and a mob:

Thanks, should be fixed now.
https://github.com/elseytd/TheAurorian/commit/e29d397480e597c8ab3fbc976a3f5a5c12b0c641


[WFCORE-6907] Remove deprecated SimpleResourceDefinition.registerAddO…

…peration variant
https://issues.redhat.com/browse/WFCORE-6907

Core -> Full Integration Build 13691 outcome was FAILURE using a merge of 07d15c32728f777bbbc7fb92cd8f1b6b820fc2cb
Summary: Compilation error: Compiler (new) Build time: 00:03:06

Core -> WildFly Preview Integration Build 13762 outcome was FAILURE using a merge of 07d15c32728f777bbbc7fb92cd8f1b6b820fc2cb
Summary: Compilation error: Compiler (new) Build time: 00:03:55

Core -> Full Integration Build 13977 outcome was FAILURE using a merge of 07d15c32728f777bbbc7fb92cd8f1b6b820fc2cb
Summary: Compilation error: Compiler (new) Build time: 00:04:36

/retest

I manually re-ran the security manager test as I cannot reproduce the failure.

The failure is now different.


Set PWM to 0 during BRIDGE_WAIT

Commit 33444ff:
Before this change, the n-channel MOSFETs got a PWM signal also during the BRIDGE_WAIT stage. This would lead to a short in the bridge if pwm_dir(BRAKE) is used instead of pwm_dir(FREE) during BRIDGE_WAIT.
With this change, it is possible to use pwm_dir(BRAKE). I tested it on actual hardware, and it does work and is visible when using long BRIDGE_TIMEOUT intervals for testing. However, when using realistic BRIDGE_TIMEOUT intervals it makes no noticable difference, if BRAKE or FREE is used during BRIDGE_WAIT. I would even think that FREE is the better choice, because of several reasons:

No noticable difference between BREAK and FREE.
It is saver to have both MOSFETs closed.
Shorting the motor to break with both p-channel MOSFETs could potentially put additional stress to the p-channel MOSFETs which are already the weak link compared to the n-channel MOSFETs due to their higher RDSon.

The proposed change in this pull request should IMO nevertheless be made, because it adds safety.
Commit a21e19c:
This commit first closes the p-MOSFET in line 428 before opening the other p-MOSFET in symmetry to line 439. Always close before opening seems more save. But the more important change is the addition of the delay() lines. I think, what killed my p-channel MOSFETs was not the addition of the adaptive bridge timeout feature, but simply performing fast tic-tocs I recently managed to accomplish.
To test this, I firmy held the controller board to sense the temperature of the MOSFETs of one motor. Then I perform fast throttle changes from full forward to full backward. After a few cycles the MOSFETs get noticable hot to the touch, and I am sure they would burn out if I would continue this.
I think, without the delay() there might be a short period of time, where both n- and p-channel MOSFETs are open effectively shorting the bridge. Even a very short time at each throttle reversal would be enough to get them considerable warm after a few fast throttle switches. My theory is, that even after setting the PWM to 0 with the pwm_set_reverse(i, 0) and pwm_set_forward(i, 0) calls, the current active PWM cycle runs to completion, and immediately opening the p-channel MOSFET in the following line without any delay will lead to a very brief short of the bridge. Not noticable in normal operation, but increasing the temperature of the MOSFETs on continuous fast throttle direction switching.
For 32 kHz PWM a short delay() would be sufficient, for 450 Hz it could take up to 0.5 ms. However, I did my "temperature sensing tests" while wildly switching throttle direction with delay(100) and delay(1000) and had the impression, that delay(1000) keept them even cooler. Maybe it's not only PWM-run-to-completion, but also that the p-channel MOSFETs take some time to close because they are probably switched off using some pull-ups (to be able to switch them with open-drain drivers of the MCU).
With this change in place, the MOSFETs barely get warm, also on fast throttle switches.
That being said, I think the adaptive bridge timeout feature is not worth it. If one sets the timeout to some value, it should not be changed by some heuristic motor model.

Open before close is a fine concept, but the routine is always run after pwm(FREE) so both fets would be off anyway.
I think the pwm cycle turns off instantly when the pwm is set, it's an option in the hardware for it.
I have to think about it some more. I think your fets might have broke from overheating as well, as max currnet is much lower as heat goes up. The adaptive time did an average of all motors, and if performing flip in the same direction, the same fets would have had less time.
Did you run bridge time 10k in normal bridge mode without any issues?
Another way to brake would be to use the N-fets. At least they seem more resilient, I have not fried one yet.
I would prefer to not have delay(1000) in there as the loop time is 1000.

Did you run bridge time 10k in normal bridge mode without any issues?
Up to now, yes. But I also only recently started flying fast tic-tocs, so it's hard to say.

I would prefer to not have delay(1000) in there as the loop time is 1000.
ok, then let's at least use delay(100). I thought it is not a big deal since it is run only in one cycle when switching direction. I will test in the evening again with delay(100). I suppose, anything is better than no delay.

And commit 33444ff ?

But I don't see why it would do anything, they should already be off from the bridge FREE stage , which lasts 10k uS. I mean 100 is little, so not a problem.

good thinking, but i'm afraid it's redundant:
void pwm_set(uint8_t number, float pwm) { if (pwmdir == DIR1) { pwm_set_reverse(number, pwm); } if (pwmdir == DIR2) { pwm_set_forward(number, pwm); } }
The routine does not send pwm unless it's in an actual valid direction.

But I don't see why it would do anything, they should already be off from the bridge FREE stage , which lasts 10k uS. I mean 100 is little, so not a problem.

Correct. But if someone decides to use bridge BRAKE, it would add some safety.

good thinking, but i'm afraid it's redundant:

No, it's not :)  I think you are mixing up bridge_stage (which can be BRIDGE_WAIT, BRIDGE_FORWARD, BRIDGE_REVERSE) with pwmdir (which can be DIR1, DIR2, i.e. REVERSE, FORWARD).
pwm_set() only checks pwmdir, so it is always in a valid state, and thus sends PWM to the n-channel MOSFETs, even during BRIDGE_WAIT.
I was also surprised when seeing this with my scope which I had connected to the gates of the bridge MOSFETs. As already mentioned above, without Commit 33444ff this would short circuit the bridge when using BRAKE.

Ha ha you can't sound offensive finding my mistakes.
I really thought it was redundant, I looked at again it not long ago. I guess a rework of it is required. Will look at it tommorow, it's getting late and I have been programming for hours today :)

OK, I removed the delays. They don't seem to reduce the p-channel MOSFET heating on fast throttle direction switching.
What now remains in this pull request https://github.com/silver13/H101-acro/pull/5/files is

The fix for turning off PWM during BRIDGE_WAIT
Renaming DIR1 to REVERSE and DIR2 to FORWARD for better readability
Closing the MOSFET before opening the other one in the FORWARD case to make it consistent to the REVERSE case.

Ok, but I will remove the bridge check in control and include something similar in drv_pwm to make it failsafe from a file point of view


Add phrase_limit to highlighting

Change order from string to HighlighterOrder?
Change TagsSchema from string to HighlighterTagsSchema?
Remove BoundaryMaxSize
Change Encoder to HighlighterEncoder?
Remove encoder from highlight fields as it is only valid on the top level highlighter
Add Encoder and PhraseLimit to integration test

Requires backporting to 5.x and 2.x in a non-binary breaking way.
Closes #2851

Changed the parameter to a bool? with a default value. @codebrain would you mind taking another quick look please?

Ported to:

5.x: 5632144a04d4bb8025f420787b8e27223be16ea1
2.x: efbb717b3819c5570a20a5d1523bf116798e35e7


Do not quote boolean parameters in the job resource

Signed-off-by: Mendy Baitelman<EMAIL_ADDRESS>Description
Currently when passing in parameters the code always quotes them. If they are booleans when quoted Jenkins treats them as text instead of boolean.
This change skips quotes if the value is of TrueClass or FalseClass.
Check List

[X] All tests pass. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD
[X] New functionality includes testing.
[X] New functionality has been documented in the README if applicable
[X] All commits have been signed for the Developer Certificate of Origin. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

Thanks @mbaitelman


Redirect issue with CreateRelease() or UpdateRelease()

Hi,
I built a small code to create or update release in a github entreprise url thanks to your project.
But I made a small mistake by forgotten the s in the http url string. My fault ;-)
Because of that, all queries that I made (ListReleases, ListTags, and login) got the 301 return code and redirect appropriately to the https equivalent.
But not for CreateRelease or UpdateRelease.
I'm wondering if this behavior is normal one. I'm wondering if those functiona should redirect as well to the appropriate link, like others.
I would consider this as a bug, but I'd like to see if you do consider it as well.
If so, I could spend time to review the code and propose a patch.
Thanks

Hmm, supporting redirects transparent like that sounds like a double-edged sword. On the up side, it allows things to work, but on the (much more significant IMO) down side, it makes it harder to realize it's happening. Going through http -> https redirects like that means there are 2 HTTP requests being made for every single API request. More work for both the client and server, more latency.
I wonder if we can disable such redirects in the first place and return an error right away, in turn making such an unintended error much more visible and impossible to accidentally make? Would it break any of our existing endpoints, is there anything that requires redirects even if https is hit directly?
If we can do that, I think that's the best solution. What do you think?

if I remember correctly, there are a number of API calls that should follow redirects (for example, fetching release assets, which are typically stored on Amazon S3 so GitHub sends a redirect to that URL).  So I don't think we'd want to disable redirects entirely.
Also, does GitHub Enterprise allow you to host on an http URL or do they require https?  I'm guessing they do allow it, in which case we couldn't simply enforce that you always use an https URL.  I'm honestly not sure that there is a good fix for this 😕

if I remember correctly, there are a number of API calls that should follow redirects (for example, fetching release assets, which are typically stored on Amazon S3 so GitHub sends a redirect to that URL). So I don't think we'd want to disable redirects entirely.

I was just looking at that, and I found that they explicitly don't follow the redirects. Instead, they return the redirect URL to caller, so the caller can then fetch the asset from AWS, etc. See:
https://github.com/google/go-github/blob/fbfee053c26dab3772adfc7799d995eed379133e/github/migrations.go#L169-L185
https://github.com/google/go-github/blob/fbfee053c26dab3772adfc7799d995eed379133e/github/repos_releases.go#L239-L254
Is that right @willnorris? Or are there some other API calls that I haven't considered?

Also, does GitHub Enterprise allow you to host on an http URL or do they require https? I'm guessing they do allow it, in which case we couldn't simply enforce that you always use an https URL. I'm honestly not sure that there is a good fix for this 😕

Yeah, I was thinking that too. Bummer. We could consider doing a log.Printf("warning: http protocol is specified in URL") call.

I found that they explicitly don't follow the redirects [...] Is that right @willnorris?   I had completely forgotten about that :)  There was some specific mention about needing to follow redirects some time ago:

https://developer.github.com/changes/2015-04-17-preview-repository-redirects/
https://developer.github.com/v3/#http-redirects

I don't know what all endpoints utilize redirects, but since they specifically call it out in the API docs, doesn't sounds like something we'd want to disable.

Oh, good point. There are definitely (wanted) redirects involved when hitting a repository that was moved/renamed, etc.
What if we check the scheme before and after in the redirect. If the original scheme is "http" and redirect scheme is "https", then we return an error or log a warning.
I'm not necessarily in favor of doing that, because it's turning out to be more complex than "just disable all redirects", but wanted to throw the idea out for consideration.

yeah, that sounds like more complexity than I'd want to add.

Thank you @shurcooL and @willnorris for your answer.
On my side, I'm now detecting the http scheme and I set a warning. But nothing more.
I like the idea that if we get a redirect to the same url, with a simple change on the scheme, we could fail to ask to use the appropriate link.
But I understand it to be a little complex to update in the code, everywhere. Do you want me to have a look?
Or, you do not consider it as useful?
Thanks

I don't think it'd be hard to do. It can probably be centralized in the Do method.
However, I agree with @willnorris and feel unconvinced that the potential benefits justify the cost of having this extra code run on every single API call, needlessly so in projects that uses go-github correctly.
I'd be more okay with a check in NewClient that runs once, but currently I don't see what can be done there.

Agree. Make more sense to me too. I will have a look in the NewClient.
Thanks

Fixed by #1772. Closing.


Interaction with other uses of Esc

I'm using react-modal2 as part of a more complex app that does its own keyboard handling, and I noticed that it doesn't do anything to keep its Esc event from also being seen by other parts of the site. (In my example, I have an Esc handler on my app container, and pressing Esc to close the modal also fires the app's event.)
Possible solutions:

Pass useCapture true to document.addEventListener and document.removeEventListener so that react-modal2's global Esc handler fires before any individual React components'.
Move the keyboard handler to the ref="modal" component; since it captures the focus, it should see any Esc keypresses.

And whether 1 or 2 is chosen, update handleDocumentKeydown to call event.stopImmediatePropagation().
I'm not an expert on DOM events, so I don't know which is better. (2 seems cleaner, but I assume there was some reason for going with document-level events in the current implementation.)

I put together a demo of this issue at https://github.com/joshkel/react-modal2-esc-demo. If you click the button to show the modal then press Esc to close it, it shows the parent container's "You pressed Escape" message.

For now, all I've done is check state.
<ReactModal2 closeOnEsc={!this.state.dropdown} />


工作流拖入工作区，组信息丢失，希望更新，谢谢。

me too

没看见作者好久不更新了，还说很多都被官方实现了

是啊感觉现在官方越做越好啦 挺完善的了 就不咋更新了

From: LP @.>
Sent: Monday, November 18, 2024 4:23:01 PM
To: 11cafe/comfyui-workspace-manager @.>
Cc: Subscribed @.***>
Subject: Re: [11cafe/comfyui-workspace-manager] 工作流拖入工作区，组信息丢失，希望更新，谢谢。 (Issue #487)
没看见作者好久不更新了，还说很多都被官方实现了
―
Reply to this email directly, view it on GitHubhttps://github.com/11cafe/comfyui-workspace-manager/issues/487#issuecomment-2482247649, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEMEEOKCFZAG36EBRSX5PGD2BGPWJAVCNFSM6AAAAABRR53IMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBSGI2DONRUHE.
You are receiving this because you are subscribed to this thread.Message ID: @.***>


prevProps.cookies.get always returns same as this.props.cookies.get

I have a Gastby app where cookies are set on login and, in a session component,  I need to capture when user has logged in ( or out ).
So, on the session component, componentDidUpdate method I have the following:
 componentDidUpdate(prevProps, prevState) {
    const prevUserId = prevCookies.cookies.get('userId');
    console.log('prevprops user id', prevUserId);
    const { location, cookies, isTokenExpired } = this.props;
    const userId = cookies.get('userId') || null;
    console.log('this userId', userId);
   if (!prevUserId && userId) {
         // never gets called
   ...

The console.log output of both prevUserid and userId is always the same each time componentDidUpdate gets called, so the if statement  code is never executed.
The expected behavior is that when the user logs in and
cookies.set('userId', userId, { path: '/' });
is run on the login component, that would trigger the code within the if statement of the  componentDidUpdate
method above of the session component.
At that specific point prevProps.cookies.get('userId') should be undefined and this.props.cookies.get('userId') should return a valid value, thus returning truein theif statement` condition and executing its code.
Instead,
console.log('prevprops user id', prevUserId); outputs undefined and
console.log('this userId', userId); outputs null
until user logs in and then both will output the same valid userId at the same time, never triggering the code within the if statement.

Never mind this.
In Gatsby one needs to wrap the pages with components you want not to dismount, like below.
In this case the Layout component will remain mounted.
/gatsby-browswer.js
    import React from 'react';
    import { Provider } from 'react-redux';
    import store from './src/store/reduxWrapper';
    import Layout from './src/components/layout';

    export const wrapRootElement = ({ element }) => <Provider store={store}>{element}</Provider>;

    export const wrapPageElement = ({ element, props }) => {
       console.log('wrap props', props);
       return <Layout {...props}>{element}</Layout>;
  };


Doc checks

Can you improve the description of the PR and also the commit messages? I don't know what the point of these changes is :)

Can you improve the description of the PR and also the commit messages? I don't know what the point of these changes is :)

What I don't like about this change is that we end up with more than 60 checks without having all the -sys enabled nor a windows/macos tests. I think that if we were to split the CI into a "matrix" for the configurations, it has to be per crate and it would run everything needed: build, test, clippy, rustfmt & gtk-rs checker

What I don't like about this change is that we end up with more than 60 checks without having all the -sys enabled nor a windows/macos tests. I think that if we were to split the CI into a "matrix" for the configurations, it has to be per crate and it would run everything needed: build, test, clippy, rustfmt & gtk-rs checker

So CI passed finally. How would you update it now @bilelmoussaoui ?

So CI passed finally. How would you update it now @bilelmoussaoui ?

It finally worked! \o/

It finally worked! \o/

Gonna merge it as is and we'll use this as new base for further developments.

Gonna merge it as is and we'll use this as new base for further developments.