Discrepancy in block.number during on-chain deployement in Forge script

Component
Forge
Have you ensured that all of these are up to date?

[X] Foundry
[X] Foundryup

What version of Foundry are you on?
forge 0.2.0 (75836a7 2023-09-09T00:28:38.542568580Z)
What command(s) is the bug in?
No response
Operating System
None
Describe the bug
Component
Forge
Related Issue
This issue is somewhat related to #1902 but discusses a distinct concern.
Issue Description
I'm trying to automate the deployment process of the Ethernaut #3 challenge on-chain using a Forge script. The challenge's resolution necessitates the execution of specific transactions depending on the block's hash.
Right now, I've given up on using a loop to resolve the challenge as this won't work since the block.number is not changing which causes the transaction to revert. I've now adopted the strategy of manually executing the script provided below ten times:
vm.startBroadcast(deployerKey);
uint256 blockValue;
uint256 coinFlip;
blockValue = uint256(blockhash(block.number - 1));
coinFlip = blockValue /<PHONE_NUMBER>8658097711785492504343953926634992332820282019728792003956564819968;
require(CoinFlip(instance).flip(coinFlip == 1), "guess failed");
console.log("Consecutive wins : ", CoinFlip(instance).consecutiveWins());
vm.stopBroadcast();

However, I've noticed that a discrepancy has emerged between the simulation logs and the actual on-chain results:
[29877] CoinFlip::flip(true)
    │   └─ ← true
    ├─ [295] CoinFlip::consecutiveWins() [staticcall]
    │   └─ ← 1
    ├─ [0] console::f5b1bba9(0000000000000000000000000000000000000000000000000000000000000001) [staticcall]
    │   └─ ← ()
    ├─ [295] CoinFlip::consecutiveWins() [staticcall]
    │   └─ ← 1
    ├─ [0] VM::stopBroadcast()
    │   └─ ← ()
    └─ ← ()
Script ran successfully.

== Logs ==
  Using same instance
  Consecutive wins : 1

SKIPPING ON CHAIN SIMULATION.

###
Finding wallets for all the necessary addresses...
##
Sending transactions [0 - 0].

The logs say that consecutive wins = 1 but on sepolia.etherscan it says 0 (which mean the guess was wrong):

This doesn't always happen, but still do often.
Here's my guess, I believe that foundry fails to simulate block.number. Reasons :

When executing the exact same piece of code on remix, everything works as expected.
When executing the script in foundry in --slow slow mode, the result will be different from the actual chain results 100% of the time.

Desired Feature
A tool or feature that accurately simulates the mining of a new block in Foundry, or ensuring that the --slow mode genuinely and consistently simulates increments in block.number.

The thing is, there's a few things here:

Even if we perform the simulation correctly (right now we only have atomic simulations), you still have network delays to get over, which could cause your tx to not be included in the block you intended it to be, therefore making your guess possibly fail.
If you do this on a test (which I'd recommend rather than a script), you have cheatcodes to manipulate the block number. See the book: https://book.getfoundry.sh/cheatcodes/roll
Are you forking as well?

In general, I'd say this is more of a user thing. I'd consider looking at how different ethernaut x foundry impls work: https://github.com/ciaranmcveigh5/ethernaut-x-foundry

@Evalir

The thing is, there's a few things here:

Even if we perform the simulation correctly (right now we only have atomic simulations), you still have network delays to get over, which could cause your tx to not be included in the block you intended it to be, therefore making your guess possibly fail.
If you do this on a test (which I'd recommend rather than a script), you have cheatcodes to manipulate the block number. See the book: https://book.getfoundry.sh/cheatcodes/roll
Are you forking as well?

In general, I'd say this is more of a user thing. I'd consider looking at how different ethernaut x foundry impls work: https://github.com/ciaranmcveigh5/ethernaut-x-foundry

Thank you for the feedback. Actually, I've already done this on a local test (no forking) using the cheatcodes and it works as expected. I wanted to fully automate the scripting part to validate the solution on a testnet without having to go through the ethernaut platform or using another tool for deployement. But, I understand that this will not be possible due to the reasons that you mentioned.
Also I have a last question, is it conceivable to add functions (or cheatcodes) in foundry to mine and wait for blocks using scripts ?


Have better/precise domain url for cache data

The current provenance domain is very general. For example, the EuroStats data have a provenance of europa.eu instead of ec.europa.eu/eurostat/data/database. It's better to have more precise provenance url.

@tjann Is this something we can do in the manifest?

We have both provenance url and provenance domain. Rather than talk about cache, should we talk about whether the cache should also include the url?

Include the url is definitely better!

Both url and display name would be best

can we start with a static mapping from domain to full url / display name?


Bad latitude / Bad longitude should share a common message between the invalid sort and invalid filter

Describe the bug

filter: Bad latitude 1000. Latitude must be contained between -90 and 90 degrees.
sort: Latitude must be contained between -90 and 90 degrees.

We should throw the same error in both case (the one from the filter).
This changes should be done in milli.
TODO

[ ] Implement changes in Milli (only this step is available for external contribution)
[ ] Release a Milli version containing these changes
[ ] Bump this new Milli version in Meilisearch and merge it into main

Hi @irevoire
I'd like to work on this, could you guide me what should I do to this issue?

Hi @irevoire!
Is this message for an existing error code or a new one?

Hello @maryamsulemani97
This is issue is related to a bug fix, it does not impact the docs team 😊
Hello @gentcys
I let @irevoire answer to your question, thanks for being involved in this issue 😊

Should I fix it or is someone else working on it?

Hello @Azanul
You can indeed do it, looks like no one is working on it right now 😄
thanks in advance for your contribution.

For your information, I've just added some information regarding the expectation in the issue description 😇

Does "the special reserved keywords error" here mean is a reserved keyword and thus can't be used as a filter expression. Use the _geoRadius(latitude, longitude, distance) built-in rule to filter on _geo field coordinates. ?

Hey @Azanul, sorry for the delay :pray:
« The special reserved keywords error » can be either;

_geoRadius is a reserved keyword and thus can't be used as a sort expression. Use the _geoPoint(latitude, longitude) built-in rule to sort on _geo field coordinates.
When used in a sort
_geoPoint is a reserved keyword and thus can't be used as a filter expression. Use the _geoRadius(latitude, longitude, distance), or _geoBoundingBox([latitude, longitude], [latitude, longitude]) built-in rules to filter on _geo` coordinates.
When used in a filter
_geoDistance is a reserved keyword and thus can't be used as a ranking rule
When used in a ranking rule

@irevoire is this issue solved thanks to #3638?


How to change the word f**k

How can we change the word f**k to some other word??

Please refer to the documentation:

You should place this command in your .bash_profile, .bashrc, .zshrc or other startup script:

eval $(thefuck --alias)
# You can use whatever you want as an alias, like for Mondays:
eval $(thefuck --alias FUCK)```


Update to 0.2.3 of chainlink/contracts

Fixed in https://github.com/smartcontractkit/truffle-starter-kit/commit/027093558616723755b5dfd75d711fcb351f0798


Blogpost about %autorelease

Description
Please write a blogpost about %autorelease feature we recently finished.
Benefit
No response
Importance
No response
Workaround

[ ] There is an existing workaround that can be used until this feature is implemented.

Participation

[ ] I am willing to submit a pull request for this issue. (Packit team is happy to help!)

@nforro I am not sure if we agreed on that during the Refinement meeting but do you think it makes sense to do a blog post about that since it was really about correctly handling that macro?


Support pprof endpoint

Hi,
Thank you for this great product.
I’m planning to use Grafana Phale to save continuous profiling data.
Is there any plan up support pprof endpoint in node agent?
https://pkg.go.dev/net/http/pprof
Thank you

Hi @Sharathmk99 :)

Is there any plan up support pprof endpoint in node agent?

We don't have a specific agent for Node - gProfiler is a single app, profiling all other apps in your system. So there is no Node "agent". What would make sense as a pprof endpoint in gProfiler itself, which could expose the profiling data collected from all apps.
Not planned currently (mainly because gProfiler has its backend, profiler.granulate.io that offers storage & viewing for continuous profiling data) but we'll be happy to receive contributions :)


Rubocop doesn't install from Gemfile

I add rubocop into Gemfile like that
group :development, :test do
  ...
  gem 'rubocop', require: false
  ...
end

I do bundle install but install output error
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    can't modify frozen String

Gem files will remain installed in
<EMAIL_ADDRESS>for inspection.
Results logged to
<EMAIL_ADDRESS>
An error occurred while installing rainbow (2.2.1), and Bundler cannot
continue.
Make sure that `gem install rainbow -v '2.2.1'` succeeds before bundling.

I install rainbow manual and then bundle install go without problem. After install I check Gemfile.lock and only rubocop depend on rainbow
My ruby version
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]

Also I use rvm
$ rvm --version
rvm 1.28.0 (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]

My system
$ uname -a
Linux test 4.8.0-34-generic #36-Ubuntu SMP Wed Dec 21 17:24:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.10
Release:	16.10
Codename:	yakkety

Do you use bundler v1.14.0 ?
If you use the version, it is a bug of rubygems. https://github.com/sickill/rainbow/issues/48
Could you try gem update --system ?

$ bundler -v
Bundler version 1.13.7

I use bundler after gem install bundler

Sorry, I mistake RVM, this is right output
bundler -v
Bundler version 1.14.1

Could you try gem update --system ?

Yes, it helps, thanks


easy auth

Hi,
I want to wrap my native curl call
curl.exe -i -Uuser:token -O "http://path/to/file.zip"

using CurlSharp.
First question:
Do I have to set user and token by
easy.UserAgent = "user";
easy.UserPwd = "token";

in CurlSharp?
Second question:
Can you give an example on how to modify OnWriteData to handle my zip file.
Thanks a lot!

Easiest way to provide authentication data is via the UserPwd property:
easy.UserPwd = "user:password";
You can save the downloaded buffer into a stream (file or memory). Once the entire file is downloaded, you may manipulate the zip archive. Pseudo-code:
    public static Int32 OnWriteData(Byte[] buf, Int32 size, Int32 nmemb, Object extraData)
    {
        var nBytes = size*nmemb;
        _stream.Write(buf, nBytes);
        return nBytes;
    }


Remove Cargo.lock from git?

As far as I know, it's recommended to include Cargo.lock in git for binary crates but not for lib crates. Could it be removed and .gitignored, or is there a special reason to include it?

No special reason. I have removed the lock file.


Add contribution to #51

Added in a little ES6 + restart with new random map a moment after the algorithm completes

Nice!


Notifications navigation not working properly when application terminate. (Screen bliking)

Am getting following error while navigation to detail screen.
https://user-images.githubusercontent.com/78555629/171390973-2ab97802-5b0c-4483-b1eb-4a3c671a6e67.mp4

Hi @prakash6491
This issue doesn't seem to describe a bug or a feature request. Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you


Name change for library

I wanted to pull this into a different issue so that we're not preventing progress in #50 by also having to choose a name in that issue.
Names that were suggested in #50 :

joinery because join has a meaning in "monad-land" and because joinery in carpentry is kindof like "composition"
phial  because it's a container
gershwin because he is a compose -r

New names since then:

edgecase (or edge-case) because this lib should help you avoid them

Naming inspirations:

anything related to containers
anything related to composition
or just a random word that sounds cool and isn't offensive

cc: @brycehipp @ryanguill

Hey guys, I've been able to come up with a few others:

tupperware - already on npm
fairing
canteen - already on npm
wrad for WRAp Data (pronounced "rad")
may-be
perhaps - already on npm
perchance - already on npm
mightbe

I'm not loving any of them, but of course some are better than others.  Also, I don't want this project to stall over picking a name.  At this point I'm not against going with something namespaced if we have to (which is why I listed the ones already on npm).
You guys have any thoughts on this?
Also, if (either or both of) you guys would rather not be a part of the naming process, that's totally fine with me, just say so.
cc: @ryanguill @brycehipp

Reminds me of this quote.

There are only two hard things in Computer Science: cache invalidation and naming things.
-- Phil Karlton

Jokes aside, wrad seems to stick with me and I can't quite put my finger on it why. I don't think it flows too well with the intent of this package though, but maybe thats not terrible?
If I were to pick one that goes the best with the package's intent then I would say tupperware or perhaps. I lean toward tupperware since its more memorable.

Reminds me of this quote.[...]

Ha! Totally.

Jokes aside,[...]

I agree, wrad seems good for no reason at all, and maybe that's a good thing.

If I were to[...]

I really like tupperware as well tbh, but it annoys me that it would have to be namespaced.  I guess it's not the end of the world and I should just get over it, but it just irks me that I can't think of a good name that's available globally.

Alright, after giving this some time, I think tupperware is the one to go with.  I'll just have to scope it and deal with that being slightly annoying.
I'll open it up here for final concerns/objections but I'd like to move this forward soon because I'm very tired of thinking about names.

Oops, forgot to cc @brycehipp @ryanguill

@brycehipp @ryanguill
Alright guys, it has been two weeks and no concerns have been raised on this.
I'll go through the process in the next few days of re-naming and then re-publishing the current version up to npm under iwburns/tupperware.  I'll also need to do something to the nullshield package to signify that it is has moved and is no longer being maintained.

I'm sorry, I got busy in the middle of this conversation and wasn't able to see it through.  Personally I don't mind that it is namespaced - lots of projects are moving to namespaces anyway.

no worries man, I know we're all busy.  Just trying to keep this from stalling too bad.

alright, this is now published as @iwburns/tupperware here!


[Bug]: pdf background rendering as transparent, makes documents unreadable

Attach (recommended) or Link to PDF file
From Punched Cards To Flat Screens: A Technical Autobiography by Philip Haze
Web browser and its version
Firefox 126
Operating system and its version
NixOS
PDF.js version
Whatever version is built in to the Firefox releases above
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
Load any PDF.  That's it.
I'm running X.org on NVidia and Linux, and have Picom as a compositor.
lshw.txt
Before recent FF releases this problem wasn't happening.
What is the expected behavior?
The PDF attahed to this issue should look like it's rendering on Google Drive:

What went wrong?
But what happens with all PDFs for the past couple of releases of FF is that I can see my desktop rendered in place of the PDF's background:

The clouds and checker board pattern is my desktop image, but as you can see the PDF page text is still rendered.
Link to a viewer
No response
Additional context
PDFs render properly with the latest version of the extension loaded in Chrome Stable, so this looks like a FF related issue?
Mine is not the only instance of this happening.  I came here via  https://www.reddit.com/r/firefox/comments/1dkih34/pdf_rendering_error/  which has a comment recommending leaving a report here.

I thought I was already running FF127, but when I went to get the "More troubleshooting information" from the "Help" menu, I wasn't.
So rather than retype all this info, I submitted the Issue, restarted FF since I had installed FF 127, and lo, the problem is fixed \o/

It's very likely a dup of https://bugzilla.mozilla.org/show_bug.cgi?id=1904707.


Dapr Asp.net core document is not explanatory.

[Enter feedback here]
I followed the document to create Dapr based application. i'm not able to run the application successfully. i feel there are some more configurations missing.

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 83e95a3f-447b-8ca0-beb5-f0363896fe29
Version Independent ID: b24e3ee5-404c-98a2-042e-6ac2d363b842
Content: Get started with Dapr
Content Source: docs/architecture/dapr-for-net-developers/getting-started.md
Product: dotnet-architecture
GitHub Login: @amolenk
Microsoft Alias: nanil

Thanks for sharing the query here, we'll check it out and update you.

Hi @mrgopalakrishnan, I have tested the complete exercise and it is working fine for me, sharing the screenshot. Can you please share any further details of your issue, I mean at which step you are stuck, any logs will be helpful. Also, ensure dapr cli and runtime versions are the same. You can check dapr version using the command dapr -v. I hope you are following the installation instructions Install Dapr into your local environment. Thanks

Hi @erjain ,
Thank you for the reply.  i think the issue is when i subscribe to a kafka topic which has key. Dapr is able to receive messages when there is no key written to the topic.

I'll be needing more information to help you, can you share at which step of the tutorial you are stuck, any logs will be helpful.

Hi @mrgopalakrishnan, Can you share more information on which step you are facing the issue in the tutorial?

Considering the original question is answered, we can close this issue now.


Add cleanup command

Hi @lukesampson,
I'm trying to find a brew cleanup alternative for scoop. Is this currently supported?
I would love to learn more about PowerShell scripting contributing with this feature if it's not implemented yet.
Thanks,
Gustavo

Hi! We don't have a scoop cleanup or similar yet. Is the idea that it would go through and delete old versions of each app? That sounds like a useful addition, and I'd be happy to accept a pull request for this.
We don't have a list of conventions but if you can try to follow the style of the existing code that would be good. Feel free to ask questions. Looking forward to seeing what you come up with!

That's the idea, Luke. I'll work on it :)

This isn't true anymore, is it?
C:\Users\klauer> scoop
Usage: scoop <command> [<args>]

Some useful commands are:

alias      Manage scoop aliases
bucket     Manage Scoop buckets
cache      Show or clear the download cache
checkup    Check for potential problems
cleanup    Cleanup apps by removing old versions
config     Get or set configuration values
create     Create a custom app manifest
depends    List dependencies for an app
export     Exports (an importable) list of installed apps
help       Show help for a command
home       Opens the app homepage
install    Install apps
list       List installed apps
reset      Reset an app to resolve conflicts
search     Search available apps
status     Show status and check for new app versions
uninstall  Uninstall an app
update     Update apps, or Scoop itself
which      Locate a program path

Type 'scoop help <command>' to get help for a specific command.

It looks like cleanup is there to me.

Yep, got added recently with #1648


TASK 1c: ensure rerunning “make” does not cause internally-compiled dependencies to be unnecessarily recompiled.

NA since we removed the internal build system


[Bug] Z-index of debugger and property pane

The property pane and debugger look weird because of the floating pane.

@Debsourabh @akash-codemonk can we solve this?

The solution can be to keep the property pane at a higher level than debugger and the entity explorer.

fyi, these are the way a few of the major components of the app(appsmith editor) are layered.
https://github.com/appsmithorg/appsmith/blob/release/app/client/src/constants/Layers.tsx

@areyabhishek @marks0351 the problem is that when the property pane is at the highest level, it often covers the errors in the debugger.

@Nikhil-Nandagopal How about we show the debugger at a layer above the property pane only when hovered over it or vice versa with the property pane?


My auth.json is the only file in my discordbot, that is not a json file.

Cannot find module './auth.json'
It is the only "file" type in my discord bot.
Also, my bot.js file turned into a "Bot" file.
Whenever I try to open the bot file, it shows this
Windows Script Host
❌ Script C:/Users\Daniel\Documents\DiscordBot\bot.js
Line: 1
Char: 1
Error: Object expected
Code: 800-13--
Source: Microsoft Jscript runtime error
What happened here?

You need to open it in Node.js
Start by opening Node.js command prompt and type "cd C:/Users\Daniel\Documents\DiscordBot\bot.js"
Then type "node bot".
(both without quotation marks)


Npm lacks some versions

I wanted to update from 3.5.1 to 3.5.4 but 3.5.4 is not in the npm version list. This is the complete list when viewing the versions of select 2 on NPM.
[ '3.4.3',
'3.4.5',
'3.5.1-browserify',
'3.5.1-browserify-fix',
'3.5.1',
'3.5.2-browserify',
'4.0.0',
'4.0.1' ]
Could you update the versions for npm?

NPM was not officially supported by Select2 until 4.0.0 (that's when I was finally given access), so as a result only Select2 4.0.0 and up are guaranteed to be on NPM.
I honestly have no idea what would be required to push the other ones up (and maybe even browserify them) if I wanted to.

@kevin-brown Ah that's a shame. I'll just migrate to 4.0.1.  Thanks for the reply though!

@kevin-brown I'll close the issue (unless there are plans to add some versions to NPM, can always re-open).

@kevin-brown is there any chance to push, at least the 3.5.x tags?
I'm migrating an old project from bower to npm, and I don't want to change the code, I just need to download the exact same version.
Thanks!

Same as @guiwoda the last in the 3.5 series would make bower to npm migrations less of a headache.

Same here

Same here, it would be great to have the last versions in the 3.5 series on NPM.


Error on HF finetuned converted model: Floating point exception (core dumped)

Hello Guillaume,
I'm trying to run inference on a finetuned with huggingface model.
When running model.transcribe I get a "Floating point exception (core dumped)". I've tried setting CT2_VERBOSE=3 but I don't get more info about the error.

I'm using in the ghcr.io/opennmt/ctranslate2:latest-ubuntu20.04-cuda11.2 image.
I get the error on CPU device an CUDA device
Model loading doesn't trigger any error.
There is no error when using the small/large/etc base models.

Do you know how I could get more debug info to trace back what triggered the error ?
Best,
Valentin

It appears that the FLoating point exception is in the model.detect_language but I get another error later on the line https://github.com/guillaumekln/faster-whisper/blob/746f2698dbd49cd3ad85504f72d945b85415831d/faster_whisper/transcribe.py#L515: "ValueError: cannot create std::vector larger than max_size()"
I guess the model obtained after finetuning is not compatible anymore / has something different from the original model.

Hi,
To convert the model, I suppose you used the same command line that is used in the README? https://github.com/guillaumekln/faster-whisper#model-conversion
Can you post the content of config.json in the converted model and also report the vocabulary size (wc -l vocabulary.txt)?

I used the command in the read me except that I replaced the hf repo openai/whisper-large-v2 with a local path.
vocab size: 51865
{
  "alignment_heads": [
    [6,0],[6,1],[6,2],[6,3],[6,4],[6,5],[6,6],[6,7],[6,8],[6,9],[6,1],
    [6,1],
    [7,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,6],[7,7],[7,8],[7,9],[7,1],
    [7,1],
    [8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,6],[8,7],[8,8],[8,9],[8,1],
    [8,1],
    [9,0],[9,1],[9,2],[9,3],[9,4],[9,5],[9,6],[9,7],[9,8],[9,9],[9,1],
    [9,1],
    [10,0],[10,1],[10,2],[10,3],[10,4],[10,5],[10,6],[10,7],[10,8],[10,9],[10,1],
    [10,1],
    [11,0],[11,1],[11,2],[11,3],[11,4],[11,5],[11,6],[11,7],[11,8],[11,9],[11,1],
    [11,1
 ]
  ],
  "lang_ids": [],
  "suppress_ids": [],
  "suppress_ids_begin": [
    220,
    50257
  ]
}

This explains the issue. See if you can keep the special tokens in the vocabulary and have non empty lang_ids and suppress_ids in the configuration.

I added the special_tokens_map.json and I can get through the errors


issue

could you make a vedio，bro？

+1

@ikunxdlyj @xaiozhangtongxue Can you elaborate on the problem you're having in following the instructions in the repository.
Also, you can read the updated version of the paper.


[zh] sync blog: hpa-container-resource-metric.md

Add zh text to this blog:
content/zh-cn/blog/_posts/2023-05-02-hpa-container-resource-metric.md

See preview please.

/approve


“Ghost” kong instances never disappear and drastically slow down the startup process

Summary
I’m deploying Kong in a Docker/Kubernetes environment. As I’m launching tests, I’m constantly starting and stopping Kong containers, but I always have 1 running node at a time.
After a couple of such stop/restart (but I cannot tell you how much… but less than 10 and this is not happening exactly after the same number of stop/starts), the kong startup takes longer and longer (up to several minutes).
Logs are showing the following lines during the startup process, and Kong startup takes 15 to 20s to go to the next line:
2017/03/10 08:46:30 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically
2017/03/10 08:46:33 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically
2017/03/10 08:46:36 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically
2017/03/10 08:46:39 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically
2017/03/10 08:46:42 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically
2017/03/10 08:46:45 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically
2017/03/10 08:46:48 [warn] could not join cluster at <IP_ADDRESS>:7946, if the node does not exist anymore it will be purged automatically

It looks there as some Kong “ghosts” instances (because I only have 1 single node active at a time)  !
As said in the log, I was hoping that those “ghosts” would be “purged”… but this is not the case: if I stop&start again Kong, then those lines will be there again (and it would still take a veeerrrry long time to start). And this number of line is sometimes increasing, making the next restarts be even longer !
Going into the cassandra DB I’m using, I can see the ghosts in the “nodes” db:
name                                                     | cluster_listening_address | created_at
----------------------------------------------------------------------------------------------------------+---------------------------+--------------------------
kong-ff56536535b0c47a68b93b01548e5e51-ppo3w_<IP_ADDRESS>:7946_d051cdb3da8d4bbcb3f1d4d768af5fdb |           <IP_ADDRESS>:7946 | 2017-03-09 10:42:31+0000
kong-kdc5y_<IP_ADDRESS>:7946_369d51255a5647a1a9166d50ba2fa7d3 |           <IP_ADDRESS>:7946 | 2017-03-09 10:55:23+0000
kong-ws11y_<IP_ADDRESS>:7946_6f9ce1ccace84a0292f7457961c2b71d |             <IP_ADDRESS>:7946 | 2017-03-09 12:43:23+0000
kong-p0m3r_<IP_ADDRESS>:7946_2d116f644d9c42cd84efe01c8f71dee8 |          <IP_ADDRESS>:7946 | 2017-03-09 09:04:33+0000
kong-18bqq_<IP_ADDRESS>:7946_b5ea3f460d6b485a92b9bf88990f4ee2 |           <IP_ADDRESS>:7946 | 2017-03-09 08:49:46+0000
kong-ff56536535b0c47a68b93b01548e5e51-defn3_<IP_ADDRESS>:7946_c189218f1bfa4ae0ba216ebebf655b00 |            <IP_ADDRESS>:7946 | 2017-03-10 08:45:42+0000
kong-xaib1_<IP_ADDRESS>:7946_c53cef1332224bc19bb14edd724740c0 |           <IP_ADDRESS>:7946 | 2017-03-09 15:06:53+0000
kong-hita0_<IP_ADDRESS>:7946_1fba656558e8461c9890b06f8e9b3158 |           <IP_ADDRESS>:7946 | 2017-03-09 15:57:20+0000
kong-pvfk2_<IP_ADDRESS>:7946_715627b6aff3478f9928cc698747f375 |             <IP_ADDRESS>:7946 | 2017-03-10 08:46:52+0000
 (9 rows)

The only active node corresponds to the last line.
Looking to the “Edge-case scenario” section of the documentation https://getkong.org/docs/0.9.x/clustering/#automatic-cache-purge-on-join, I was expecting that this could be a cache purge use case… but when I run kong cluster members, I cannot see my gohsts:
$ kong cluster members
kong-pvfk2_<IP_ADDRESS>:7946_715627b6aff3478f9928cc698747f375 <IP_ADDRESS>:7946   alive

Same for the kong cluster reachability:
$ kong cluster reachability
Total members: 1, live members: 1
Starting reachability test...
Successfully contacted all live nodes

Even waiting after the cluster_ttl_on_failure delay (kept to the default value of 3600), I still have my ghosts in the table (look in the cql output above: some of the ghosts are more than a day old).
Looking to the on-going issues, it looks close to what here discussed here https://github.com/Mashape/kong/issues/2182 , https://github.com/Mashape/kong/issues/2164 and https://github.com/Mashape/kong/issues/2125 but I’m not on 0.10.0 and I only have 1 running instance => not exactly the same issues.
Configuration around cluster_ttl_on_failure, cluster_listen, cluster_listen_rpc etc is not modified (default values).
Of course, if I reset the database, everything comes back to a normal behaviour!
Steps To Reproduce
See above
Additional Details & Logs

Kong version: 0.9.9
Operating System: Alpine 3.5
Run with Docker 1.2 and Kubernetes 1.4
Serf version: 0.7.0

Can you set cluster_ttl_on_failure to 60? That will automatically remove a failed node from the database in one minute.

Nothing changed with cluster_ttl_on_failure set to 60: ghost lines are still present in the db and increasing by 1 at each new start, and each start still displays the could not join cluster at lines...
Strangely, nothing related to a regular action that would happen every 60 seconds is displayed in the log (kong being started with --vv option + debug log level): I only have the following logs every 30 sec:
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] cluster.lua:20: log(): [cluster] sending keepalive event to datastore
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Connecting to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Session connected to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Socket retrieved from the connection pool, 31 times
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Load balancing policy proposed to try host at: kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Connecting to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Session connected to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Socket retrieved from the connection pool, 32 times
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Load balancing policy proposed to try host at: kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Connecting to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Session connected to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Socket retrieved from the connection pool, 33 times
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Load balancing policy proposed to try host at: kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Connecting to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Session connected to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Socket retrieved from the connection pool, 34 times
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Load balancing policy proposed to try host at: kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Connecting to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Session connected to kong-database
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Socket retrieved from the connection pool, 35 times
2017/03/12 10:12:20 [debug] 177#0: *66 [lua] log.lua:22: debug(): Load balancing policy proposed to try host at: kong-database
2017/03/12 10:12:20 [notice] 177#0: signal 17 (SIGCHLD) received
2017/03/12 10:12:20 [info] 177#0: waitpid() failed (10: No child process)
2017/03/12 10:12:20 [debug] 178#0: *69 [lua] log.lua:22: debug(): Connecting to kong-database
2017/03/12 10:12:20 [debug] 178#0: *69 [lua] log.lua:22: debug(): Session connected to kong-database
2017/03/12 10:12:20 [debug] 178#0: *69 [lua] log.lua:22: debug(): Socket retrieved from the connection pool, 6 times
2017/03/12 10:12:20 [debug] 178#0: *69 [lua] log.lua:22: debug(): Load balancing policy proposed to try host at: kong-database

Can you give me an example of logs I am supposed to have for this automatic failed node removal process, so that I could track them?

@pamiel sorry, I forgot to mention that when you set cluster_ttl_on_failure=60 only new nodes will have a TTL of 60, the old ones will still have the old 3600 TTL (1 hour).
You can start with a fresh environment by:

Shutting down every node
Delete the contents of the nodes table by executing TRUNCATE nodes; on Cassandra
Start nodes again (make sure that they all have cluster_ttl_on_failure=60 set)

By doing so, when you forcibly shut down a node it should only logged in the nodes table for 60 seconds, and then it should automatically disappear.

Even waiting after the cluster_ttl_on_failure delay (kept to the default value of 3600), I still have my ghosts in the table (look in the cql output above: some of the ghosts are more than a day old).

@pamiel in the meanwhile I will be investigating this problem.

@thefosk  Mitigated results...

I updated the cluster_ttl_on_failure to 60 but it did not provide visible results... Still log lines + database with ghost lines appearing after a couple of start/stop
I then tried another tests, adding a preStop clause in the Kong's Kubernetes deployment file so that I'm sure to execute the kong stop at the end of each node (I was expecting that a correct stop might clean the node reference somewhere...).
It looked at the beginning that things were going better... but then the ghosts came back, visible through the could not join cluster at xx.xx.xx.xx:7946, if the node does not exist anymore it will be purged automatically log lines, and through the nodes table content.
Now, I have 30 rows while only 3 nodes are up and running for the last 12 hours.

I just run the SELECT you mentioned. The output is there (I unfortunately started my second test with a ttl of 3600...):
 cluster_listening_address | ttl(cluster_listening_address)
---------------------------+--------------------------------
           <IP_ADDRESS>:7946 |                           3590
           <IP_ADDRESS>:7946 |                           2401
            <IP_ADDRESS>:7946 |                           null
           <IP_ADDRESS>:7946 |                            777
            <IP_ADDRESS>:7946 |                           null
           <IP_ADDRESS>:7946 |                           null
            <IP_ADDRESS>:7946 |                           null
           <IP_ADDRESS>:7946 |                           null
[...]
(30 rows)

and many other lines with a null value on the TTL, and with a creation date that is more than 12h old.
I tracked one of the counters reaching 0... and for this one, the node disappeared from the table !... but I still have many other lines with a null ttl, and not disappearing...
One complementary information: the could not join cluster at xx.xx.xx.xx:7946, if the node does not exist anymore it will be purged automatically lines only appear when running the very first kong instance of the cluster. If a node is already up and running, starting another node (the 2nd, 3rd... of the cluster) does not display such logs and the startup goes much faster.
If I scale down back to 0 and restart again a first node, then I have again the log lines and the slow startup process...
I will reset my nodes table, set the ttl to 60, keep the preStop to be sure to stop kong properly (unless you tells me not to do so), and start again some tests (especially to see if the ghost corresponds to 1st nodes of the cluster or not).

If a node is already up and running, starting another node (the 2nd, 3rd... of the cluster) does not display such logs and the startup goes much faster.

Yes this happens because Kong orders the nodes to find the one that has sent the most recent keep-alive, and tries to join that one. If it works, then it will not iterate over the list anymore.
I will investigate the null problem.

Hi,
I managed to partially solve the issue by using the FQDN in the cassandra contact point: it looks the ghosts were created by Kong instances that had connection issues with Cassandra.
To be frank, I don’t know if they were not able to connect to cassandra at all, or if they more likely had access at the beginning of the startup… and then losing it, but logs of all ghost were having logs such as:
2017/03/14 13:16:58 [error] 90#0: *294 [lua] cluster.lua:20: log(): [cluster] could not retrieve nodes from datastore: [cassandra error] Could not create lock for prepare request: Error locking mutex: timeout, context: ngx.timer
For those instances, a new line was correctly created in the nodes table but the TTL was never set to the 60 value (it stays to null forever). I don’t know why the TTL process of Cassandra is not working properly, but after using the FQDN, then I have no more connectivity issue to cassandra in the Kong’s logs, and then no more ghosts in the db!
So, why am I saying that the issue is “partially solved”? Because this is the upstream connectivity that now fails: I was previously using Routes => no problem; but using host names within the Kubernetes network, then I receive a HTML “Kong Error - An invalid response was received from the upstream server” from Kong, and Kong’s logs says:
[error] 310#0: *1083 connect() failed (113: Host is unreachable) while connecting to upstream
And this time, usage of FQDN in upstream definition is not solving the point :(
As mentioned in my post here (https://github.com/Mashape/kong-dist-kubernetes/issues/6), there are indeed tens of similar posts related to (sometimes random) DNS issues, and I still do not understand what is the root cause of the issue (and in which component).

On Kong: Mashape/kong#2201, Mashape/kong#2207, Mashape/kong#1104, Mashape/kong#1601, and the one just coming: Mashape/kong#2239
On Kubernetes: kubernetes/kubernetes#26309
On Kong distrib for Kubernetes: #3 and #6
On other: Mashape/lua-resty-dns-client#6

Usage of FQDN looks just to be a workaround (not working for all use cases, as in my case) and as the issue might happen randomly, I’m not sure that it will not happen again later, even with FQDNs…
And I still don’t understand where is the real problem…

Obviously no longer happens on 0.11 as Serf is out and no more nodes table !
So closing it.
Thanks.


Bug with strand-specific RNA-Seq quantification - gtf_to_fasta doesn't respect transcript orientation

Hi there, I think I've uncovered a bug with the fast RNA-Seq pipeline (and perhaps the regular one).
Somewhat briefly: when the gtf_to_fasta command generates a transcript fasta file from the genome reference and gtf file, it outputs all the fasta records in the genome positive strand orientation, rather than in the orientation of the transcript. This causes the strand-specific quantification estimates in sailfish/salmon to be incorrect. A potential fix would be to use the gffread utility already included with bcbio, which properly respects transcript orientation when generating the transcript fasta file.
The longer version: we were running the bcbio 'fast RNA-Seq' pipeline on some stranded RNA-Seq libraries. When I was inspecting salmon's output metrics file (lib_format_counts.json) I noticed some strange results:
> cat lib_format_counts.json
{
    "read_files": "( /dev/fd/63, /dev/fd/62 )",
    "expected_format": "ISR",
    "compatible_fragment_ratio": 0.5116883390587789,
    "num_compatible_fragments": 2427910,
    "num_assigned_fragments": 4744900,
    "num_consistent_mappings": 6369165,
    "num_inconsistent_mappings": 6964573,
    "MSF": 0,
    "OSF": 5797,
    "ISF": 5530376,
    "MSR": 0,
    "OSR": 6029,
    "ISR": 6369165,
    "SF": 667066,
    "SR": 730466,
    "MU": 0,
    "OU": 0,
    "IU": 0,
    "U": 0
}

These metrics are described in the Sailfish documentation. Essentially, what these results are saying is that:

I've specified that I expect the read fragments to be in the 'ISR' format
Only 51% of the fragments are in the expected orientation
The fragments are split roughly 50/50 between the 'ISR' and 'ISF' orientations. This is a very implausible result.

I went back to some earlier transcript fasta files from a different project, and re-ran the quantifications (using the version of Salmon bundled with bcbio for the indexing and quantification), and observed more consistent results.
I then checked the output of the gtf_to_fasta program against the tool I'd used previously for this task, gffread (which I had from the cufflinks package, and is also there in my bcbio install - presumably because I've installed an appropriate aligner). Looking at the results for transcripts on the negative strand, I confirmed that while gffread appropriately reverse-complements the sequence (with respect to the genome), gtf_to_fasta does not. See below for a UCSC screenshot:

We've done a bit of testing, and it seems like the quantification results are indeed affected by this (I'm not sure to what extent). Could someone please take a look and potentially correct this? Thanks!

Here's what the results using a transcript fasta generated by gffread:
{
    "read_files": "( /dev/fd/63, /dev/fd/62 )",
    "expected_format": "ISR",
    "compatible_fragment_ratio": 0.8458915122335994,
    "num_compatible_fragments": 3937839,
    "num_assigned_fragments": 4655253,
    "num_consistent_mappings": 11735383,
    "num_inconsistent_mappings": 1449319,
    "MSF": 0,
    "OSF": 208,
    "ISF": 95266,
    "MSR": 0,
    "OSR": 11382,
    "ISR": 11735383,
    "SF": 91479,
    "SR": 1226047,
    "MU": 0,
    "OU": 0,
    "IU": 0,
    "U": 0
}

This shows the expected higher proportion of 'compatible' fragments.

Hi Rod,
Thanks for the awesome bug report and sorry for the problem. We almost never see stranded data here so we haven't noticed this behavior. When you ran gtf_to_fasta, were you using the gtf_to_fasta command line tool? Inside of bcbio we have a function called gtf_to_fasta, but it isn't the same thing as the command line tool. The bcbio function is here
https://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/rnaseq/gtf.py#L111 and you can see it just calls out to gffread.
For the run that looked poor, does the Sailfish/Salmon command line look correct? I'm confused about how we're running in this problem. Thanks so much!

Thanks for your response Rory - that's interesting that it is indeed calling out to gffread. It may be the case that in our testing we were using the command-line gtf_to_fasta rather than the bcbio function. I'll confirm with my colleague and get back to you.

Thanks, let me know what you find, like I said we don't get much stranded data at all, so suggestions about how we can improve handling it, even if it ends up moving outside the scope of this issue, would be very much appreciated.

Guh, sorry to send you on a wild goose chase. It looks like we were actually calling out to gtf_to_fasta inside of the function we call to merge transcriptomes together and spit out a combined FASTA sequence. I nuked that faulty gtf_to_fasta function and pointed instead to the correct one which uses gffread.

This should fix the problem you were seeing now that we're properly using gffread across. the board. Thank you so much! Let me know if you run into anything else or have some other fixes/suggestions.

Nice - thanks for tracking that down so quickly! I'll update and check things again - assume if I don't comment back here that things are fixed. Thanks again.


workflows: overhaul and standardize all jobs

Please see individual commits :)

@cilium/maintainers I will need you to setup our new credentials for cilium-pr containers on all platforms in cilium-cli secrets. I think @nebril has access? If yes, we can coordinate directly on Slack as we did previously with cilium/cilium.

All tests in #289 passed except multicluster: https://github.com/cilium/cilium-cli/actions/runs/918228985
The console indicates an issue at cilium install with the CIDR detection:
+ cilium install --context gke_***_us-west2-a_cilium-cilium-cli-918228985-mesh-1
🔮 Auto-detected Kubernetes kind: GKE
ℹ  Cilium version not set, using default version "v1.9.8"
🔮 Auto-detected cluster name: gke-***-us-west2-a-cilium-cilium-cli-918228985-mesh-1
🔮 Auto-detected IPAM mode: kubernetes
🔮 Auto-detected datapath mode: gke
🔮 Custom datapath mode: gke
❌ Unable to auto-detect GKE native routing CIDR. Is "gcloud" installed?

Error: Unable to install Cilium: unable to execute gcloud [container clusters describe cilium-cilium-cli-918228985-mesh-1 --zone us-west2-a --format value(clusterIpv4Cidr)] to extract native routing CIDR: exec: "gcloud": executable file not found in $PATH
ℹ  You can set the native routing CIDR manually with --native-routing-cidr

This is due to a missing \ in multicluster.sh:
# Install Cilium in cluster1
cilium install \
  --context "${CONTEXT1}"
  --cluster-name "${CLUSTER_NAME_1}" \
  --cluster-id 1 \
  --config monitor-aggregation=none \
  --native-routing-cidr="${CLUSTER_CIDR_1}"

Fixing...

Multicluster test failed again: https://github.com/cilium/cilium-cli/actions/runs/918739021
Because I used cilium --context "${CONTEXT1}" clustermesh status --wait instead of cilium --context "${CONTEXT1}" status --wait when waiting for Cilium to be ready before enabling clustermesh.


Please consider vm.args : +C multi_time_warp

Hi !
Been having a head-scratching time trying to keep a little Process.send_after (monotonic {:abs, true}) in step with the OS time (which is now carefully NTP synchronized) . .  Until I noticed that the VM is started with the default :no_time_warp mode.
The ERTS guide to Time and Time Correction strongly encourages adopting the new API.  There wouldn't be old code still using erlang:now/0 would there ?

This sounds like a great idea. I always use millisecond offsets in Farmbot code, but sub deps will need to be checked.

I'm testing this out today. It seems to be working alright. I'm going to do some QA and report back

This is staged to be released. :+1:  Thanks @jsimmonds2


Playback-rate: fix popup behavior

Part of #1637 - invokes the popup menu when clicked.
This also makes the button consistent with other MenuButtons, i.e. to invoke a menu popup when clicked instead of hovered.
Ref: https://github.com/videojs/video.js/issues/3394#issuecomment-230793773

[ ] @toshokanneko, as discussed in Slack, this would require some styling changes for mobile layout. I think the Quality Selector popup also needs a scrollbar.  No rush, though -- just a side project.
[x] I still need to hunt down why the Rate popup is dismissed on the down-click, causing it to re-appear during the up-click.  The default behavior is to not dismiss the menu during onBlur (down-click) if the button is associated with the menu, but something's breaking that:

      if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
        btn.unpressButton();
      }

Fix the click behavior. Ready to go after the css fix.


Weird exception after making a new backup

I'm getting a FileLoadException when executing Type.GetType after having created a backup using the library. This only happens after the backup is created, there is no issue before.
I've isolated the function that if executed causes the error to happen later and its new MySqlBackup(cmd) where cmd is  MySql.Data.MySqlClient.MySqlCommand.
It's possible that the problem is caused by the line
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; ,
executed in the constructor of MySqlBackup.

I think yes. That line can be excluded.
It is not necessary to have it.
I will drop that line in the next release.

Hi, a new version (v2.3) is released, where this problem is resolved. You may try it out.


Add cohort-only view to browser mockup

Resolves #36
Note that this adds a prefix field to the cohort data. If this is an issue, I can do it a different way, but this was the easiest way to get IDs to filter the cohort-only view.
The filtering for cohorts-only is an intersection. So if you select "blood" and "urine", it will only display cohorts that collect both blood and urine data.
The filtering for all fields is a union. If you select "blood" and "urine", it will display all fields from all cohorts related to blood and urine.

Nice! Just one change please: I'd like the links under Cohort Name to point to our pages, e.g. build/cohorts/gcs.html

Done!


Update rules link again for new rule docs

This shouldn't be merged yet, but is the update we'll need to this link again when this change gets released: https://github.com/sqlfluff/sqlfluff/pull/4695
The old link will still "work" (i.e. it won't be a broken link), but it will stop pointing to the right point on the page. I've added some more permanent redirect stubs so we can support more consistent links even if we change the format again in the future.

Actually... I might be able to make the old links still work. 🤔 .
Don't merge this yet.


feat(protocol): introduce ForkManager to improve protocol fork management

Currently, the TaikoL1 protocol required each fork's codebase to contain implementations for both the current fork and the next fork within the same contract. This created unnecessary code complexity and tight coupling between fork versions.
With the new ForkManager, we can:

Split fork implementations into separate, focused contracts
Maintain cleaner separation of concerns between fork versions
Support multiple forks as long as their storage layouts remain compatible

This change improves code maintainability and makes the fork upgrade process more modular.

The storage layout of ForkManager is compatible with the layout of TaikoL1.


MasterPeerNode

Does Perlin Noise need a MasterPeerNode to find other Peers?

A node may connect to any peer to be introduced to the network.  Usually, for nodes which have not connected to a network before and need an introduction networks will provide a peer at a well-known address.
Is that what you are asking about ?

for nodes which have not connected to a network before and need an introduction networks will provide a peer at a well-known address.

How do you specify the "well-known address" or "few select bootstrap/seed nodes" ? I have this use case. How would this look in the chat example?
Thank you

I just found it in the source code. No need to answer thank you.


Monitor JRPC failures

Adds a new metric for counting JRPC failures.

Merging this as we are currently in need of those metrics, but comments are welcome any time :)


Implemented IDisplayFolderFilter to fix DisplayFolder support

Added IDisplayFolderFilter interface and added it to the XML Items that already implemented that DisplayFolder property.
During build create a CaptionFilter for the DisplayFolders target.
Added extra unit tests to prove that the filters were builded correctly

Oups, sorry, I've not seen this before. I will review it right now.

Sounds correct. Merged and Thx again.


Add footer to page

Task
Add made with ❤ & link to Github
Design Specs

[ ] Use #770077 for text color
[ ] Footer background should be #FAFAFA
[ ] Footer height should use rem units for be the equivalent of height: 200px
[ ] Github logo should be Font Awesome icon
[ ] Github logo should be the same color as text

Mockup

Can I try working on this? If yes what details should the footer contain?

Can I try working on this? If yes what details should the footer contain?

@GowthamPB Hey sorry I took so long to get back to you! I wanted to give you proper specs. Please see the updated issue for specifications of how to complete this task. Thank you so much for offering to help! 😄

Hey I am not really sure how I can change the github logo color to #770077

Right now it looks somewhat like this...

Hey,
Pull request sent for this.
Thanks,

Hey,
Pull request sent for this.
Thanks,

@andreisavawebdev Thank you for the PR! In the future, I feel like it would be more beneficial if you helped out others who are trying to learn how to accomplish certain things instead of swooping in and submitting a PR. If the issue had become stale, then it's fair game, but Gowtham had been active in this issue no longer than a day ago. Let's help foster a friendly open source community.


Ui test constants

Added a constant file - to store reused constant values for the UI tests.

Can one of the admins verify this patch?


update impsort to 1.8.0

Changes since 1.6.2: https://github.com/revelc/impsort-maven-plugin/compare/impsort-maven-plugin-1.6.2...impsort-maven-plugin-1.8.0
Mostly interested in: https://github.com/revelc/impsort-maven-plugin/commit/58ecbb6880a62ae9d169027abf0004bc9dd03e6b since that solves errors that I am seeing with maven 3.9.X

Blocked on moving to Java 11 :(

This is small enough that I am going to close for when we are ready for java 11


Images not rendering in listview - Xamarin.Forms

I have a Viewcell inside my listview which is bound to my data source, I have read the wiki and it suggested making a custom viewcell to set the image source.
As directed I have done this:
<ListView x:Name="lstView" HasUnevenRows="True" SeparatorVisibility="None">
	<ListView.ItemTemplate>
		<DataTemplate>
			<helpers:MyCustomCell >
				<Grid Padding="5">
					<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition/>
					<ColumnDefinition/>
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					</Grid.RowDefinitions>
					<Label x:Name="CardName" Text="{Binding Name}" VerticalOptions="Start"/>
					<forms:CachedImage Grid.Column="0" x:Name="CardImage" HorizontalOptions="Center" VerticalOptions="Center" WidthRequest="100" HeightRequest="171" DownsampleToViewSize="true" >
					<forms:CachedImage.GestureRecognizers>
					<TapGestureRecognizer Command="{Binding TapCommand}"  CommandParameter="{Binding .}" Tapped="Image_OnTapped"  NumberOfTapsRequired="1" />
					</forms:CachedImage.GestureRecognizers>
					</forms:CachedImage>
					<Label Grid.Column="1" Text="{Binding Name}" LineBreakMode="WordWrap"/>
					<Label Grid.Column="2" Text="{Binding SubType}" LineBreakMode="WordWrap"/>
				</Grid>
			</helpers:MyCustomCell>
		</DataTemplate>
	</ListView.ItemTemplate>
</ListView>

My custom view cell is an almost identical replication of the sample:
public class MyCustomCell : ViewCell
    {
        readonly CachedImage CardImage = null;

        public MyCustomCell()
        {
            CardImage = new CachedImage();
            View = CardImage;
        }

        protected override void OnBindingContextChanged()
        {
            // you can also put cachedImage.Source = null; here to prevent showing old images occasionally
            var item = BindingContext as Card;

            if (item == null)
                return;

            CardImage.Source = item.ImageUrl;

            base.OnBindingContextChanged();
        }
    }

The listview displays correctly but without the image, I know the image cell is there because the Gesture is working and being hit. The OnBindingContextChanged is getting hit and setting the string url to the image source without failing, but no image is displayed at all.
Any tips where I am going wrong?

You've basically replaced the view which was defined in MyCustomCell with Grid. It's not an FFImageloading issue.
Your xaml should look like this:
<ListView x:Name="lstView" HasUnevenRows="True" SeparatorVisibility="None">
	<ListView.ItemTemplate>
		<DataTemplate>
			<helpers:MyCustomCell/>
		</DataTemplate>
	</ListView.ItemTemplate>
</ListView>

@daniel-luberda  what if I need to a grid to set the layout of the listview item?

You should include that grid in your custom ViewCell too. ViewCells can also be coded in XAML.

@daniel-luberda  if i create a custom viewcell with a grid inside it, won't i just get the same issue as before?

No, just create a new XAML ContentView file, change its type to ViewCell:
<?xml version="1.0" encoding="utf-8" ?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="YourNamespace.MyCustomCell">
    <Grid Padding="5">
        <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition/>
        <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Label x:Name="CardName" Text="{Binding Name}" VerticalOptions="Start"/>
        <forms:CachedImage Grid.Column="0" x:Name="CardImage" HorizontalOptions="Center" VerticalOptions="Center" WidthRequest="100" HeightRequest="171" DownsampleToViewSize="true" >
        <forms:CachedImage.GestureRecognizers>
        <TapGestureRecognizer Command="{Binding TapCommand}"  CommandParameter="{Binding .}" Tapped="Image_OnTapped"  NumberOfTapsRequired="1" />
        </forms:CachedImage.GestureRecognizers>
        </forms:CachedImage>
        <Label Grid.Column="1" Text="{Binding Name}" LineBreakMode="WordWrap"/>
        <Label Grid.Column="2" Text="{Binding SubType}" LineBreakMode="WordWrap"/>
    </Grid>
</ViewCell>

Then override its OnBindingContextChanged:
public class MyCustomCell : ViewCell
    {
        readonly CachedImage CardImage = null;

        public MyCustomCell()
        {
            CardImage = new CachedImage();
            View = CardImage;
        }

        protected override void OnBindingContextChanged()
        {
            // you can also put cachedImage.Source = null; here to prevent showing old images occasionally
            var item = BindingContext as Card;

            if (item == null)
                return;

            CardImage.Source = item.ImageUrl;

            base.OnBindingContextChanged();
        }
    }

@daniel-luberda  and how do I reference the new XMAL within my current listview, just by <></> ?

Yes. I updates my previous answer.

@daniel-luberda Ahh I get you now. How about the Gesture in the custom view, would I need to move the method from the parent  contentpage to the customview ?

You can do everything which any other View can do. But remember that cells binding context is not your view model binding context, but item model.

@daniel-luberda  thanks for all your help. It still isn't working. No list view at all. I guess I am will just have to scrap it all and look for an alternative solution.

It must be working. There's a complete example on out sample repo: https://github.com/luberda-molinet/FFImageLoading/blob/master/samples/ImageLoading.Forms.Sample/Shared/Pages/ListPage.xaml

Ok, followed that link and refactored my code slightly to match what your example is doing (minus the mvvm framework you're using) and now I can get the listview to show, albeit without images still! The labels are coming through, which shows the custom view cell is working, just no images.
Also I cannot implement the "Tapped="Image_OnTapped" on the custom viewcell as the tap event needs to happen on the parent content page view.

I have cloned your repo, and while your code works out of the box, if I implement it more or less exactly the same (installed Xamvvm), changed everything to viewmodel etc
The only thing I am not doing which you are is
				new MenuItem() { 					Section = "Lists", 					Title = "List example", 					Command = new BaseCommand(async (param) => 					{ 						await this.PushPageFromCacheAsync<ListPageModel>(pm => pm.Reload()); 					})
But thats because I have no menu items, it just loads into it. Instead on my contentpage I put:
var mod = new ListPageModel(); mod.Refresh();
Everything gets hit apart from the custom cell binding.
So then I add in
lstView.ItemSource = mod.Items;
Now the list shows, but still without any images at all.
I dont get why its so hard to get this to work?!

@daniel-luberda
Finally found out the problem...
My images are being served up as https:// and these are erroring, if I change to http they are fine. I find this odd as in my native Android app I am using https:// and the images are fine. And I see in your samples you are too. Is there someway to capture the error or am I missing a setting over allowing https://?

Just in case anyone else comes across this issue I finally solved it.
My images were returning: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.)
To solve this I used this nuget library:
https://github.com/paulcbetts/ModernHttpClient
And implemented it in my App.cs:
		public App () 		{ 		    var config = new FFImageLoading.Config.Configuration() 		    { 		        VerboseLogging = true, 		        VerbosePerformanceLogging = true, 		        Logger = new CustomMiniLogger(),                 HttpClient = new HttpClient(new NativeMessageHandler())         }; 		    ImageService.Instance.Initialize(config);             MainPage = new NavigationPage(new LoadingPage());         }
My images are now loading.

@jaymarvels You can also switch to using native http client handlers through project settings :)

@daniel-luberda  I did! But it didn't make a difference!

Also set SSL implementation
On Oct 9, 2017 10:15, "Jay Spencer"<EMAIL_ADDRESS>wrote:

@daniel-luberda https://github.com/daniel-luberda I did! But it didn't
make a difference!
[image: image]
https://user-images.githubusercontent.com/7057631/31329504-5d8db07e-acd2-11e7-8b28-b6db15c293f1.png
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/luberda-molinet/FFImageLoading/issues/752#issuecomment-335091148,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM8PvwGzrtBvRlhQpUSRb5Cw2-Ro_dVGks5sqdYggaJpZM4PtbYV
.


Cannot install coreutils because conflicting formulae are installed.   md5sha1sum: because both install md5sum and sha1sum binaries

brew unlink md5sha1sum


refactor: logging standardisation

This PR

introduce logging service to wrap zap logs
standardise logging pattern across services

Related Issues

https://github.com/open-feature/flagd/issues/184
Notes

Follow-up Tasks

How to test

This fails on benchmarking however I believe this is to be expected with the addition of the new logs

This fails on benchmarking however I believe this is to be expected with the addition of the new logs

@james-milligan @skyerus @AlexsJones @beeme1mr  this comment made me wonder:
Could we implement async logging? We want flagd to be as low-latency as possible - it hink it would be nice to make all the logging async. It looks like logrus doesn't support this out of the box, but there's a more-or-less standard solution:
https://github.com/sirupsen/logrus/issues/725

@james-milligan this is a good start!

This fails on benchmarking however I believe this is to be expected with the addition of the new logs

@james-milligan @skyerus @AlexsJones @beeme1mr this comment made me wonder:
Could we implement async logging? We want flagd to be as low-latency as possible - I think it would be nice to make all the logging async. It looks like logrus doesn't support this out of the box, but there's a more-or-less standard solution:
sirupsen/logrus#725

I am not really sure if it's going to be worth it as long as we can disable logging if required. I don't mind checking it out though.

Is this ready to review @james-milligan , should we just ignore the benchmark?

Is this ready to review @james-milligan , should we just ignore the benchmark?

yes its ready for revie, I think we should ignore the benchmark, it may even be worthwhile updating the benchmark to be more inline with the e2e tests so we can view performance impacts across the full flag evaluation process, not just across the span of the connect service.
If we do find that performance becomes an issue we can introduce an option to noop the logging service for specific loggers, e.g. silence request logs and only show configuration changes

Is this ready to review @james-milligan , should we just ignore the benchmark?

yes its ready for revie, I think we should ignore the benchmark, it may even be worthwhile updating the benchmark to be more inline with the e2e tests so we can view performance impacts across the full flag evaluation process, not just across the span of the connect service.
If we do find that performance becomes an issue we can introduce an option to noop the logging service for specific loggers, e.g. silence request logs and only show configuration changes, which would also bypass the setting of values in the logger

I'm in favor of merging this and creating a new issue for a noop logger for evaluations that can be configured to still log update events.


add import_code_fields, test cases

Summary by CodeRabbit

New Features

Added import_code_fields to import settings, allowing users to store and manage code-naming preferences.

Enhancements

Updated synchronization process to use attribute_disable_callback_path for better attribute handling.

Bug Fixes

Implemented validation to prevent removal of imported attributes from the preference list once they have been set.

Tests

Added comprehensive tests for import code fields to ensure correct handling and validation.

Codecov Report
Attention: Patch coverage is 96.13357% with 22 lines in your changes missing coverage. Please review.

Project coverage is 93.97%. Comparing base (5d7dfc7) to head (4c99385).
Report is 12 commits behind head on master.

Files
Patch %
Lines

apps/mappings/imports/queues.py
7.69%
12 Missing :warning:

apps/sage300/utils.py
58.33%
5 Missing :warning:

apps/mappings/imports/modules/categories.py
97.36%
1 Missing :warning:

apps/mappings/imports/modules/cost_centers.py
97.43%
1 Missing :warning:

apps/sage300/models.py
93.33%
1 Missing :warning:

apps/workspaces/serializers.py
94.11%
1 Missing :warning:

tests/test_sage300/test_helpers.py
94.73%
1 Missing :warning:

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #205      +/-   ##
==========================================
- Coverage   94.69%   93.97%   -0.72%
==========================================
  Files         100      104       +4
  Lines        5537     6357     +820
==========================================
+ Hits         5243     5974     +731
- Misses        294      383      +89

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


Review Style

[ ] Search/Dataset selection style
[ ] sticky bottom bar

Search Dataset style:

[ ] Move the source tot he bottom of the table
[ ] move the collapse arrow to the right of the panel.

[ ] Small fix width for the row column
[ ] text in light grey

@scespinoza I'm not sure what you're thinking for the smaller width of the column, but my guess is that if a more "dynamic" column width is giving you trouble, I would just do a very simple:
const columnWidth = strLengthOfLargestNumber * fontSize;

This works for the most part, and has a tendency to be slightly too large, so there shouldn't be any issues with truncation.


Mavlink rate management over USB erratically imposing low limits, never scales back up without telemetry_status updates

I recently pulled stable and master and noticed some mavlink message rates were randomly running slower than normal. The mavlink rate would not always decrease by the same factor from boot to boot, nor would it always be impacted.
After a bit of debugging I believe this is attributable to 79910ce7e04f45ab28bf6dbae17f9d6224215ce2; mavlink status indicated that rate mult on the USB interface was at 0.05 when rates were most severely impacted.
I haven't spent too much time digging into exactly what is going on, but one concern I have is the update_rate_mult call here could occur before any mavlink messages have been selected for streaming. If that is the case I believe we'll divide by zero here. fminf should protect us from nefarious floating point behavior.
Haven't gotten to the root of what is randomly causing degraded rate limits on boot, but wanted to get this in the tracker and mention that an absence of telemetry_status updates prevents the rate limit from ever recovering once it has been limited.

This is fixed on stable / master / beta.


Documentation Select

Correct this please
<select ng-model="cardType" ng-options="type in ['Visa', 'American Express', 'MasterCard']"></select>

to something like
 <select ng-model="cardType" ng-options="type as type for type in ['Visa', 'American Express', 'MasterCard']"></select>

In the future a PR on something this simple would be very much appreciated


[catnap] Bad OperationResult for accept()

Description
In Catnap, the OperationResult for accept() is wrong.
Currently, this constructed from the file descriptor supplied to accept(). Instead, the OperationResult structure should be constructed from a QToken that is associated to the underlying file descriptor that was allocated on accept().
See code snippets bellow  for more info.
catnap::futures::OperationResult

/// Operation Result
pub enum OperationResult {
    Connect,
    Accept(RawFd),
    Push,
    Pop(Option<Ipv4Endpoint>, Bytes),
    Failed(Fail),
}

catnap::futures::OperationResult::get_result()
// Accept operation.
Operation::Accept(FutureResult {
    future,
    done: Some(Ok(fd)),
}) => (future.get_qd(), OperationResult::Accept(fd)),
Operation::Accept(FutureResult {
    future,
    done: Some(Err(e)),
 }) => (future.get_qd(), OperationResult::Failed(e)),

This bug was fixed in commig 364fef2ea67f6d39bc4881bc6ca7b05a74f725aa.


[QUERY] Can excessive memory usage by reactor.util.concurrent.SpscArrayQueue while consuming from an EventHub be controlled? Or is this a bug?

Query/Question
During consumption from an EventHub, we're seeing an exceptionally large amount of memory in-use in the java heap.
In the example below there are PartitionEvent objects containing EventData and then AmqpMessageBody bodies of roughly 148,000 bytes (which itself is multiple messages which is why the message is so large).
This ArrayList contains about 500 of these (but could contain 549 based on the instantiated size), and the SpscArrayQueue could contain up to 512 of these ArrayList objects.
Class Name                                                                                | Shallow Heap | Retained Heap | Percentage
--------------------------------------------------------------------------------------------------------------------------------------------
reactor.util.concurrent.SpscArrayQueue @ 0x603b21700                                            |          400 | 8,433,524,592 |     21.14%
'- array java.lang.Object[512] @ 0x6052d6dd0                                                    |        2,064 | 8,433,524,192 |     21.14%
   '- java.util.ArrayList @ 0x6e97f36e0                                                         |           32 |    50,389,456 |      0.13%
      '- elementData java.lang.Object[549] @ 0x947f6cdb0                                        |        2,208 |    50,389,424 |      0.13%
         '- com.azure.messaging.eventhubs.models.PartitionEvent @ 0x6ef385a80                   |           32 |       148,496 |      0.00%
            '- eventData com.azure.messaging.eventhubs.EventData @ 0x6ef386b80                  |           32 |       148,432 |      0.00%
               '- annotatedMessage com.azure.core.amqp.models.AmqpAnnotatedMessage @ 0x6ef388d30|           48 |       148,224 |      0.00%
                  |- amqpMessageBody com.azure.core.amqp.models.AmqpMessageBody @ 0x6ef38ca50   |           32 |       147,696 |      0.00%
                  |- messageAnnotations java.util.HashMap @ 0x6ef38caa0                         |           48 |           288 |      0.00%
                  |- properties com.azure.core.amqp.models.AmqpMessageProperties @ 0x6ef38cb20  |           64 |            64 |      0.00%
                  |- deliveryAnnotations java.util.HashMap @ 0x6ef38ca70                        |           48 |            48 |      0.00%
                  |- footer java.util.HashMap @ 0x6ef38cad0                                     |           48 |            48 |      0.00%
                  '- header com.azure.core.amqp.models.AmqpMessageHeader @ 0x6ef38cb00          |           32 |            32 |      0.00%
--------------------------------------------------------------------------------------------------------------------------------------------

So we're trying to understand why there are over 56,000 messages in memory (8,433,524,592 total heap / 148,496 sample message size) when default cache (100) and prefetch (300) values are being used with a batch size of 999.
There seems to be one of these caches for each partition-pump-x-x thread as well which scales the effect of this memory usage up massively when collecting from multiple partitions or EventHubs.
Why is this not a Bug or a feature Request?
Before making this a bug, we want to ensure there aren't some settings that can control this that we can make use of.
Setup (please complete the following information if applicable):

OS: RHEL7 / Java <IP_ADDRESS>
Library/Libraries:
com.azure:azure-core:1.28.0
com.azure:azure-core-amqp:<IP_ADDRESS>
com.azure:azure-messaging-eventhubs:5.11.2
com.azure:azure-messaging-eventhubs-checkpointstore-blob:1.12.2
com.azure:azure-storage-blob:12.21.1
com.azure:azure-storage-common:12.16.1

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

[ X ] Query Added
[ X ] Setup information Added

Hi @ChrisCollinsIBM, we optimized the memory allocation of Processor in version 5.18.0                                                                                azure-sdk-for-java/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md at main · Azure/azure-sdk-for-java (github.com), this should lower the memory usage that you are seeing.
Each partition has a dedicated connection (link) to the service, the in-memory queues exist for each partition-receive. Each partition-receive is managed by an instance of partition-pump-x-x, so as you observed, allocation adds up based on the number of partitions-receive hosted in one machine.

Thanks for the prompt response @anuchandy, I did find #38572 when I went digging into the EventHub Messaging history so I presume that's the fix you're referring to.
Since we're using the prefetch defaults (300) what would you suggest for a reasonable batch size? I see 100 tossed around in many discussions using a 3:1 prefetch:batch ratio but maybe that was cache related. But then in some other places I see 10 as a batch. Some guidance on this would be great, thanks!

Hello @ChrisCollinsIBM, sorry for the late response. @conniey and I discussed this. We don’t have a one-size-fit-all recommendation for tuning prefetch and batch size for optimal memory, there is also a third variable of expected event(s) size. Our suggestion is to run the application (with actual event processing logic) and tune these values to achieve expected throughput. While doing this exercise, identify an appropriate value to set for max heap size (-Xmx). The idea is, once the application run reaches a steady state with expected throughput, force a full GC using tools such as JConsole, check how much memory is occupied after the full GC. You want to size the heap such that only ~30% is occupied after full GC; use this value to set the max heap size (-Xmx). Size the host (e.g., container) memory to have an "additional ~1 GB" of memory for the "non-heap" need for the JVM instance.

Closing this, refer previous comment.


Provide an or! macro that handles any number of futures

This has the same effect as f1.or(f2.or(f3.or(...))) but without the
nesting.
Note that an equivalent race! macro would not be fair, since it would
be a coin-flip at each level. A fair race! macro would need to count
the number of futures, and select randomly. This could be done by adding
a version of the Race future that has a count and checks its first
future first with 1/N probability, and its second future first
otherwise.

@stjepang That's doable. Could you live with it appearing as both futures_lite::or_futures! (or similar placeholder) and as futures_lite::future::or!? (The alternative would, as far as I can tell, require a separate helper crate.)

Hmm, I would be okay with a helper crate, perhaps futures-lite-macros that would allow us to export the macro into the right module. It's not like such a crate would materially impact compilation times, and I expect in the future rust version the hack will not be necessary.

Alright, I can try that. (It'd look a lot like this, but with the macro implementations moved to that helper crate, and then pub used here.

Sounds good!

I loved this so much I stole it for futures-micro. Also I adapted it for zip/join with mildly amusing results

You could actually just depend on futures-micro to get this macro now it's released, instead of extracting it out into a new crate. You'd also get an implementation of PollFn (which is itself about a third of the crate size), and i was suggesting you nick PollState anyway, which is another third of it.

That’s actually a good idea :)

@jjl: I think the implementation of zip should pattern-match out of the nested 2-tuples, and emit an N-tuple. That isn't hard to do in a macro, and it would substantially improve usability.

i completely agree, I just haven't gotten around to figuring it out yet.

now done

I would use this :)

you already can, it's in the released futures-micro

I am using it, id be happy to see a reexport if that happens.
On Wed, Aug 26, 2020 at 10:11 PM jjl<EMAIL_ADDRESS>wrote:

you already can, it's in the released futures-micro
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/stjepang/futures-lite/pull/7#issuecomment-681496290,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADPI5BFTTU7ABAIZOUEV4TSCXTG7ANCNFSM4PU5A2ZA
.

there's a PR for that! #15

Is there still any interest in this?
Personally I'm a fan of the fact that futures-lite doesn't contain any obscure macros right now, and I think that a.or(b).or(c) looks better than or!(a, b, c). Still, it looks like people were interested in this above, so there might still be demand for it now.

a.or(b).or(c)

I think this is basically an anti-pattern because polling will become unfair. https://github.com/tokio-rs/tokio/issues/2319


Support jobs_scope argument for jenkins and elasticsearch

This change adds the jobs_scope attribute to use with jenkins and
elasticsearch sources. The attribute is part of the system
configuration, so it introduces a new method of System to export system
attributes that might be relevant for sources. This change also modifies
the run_query main loop to create a new SourceStoreMethod per system,
since the assumption that sources will have unique names is not
correct.

I took a look into this but I don't get exactly the improvement between the old way to pass the arguments.
I have another question, I see it's used in this case for the jobs. Will it be used also for other kind of cases like builds, tests, ...?

I took a look into this but I don't get exactly the improvement between the old way to pass the arguments. I have another question, I see it's used in this case for the jobs. Will it be used also for other kind of cases like builds, tests, ...?

I'll try to explain. The idea behind this PR is to allows users to take one physical environment and separate it into multiple separate logical environments.
Imagine you have one Jenkins system but different teams use that system. So let's say you have a team that looks only at jobs called "phase1-*", a team that looks only at "phase-2" jobs, and a team that looks at both but treats them as two separate environments/groups.
jobs_scope allows you to take such environment and treat it as two environments:
environments:
phase1:
jobs_scope: "phase1-*"
...
phase2:
jobs_scope: "phase2-"
...
So when you as a user would like only to query phase1 jobs, you will run cibyl --env-name phase1 and it doesn't matter what you query for, whether it's ip version, builds, tests, ... it will only focus on phase1-* jobs.
For the second part of your question: " Will it be used also for other kinds of cases like builds, tests, ...?" - definitely not for builds. I'm not sure also if there is any use case for tests, but it's possible. Not something that I would say should be a priority rigtt now.

I took a look into this but I don't get exactly the improvement between the old way to pass the arguments. I have another question, I see it's used in this case for the jobs. Will it be used also for other kind of cases like builds, tests, ...?

I'll try to explain. The idea behind this PR is to allows users to take one physical environment and separate it into multiple separate logical environments. Imagine you have one Jenkins system but different teams use that system. So let's say you have a team that looks only at jobs called "phase1-*", a team that looks only at "phase-2" jobs, and a team that looks at both but treats them as two separate environments/groups.
jobs_scope allows you to take such environment and treat it as two environments:
environments:
  phase1:
    jobs_scope: "phase1-*"
    ...
  phase2:
    jobs_scope: "phase2-"
   ...

So when you as a user would like only to query phase1 jobs, you will run cibyl --env-name phase1 and it doesn't matter what you query for, whether it's ip version, builds, tests, ... it will only focus on phase1-* jobs.
For the second part of your question: " Will it be used also for other kinds of cases like builds, tests, ...?" - definitely not for builds. I'm not sure also if there is any use case for tests, but it's possible. Not something that I would say should be a priority rigtt now.

Now it's clear for me. Thank you very much for the detailed explanation!


VSCode becomes too dim when Windows HDR is enabled

VSCode Version: 1.48.2
OS Version: Windows 10

Steps to Reproduce:

Go to Window's Display Settings and enable "Play HDR games and apps"
Open VSCode

Does this issue occur when all extensions are disabled?: Yes

Bot is correct, this is duplicate of issues above but original issue is #88491
Could you check if it's still reproducible for you in Insiders builds https://code.visualstudio.com/insiders/?

I also have this problem with VScode and I do not have it with insiders

duplicate of  #88491


accessory.name displayName and uuid generation

in the old platform support issue #95 there was a short discussion about the generation of the uuid for each accessory. unfortunately we have not followed this to the end.
for devices that have a real unique serial number it would be better to create the uuid based on this serial number an not on the (display) name which might change during the lifetime of the device.
i would like to suggest creating the (platform) accessories with something like this:
var accessoryUUID = uuid.generate(accessoryInstance.constructor.name + ":" + (accessoryInstance.uuid_base || displayName));

instead of a new variable uuid_base we could also use the serialNumber from the AccessoryInformation service.

You mean here
https://github.com/nfarina/homebridge/blob/master/app.js#L162
?
I would support that. During modeling my house I had to change names quite often, as in a global (or house-wide) context the name was not distinctive enough, loosing room asignments and such.
I assume with an constant UUID that would not have happened.
Did you test your change in you own fork/locally?
AccessoryInformation service is quite global in my platform, I would rather configure them as a new property with the accessories within.

yes. in app.js.
i will check if it works as intended.

see also #148

what exactly is accessoryInstance.constructor.name in the call to uuid.generate supposed to do?
as far as i can see it just prefixes everything with an 'Object' string. so it looks redundant.
so this:
var accessoryUUID = uuid.generate(accessoryInstance.uuid_base || displayName);

should be enough?

Actually it prefixes with the name of the accessory type you're generating a UUID for, making accessories unique by their accessory shim by getting the name of the constructor object

function MyCoolAccessory(n) { this.name=n;}
var myThing = new MyCoolAccessory("home");
console.log(myThing.constructor.name);

--> MyCoolAccessory

hmmm... i'm not sure if this works as intended. if i put a debug message into uuid.generate it just prefixes everything with 'Object'.

Are you using object literals?

Am 25.09.2015 um 13:08 schrieb justme-1968 -<EMAIL_ADDRESS>hmmm... i'm not sure if this works as intended. if i put a debug message into uuid.generate it just prefixes everything with 'Object'.
—
Reply to this email directly or view it on GitHub.

what exactly do you mean ?

If you're talking about the FHEM platform, then it looks like it should be saying things like FHEMAccessory instead of Object. Even if you were using object literals the result of calling accessories() are still instances of the FHEMAccessory class. So it's really weird that it's prefixing Object.

yes. i'm talking about FHEM.js.

According to http://stackoverflow.com/questions/332422/how-do-i-get-the-name-of-an-objects-type-in-javascript, this:
var accessoryUUID = uuid.generate(accessoryInstance.constructor.name + ":" + (accessoryInstance.uuid_base || displayName));

will- as observed- always be prefixed by Object which is not intended (and not helpful).

Actually it prefixes with the name of the accessory type you're generating a UUID for, making accessories unique by their accessory shim by getting the name of the constructor object

@desvdp Exactly that is what should be happening but doesn't. Your example
function MyCoolAccessory(n) { this.name=n;}
var myThing = new MyCoolAccessory("home");
console.log(myThing.constructor.name);

Is not using the protoype pattern that the accessories use:
function HttpAccessory(log, config) {
}

HttpAccessory.prototype = {
}

I'm lost though how to fix this without forcing Accessories to store their type in another field?

I've just console.logged my UUID creation and it is reliably object as constructor name.
I followed the trace back to the point where I create the accessory objects and even there the contructor name is already printed as object.
So @andig  is right:
// testing constructor name

function MyCoolAccessory(n) { this.name=n;}
var myThing = new MyCoolAccessory("home");
console.log("1 " + myThing.constructor.name);

function My2CoolAccessory(n) { this.name=n;}
My2CoolAccessory.prototype = {
		a:0,
		b:1,
		c:function(){this.d = a+b;}
}
var my2Thing = new My2CoolAccessory("home");
console.log("2 " + my2Thing.constructor.name);

returns
$node test.js
1 MyCoolAccessory
2 Object

In the moment we are manipulating the prototype of the function, we lose the name, and it's just Object
Question is, why do we do that?
Being -still- a newbie to javascript I would think we could create our accessories that way (taking the example from above):
function My3CoolAccessory(n) {
		this.name=n;
		this.a = 0;
		this.b = 1;
		this.c = function (){this.d = this.a+this.b;};
};
var my3Thing = new My3CoolAccessory("home");
console.log("3:" + my3Thing.constructor.name);

returns 3:My3CoolAccessory
So instead of manipulating the prototype we could just define all methods we need within the constructor. Through prototypal inheritance  these methods are available in derived objects.
Am I completely wrong?
Another subject might be the use of require() which might also kill the prototype.name, but I am not sure of that yet.

With require() it gets even more complicated.
Taking the example from above, and exporting the My3CoolAccessory, we get in another file
var a = require("./test.js").My3CoolAccessory;
console.log("a: " + a.constructor.name);

var b = new a("Hey");
console.log("b: " + b.constructor.name);

guess what?
Right:
a: Function
b: My3CoolAccessory

@andig Thanks for the StackOverflow link, looks like constructor.name is not a good choice here. It worked for me but does fall down in many cases.

With require() it gets even more complicated.

Well why make it so complicated? E.g. in https://github.com/nfarina/homebridge/blob/master/app.js#L80 you already have the constructor name. Why not just pass it to createAccessory as namespace parameter?

Coming back to the original post of @justme-1968 :
What about having an namespace parameter for platforms/accessories and an optional uuid_base in the config file? This would allow changing the name without creating a new UUID and thus losing all room assignments and such.
If you agree (espc. @nfarina  ) I would prepare a PR.

Yes I think that's a good idea, I would support that,

Ok, here it is.
Please have a look at it before merging #233 because I currently have no node compiler at hand to test.

Ok. it's tested with node 4.1.1 on my raspi.

i could not follow the diskussion during the last few days. but this sounds great.

I'm reopening this since according to nfarina/homebridge#203 this should actually work but doesn't.

After some checking I've found that homebridge does NOT handle creating accessories of same name if they have different type:
accessories.push(new FritzOutletAccessory(self, "foo"));
accessories.push(new FritzThermostatAccessory(self, "foo"));
callback(accessories);

Gives:
/Users/andig/Documents/htdocs/homebridge/node_modules/hap-nodejs/lib/Accessory.js:258
      throw new Error("Cannot add a bridged Accessory with the same UUID as another bridged Accessory: " + existing.UUID);
      ^

For homebridge-fritz this can be solved by adding the AIN as uuid_base parameter to FritzPlatform.prototype which I'll implement shortly.
Fixed in 0.5.8 and finally closing :)

The reason is Server.prototype._loadPlatformAccessories():
var accessory = this._createAccessory(accessoryInstance, accessoryName, platformType, accessoryInstance.uuid_base);

and then in _createAccessory():
var accessoryUUID = uuid.generate(accessoryType + ":" + (uuid_base || displayName));

This only takes accessoryType and displayName into account unless uuid_base has been manually added to the accessory. accessoryType is afaiks the platform type and NOT the accesory type (at least with my implementation), so it creates duplicates.