[ERC20] Write test suite

Write a comprehensive test suite for the erc20 implementation here: https://github.com/dojoengine/dojo/tree/main/crates/dojo-erc/src/erc20
Inspiration can be taken from the Open Zeppelin teams test suites

i can take this

@tarrencev @ponderingdemocritus testing functions that leverage get_caller_address() eg. approve causes the caller address to be the executor contract. Should we add an extra caller: ContractAddress argument to deal with this?
 #[external(v0)]
    fn approve(ref self: ContractState, spender: ContractAddress, amount: u256) -> bool {
        assert(spender.is_non_zero(), 'ERC20: approve to 0');
        let token = get_contract_address();
        let owner = get_caller_address();
        let mut calldata = array![];
        calldata.append(token.into());
        calldata.append(owner.into());
        calldata.append(spender.into());
        calldata.append(u256_as_allowance(amount));
        self.world.read().execute('erc20_approve', calldata);

        self.emit(Approval { owner, spender, value: amount });

        true
    }

becomes this:
 #[external(v0)]
    fn approve(ref self: ContractState, owner: ContractAddress, spender: ContractAddress, amount: u256) -> bool {
        assert(spender.is_non_zero(), 'ERC20: approve to 0');
        let token = get_contract_address();
        let mut calldata = array![];
        calldata.append(token.into());
        calldata.append(owner.into());
        calldata.append(spender.into());
        calldata.append(u256_as_allowance(amount));
        self.world.read().execute('erc20_approve', calldata);

        self.emit(Approval { owner, spender, value: amount });

        true
    }

@tarrencev @ponderingdemocritus seem that starknet::testing::set_caller_address  only change the caller address on the contract is called in, it doesn't work when invoking dispatchers, where the caller address is 0x0. Any workarounds specific to dojo?

Proposed hacky solution:
Create mock test contract with added caller parameter and removed get_caller_address()

to mock caller address in tests, you have to use set_contract_address (the caller will be the test contract)

to mock caller address in tests, you have to use set_contract_address (the caller will be the test contract)

this worked thank!


I want to specify a keyManager password

In the OpenSource project I'm currently contributing too, I need to specify a keyManager password.
However, Spark java do not expose this  functionnality of SslContextFactory, and refuses to start (without explicit error).
I belive we should add a secure method that exposes the keyManagerPassword to enable using such Keystores.
I will contribute this wiring code when I get time.

This means we can not use JKS keystores that requires a password.


Add spanish, polish and indonesian translations

Description of the changes
Given that in the Bolls API there are translations of these languages available, I added some of them to the list of selectable bible versions

Fixes #27
Fixes #59

Screenshots

Thanks so much


ci: update tag github action

Description

closes: #184
Motivation and context

How has this been tested?

Screenshots (if appropriate):
Checklist:

[ ] I followed the contributing guidelines and code of conduct.
[x] I have added a relevant changelog to CHANGELOG.md
[ ] I have added tests to cover my changes.
[ ] I have updated the documentation accordingly.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

sims.yml and lint.yml still use secrets.TOKEN.
Don't we need to change these?

I changed all TOKEN


Add Astro middleware and actions

This PR adds new entry files to the Astro plugin, supporting:

https://docs.astro.build/en/guides/actions/
https://docs.astro.build/en/guides/middleware/

Files for these features are optional and might not always exist. Not sure if that could give an issue?

:rocket: This pull request is included in v5.38.0. See Release 5.38.0 for release notes.
Using Knip in a commercial project? Please consider becoming a sponsor.


Add the overview page

Move the Youtube presentation from the Getting started to the Overview
Add the presentation from the repo in the Overview
Make the Overview as the default page

Awesome! Thanks.


feature: withdraw all tokens in a strategy

Codecov Report

Merging #145 (0ea017e) into master (18550e7) will decrease coverage by 0.27%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
- Coverage   79.98%   79.70%   -0.28%
==========================================
  Files          16       16
  Lines        1709     1715       +6
  Branches      316      317       +1
==========================================
  Hits         1367     1367
- Misses        342      348       +6

Impacted Files
Coverage Δ

contracts/SavingsAccount/SavingsAccount.sol
73.13% <0.00%> (-3.43%)
:arrow_down:

Continue to review full report at Codecov.

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


Update README.md

Hi,
This small PR mainly adds a button to get your app via the IzzyOnDroid open source app repo in a F-Droid client.
It will help people without Google Play to find and use your app, as well as helping them to keep it updated.
Since the apk provided by IzzyOnDroid is simply taken from the Release Section of this repo, please never forget to attach your signed apk to the release when tagging a new version, so that Izzy can take it and make it available via a F-Droid client to your users !

Thank you!


Implementation bug in A* algorithm

https://github.com/KIT-MRT/behavior_generation_lecture_python/blob/53279f0e3ae82caeb464d09db63974de67609be1/src/graph_search/a_star.py#L134
I'm not sure if I'm misunderstanding the algorithm, but i think the if condition should check if the node x_tilde is already in the open set or if the current calculated cost to come of this node is smaller than the cost to come calculated in a previous step.
Right now, the if condition checks if the current cost to come is smaller than the approximated  cost to go.
if (                             not x_tilde.node in [x.node for x in open_set]                             or cost < x_tilde.G                         ):
I think the code should look like this, replacing x_tilde.G with x_tilde.C:
if (                             not x_tilde.node in [x.node for x in open_set]                             or cost < x_tilde.C                         ):

Thanks for reporting @wahllca! We are looking into refactoring this implementation.


fix NameError

Running ch07/train_convnet.py causes following error.
Traceback (most recent call last):
  File "train_convnet.py", line 33, in <module>
    x = np.arange(max_epochs)
NameError: name 'max_epochs' is not defined

Thanks again,


0.3.0 release prep + Cargo.toml changes

From talking with @dlubarov, we want to be able to make publishing all of the (many) crates in this repo as painless as possible despite there being so many. This PR bumps all of the crate versions to 0.3.0 and also changes all sub-crates to use shared workspace variables.
There was a bit of discussion regarding if we should use lock-step versioning (where all crates are using the same semver version) or lazily bump sub-crate versions based on the changes made. There are tradeoffs between picking either, but for now we're going to start with lockstep and see how it goes. Essentially the main aspects of each are:
Lockstep:

Easy to guarantee that all crates will work fine together for a given version.
Easy to bump versions.
Cargo will not be able to automatically bump dep versions as often (eg. unless the lockstep bump just bumps the patch).

Lazy-bump:

Should probably be fine in most cases, but I would worry that it might be more likely that cargo can update deps to versions that are not compatible in some cases (not sure if this is actually possible if semver is followed).
If semver standards are followed, cargo should be able to easily use newer versions without the user specifying a version bump in a lot of cases.

I also moved as many Cargo.toml configuration variables to workspace settings, including version. This means that when we want to update all of the versions, we just need to bump the workspace version before running a tool like cargo smart-release.
There will be two followup PRs that will respectively deal with:

Automatic change log generation.
Adding a script to automatically bump-and-publish.

Finally, also note that crates.io already has version 0.2.0 published for all sub-crates despite main currently only having most crates set to 0.1.0.

So I realized that how I setup the version lockstep actually won't work with { path = "../*", workspace.version = true }. I somehow convinced myself that this pulled in the version defined in the workspace Cargo.toml, but it turns out it actually doesn't.
I found a better way to do lockstep and should have a PR out later today (might just adjust this PR).


How to revue the results on windows

I am a Windows based lifeform, so don't have the pleasure of Valgrind experience. Does the DHAT's viewer work on windows? I could not figure that out from the Valgrind website. How would I get it set up?

Yes, It works! Clone the Valgrind repo. DO NOT try to build Valgrind. Open the dhat/dh_view.html, and it just works.

7d7ff17 clarifies the instructions.


Fix cohere embedder

Description
Fix the usage of the cohere embedder. Changes:

add langchain_cohere package (from langchain_community.embeddings import CohereEmbeddings is deprecated)
add 'cohere' to the validate_config of the embedder model

Fixes # (issue)
#1346
Type of change

[x] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please delete options that are not relevant.
test_langchain_default_concept() is failing. However, it also fails on the origin/main branch when running the test locally.

[x] Test Script (please provide)

import os
from embedchain import App

os.environ["OPENAI_API_KEY"] = "sk-XXX"
os.environ["COHERE_API_KEY"] = "XXX"

app = App.from_config(config_path="config.yaml")

app.add("https://www.forbes.com/profile/elon-musk")
answer = app.query("What is the net worth of Elon Musk today?")
print(answer)

Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[x] Any dependent changes have been merged and published in downstream modules
[x] I have checked my code and corrected any misspellings

Maintainer Checklist

[ ] closes #xxxx (Replace xxxx with the GitHub issue number)
[ ] Made sure Checks passed

@deshraj test_langchain_default_concept() is failing when running the code locally. It also fails when running origin/main code locally. Could this be due to my local setup?
I assume my fix does not cause the test to fail.

@LeonieFreisinger thanks for pointing out. I will look into this and get it fixed soon.

@deshraj Thanks! Yes, besides this it is ready for review


Though the program can be executed sequential, the parallel interpretation seems never terminates.

Reproducing the behavior
I was trying to use Bend to simulate the behavior of an 8-bit carry-lookahead adder circuit. I found that the program runs successfully with the sequential Rust interpreter using bend run-rs test.bend -s. It produces the output
Result: 65536
- ITRS: 96731497
- TIME: 2.36s
- MIPS: 41.01

However, the execution seems to never terminate when I try either:
bend run-c test.bend -s
bend run-cu test.bend -s

It’s worth noting that the problem does not occur when testing a 7-bit or smaller adder program. The issue only arises when testing an 8-bit adder program like the one below.
I’m wondering if this behavior indicates a bug in Bend or if it’s due to a mistake in my program. Thanks in advance for any insights!
Below is the test.bend program I was running, and modifying the last two lines of the program allows me to change the bit-width of the adder.
type Bool:
  True
  False

def not(a: Bool) -> Bool:
  match a:
    case Bool/True:
      return Bool/False
    case Bool/False:
      return Bool/True

def or(a:Bool, b: Bool) -> Bool:
  match a:
    case Bool/True:
      return Bool/True
    case Bool/False:
      return b

def and(a: Bool, b: Bool) -> Bool:
  match a:
    case Bool/True:
      return b
    case Bool/False:
      return Bool/False

def xor(a: Bool, b: Bool) -> Bool:
  match a:
    case Bool/True:
      return not(b)
    case Bool/False:
      return b

def half_adder(a: Bool, b: Bool) -> (Bool, Bool):
  return (xor(a, b), and(a, b))

def full_adder(cin: Bool, a: Bool, b: Bool) -> (Bool, Bool):
  (s1, c1) = half_adder(a, b)
  (s2, c2) = half_adder(s1, cin)
  return (s2, or(c1, c2))

def app(head: Bool, list: List(List(Bool))) -> List(List(Bool)):
  match list:
    case List/Nil:
      return List/Nil
    case List/Cons:
      return List/Cons(
        List/Cons(head, list.head),
        app(head, list.tail))

def gen(n: u24) -> List(List(Bool)):
  if n == 1:
    return [[Bool/True], [Bool/False]]
  else:
    return List/concat(
      app(Bool/True, gen(n - 1)),
      app(Bool/False, gen(n - 1)))

def adder(a: List(Bool), b: List(Bool)) -> (List(Bool), Bool):
  match a:
    case List/Nil:
      return ([], Bool/False)
    case List/Cons:
      match b:
        case List/Nil:
          return ([], Bool/False)
        case List/Cons:
          sum_t, cout_t = adder(a.tail, b.tail)
          sum, cout = full_adder(cout_t, a.head, b.head)
          return (List/Cons(sum, sum_t), cout)

def test_on_b(a: List(Bool), b: List(List(Bool))) -> List(List(Bool)):
  match b:
    case List/Nil:
      return List/Nil
    case List/Cons:
      sum, cout = adder(a, b.head)
      return List/Cons(sum, test_on_b(a, b.tail))

def test_on_a(a: List(List(Bool)), b: List(List(Bool))) -> List(List(Bool)):
  match a:
    case List/Nil:
      return List/Nil
    case List/Cons:
      return List/concat(test_on_b(a.head, b), test_on_a(a.tail, b))

def main() -> u24:
  length, _ = List/length(test_on_a(gen(8), gen(8))) # Change '8' to modify bit-width
  return length

System Settings
Running with:

HVM: 2.0.22
Bend: 0.2.37
OS: Linux (Ubuntu 24.04)
CPU: Intel i9-13900H
GPU: RTX 4070 Max-Q
Cuda Version: release 12.0, V12.0.140

Additional context
No response

Also, there is a typo in the README. It says in the section Running Bend Programs that bend run uses the sequential rust interpreter as default, but in the section Running the file, it says the command uses the parallel C interpreter by default.

It's also very suspicious how the program gets slower with run-c even thought it has a reasonable degree of parallelism


How would I train a private knowledge base? (Query)

Is there any option to train a private knowledge base (set of PDF/Text docs) and make it available to every chat session?

you would just ingest the data to a vector database and have this read from it

i am curious as well, would someone be so kind to roughly outline how something like this would be implemented, so that i can efficiently look up the necessary resources?

you would just ingest the data to a vector database and have this read from it

"have this read from it" - what does this mean more specifically? Possible to elaborate it more?


Publish UI library copy to CDN

Is your feature request related to a problem? Please describe.
Feature request: In addition to distributing Gravity's CSS library via NPM, it would be handy to also publish to a CDN. This would allow consumers to simply add something like <link rel="stylesheet" href="https://static.buildit.digital/gravity/v1.0.0/gravity.css"> to an HTML file to get started instead of needing to faff about with NPM installs. (and, if we add JS later it could be similar)
I imagine this could be useful for small projects and prototypes since it reduces the intial time and effort to get up and running.
For public sites that only need the out-of-the-box Gravity styles & components, there may even be a performance benefit of referencing a central CDN copy instead of hosting their own versions of those files. As users visit various Buildit properties, those files will have already been cached, so visits to new pages referencing them should load a little faster.
Note that this would be in addition to the current NPM distribution, so more complex use-cases can still do what they do today.
Describe the solution you'd like
I'd imagine this would be an additional deployment step in our CI builds that uploads a copy of the pre-compiled CSS, JS and assets to a web server. This should coincide with NPM publishes - i.e. whenever we issue a new release.
This would be an additive process - i.e. previously released versions remain there. Therefore, each new release should be published to a unique URL. Using the version number in the URL's path seems like an obvious choice. Something along these lines perhaps:

https://static.buildit.digital/gravity/v1.0.0/... (where v1.0.0 corresponds to that release's version)

That way consumers can link to a specific version. Also, the URL is human-readable, which makes it easy to understand what your linking to.
We could configure the HTTP response headers to have a very long cache time (or even mark those resources as "immutable"), so that proxies and browsers are encouraged to not re-request those files again - after all, once published, a release will never change.
Some potential nice-to-haves might include:

Ability to link to the latest release of a major version. For example, something like: https://static.buildit.digital/gravity/v1.x/... could always return whatever the most recently release v1.x.y release is. This would allow consumers to always receive the most recent compatible release.

For these URLs we'd need to be careful with the cache-related response headers. Clients and proxies should at least revalidate these URLs after a few times so that they successfully pick up new releases.

Index page(s). It might be a nice touch if visiting https://static.buildit.digital/gravity/ would show a page containing a list of all currently published releases.

Could use https://aws.amazon.com/cloudfront/ unless there is another option already avail.  I can't imagine this costing more than a few dollars a month to host

Sure. If I'm not mistaken, the Buildit website sits behind the Cloudfront cache, so we're already using it there.
Is this something you fancy looking into for us @thehammeranderson?

:tada: This issue has been resolved in version 2.1.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


libyaml_vendor: 1.2.0-1 in 'rolling/distribution.yaml' [bloom]

Increasing version of package(s) in repository libyaml_vendor to 1.2.0-1:

upstream repository: https://github.com/ros2/libyaml_vendor.git
release repository: https://github.com/ros2-gbp/libyaml_vendor-release.git
distro file: rolling/distribution.yaml
bloom version: 0.10.3
previous version for package: 1.1.1-1

libyaml_vendor
* updating quality declaration links (re: ros2/docs.ros2.org#52 <https://github.com/ros2/docs.ros2.org/issues/52>) (#38 <https://github.com/ros2/libyaml_vendor/issues/38>)
* Update libyaml_vendor to 0.2.5. (#37 <https://github.com/ros2/libyaml_vendor/issues/37>)
* Contributors: Chris Lalancette, shonigmann

Please hold for coordinated merge.


Update Settings “general”

Automatically generated by Netlify CMS

👷 Deploy Preview for docbracing processing.

Name
Link

🔨 Latest commit
4f93c7bc97df889abc8a83cb82c7cee8ce3af331

🔍 Latest deploy log
https://app.netlify.com/sites/docbracing/deploys/6510794391a3b300086f88d4


Add better documentation

Currently, the documentation is written in the README.md  file and only gives the basic use case of the library. Better documentation can be hosted somewhere like Read the Docs and would have installation guidelines, examples, contribution guidelines and other related things to the library.

J


DataTemplateSelector for TreeView does not show nested items

Describe the bug
I have noticed a weird behavior using a DataTemplateSelector for a treeview.
See screenshot #1 for the expected behavior.
I went and looked at the XAML Controls Gallery and note that the DataTemplateSelector is set up differently; I would still expect this to work how I've done it.
Steps to reproduce the bug
Here is the code which works as expected:
    <TreeView CanDragItems="False" CanReorderItems="False" ItemsSource="{x:Bind Items}">
        <TreeView.ItemTemplate>
            <DataTemplate x:DataType="local:ItemTest">
                <TreeViewItem ItemsSource="{x:Bind Subitems}" IsExpanded="True">
                    <TreeViewItem.Content>
                        <TextBlock Text="{x:Bind Name}" />
                    </TreeViewItem.Content>
                </TreeViewItem>
            </DataTemplate>
        </TreeView.ItemTemplate>
    </TreeView>

I have tried to create a DataTemplateSelector as follows:
Treeview is defined in XAML as:
   <TreeView CanDragItems="False" CanReorderItems="False" ItemTemplateSelector="{StaticResource MyDataTemplateSelector}" ItemsSource="{x:Bind Items}" />

The data template selector code is as follows:
internal class MyDataTemplateSelector : DataTemplateSelector
{
    private static DataTemplate _itemType1Template;
    private static DataTemplate _itemType2Template;

    static MyDataTemplateSelector ()
    {
        var templates = new Templates();
        _itemType1Template= (DataTemplate)templates["item1Template"];
        _itemType2Template= (DataTemplate)templates["item2Template"];
    }
    protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
    {
        if (item is Type1)
            return _itemType1Template;
        else if (item is Type2)
            return _itemType2Template;

        throw new NotSupportedException();
    }
}

NOTE: Creating a new instance of Templates each time the template is selected and returning from that instance shows the same result.
The class Templates is a XAML (with codebehind) ResourceDictionary:
<ResourceDictionary
x:Class="MyApp11.Templates"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyApp11">

<DataTemplate x:DataType="local:ItemTest" x:Key="item1Template">
    <TreeViewItem ItemsSource="{x:Bind Subitems}" IsExpanded="True">
        <TreeViewItem.Content>
            <TextBlock Text="{x:Bind Name}" />
        </TreeViewItem.Content>
     </TreeViewItem>
</DataTemplate>

<DataTemplate x:DataType="local:ItemTest2" x:Key="item2Template">
    <TreeViewItem ItemsSource="{x:Bind Subitems}" IsExpanded="True">
        <TreeViewItem.Content>
            <TextBlock Text="The other item type" />
        </TreeViewItem.Content>
     </TreeViewItem>
</DataTemplate>

Expected behavior
I would expect that using the resource dictionary & DataTemplateSelector to have the same UI and behavior as doing it directly in XAML.
See Screenshot #2 for how it appears.
Screenshots
Screenshot #1 - expected behavior, as seen when the data template is defined locally without a DataTemplateSelector

Screenshot #2 - how it appears using the DataTemplateSelector. Note the lack of children:

Version Info
Using Win10 1903, not using MUX explicitly.

Does the tree view item need the selector as well?

Ok, I've worked around this after a few hours and looking at the XAML Controls Gallery source.
The issue is the override method used in DataTemplateSelector;
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
{
    if (item is Type1)
        return _itemType1Template;
    else if (item is Type2)
        return _itemType2Template;

    throw new NotSupportedException();
}

I was overriding that method.
If I override the other overload of SelectTemplateCore, it works!
protected override DataTemplate SelectTemplateCore(object item)
{
    if (item is Type1)
        return _itemType1Template;
    else if (item is Type2)
        return _itemType2Template;

    throw new NotSupportedException();
}

Looks like there might be a bug in the overload with the DependencyObject?

I believe the two-parameter SelectTemplateCore is deprecated and never called ... @RanjeshJ to confirm. We should figure out how to document this better, for sure.

That is correct. The override which passes the container is deprecated. Also in this case, the container is in the template that you are creating now so you cannot get the container passed to you.

https://github.com/MicrosoftDocs/winrt-api/pull/1156


TextDetector works ok on Android but doesn't work on iOS

Hi,
TextDetectorV2 works ok on Android.
However, I have the following error on iOS using GoogleMlKit.vision.textDetectorV2()

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method vision#startTextDetectorV2 on channel google_ml_kit)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)

#1      TextDetectorV2.processImage (package:google_ml_kit/src/vision/text_detector.dart:46:20)

textRecognizer = GoogleMlKit.vision.textDetectorV2();
final File? imageFile = await getImage(ImageSource.gallery);

if(imageFile != null) {
  final inputImage = InputImage.fromFile(imageFile);
  final RecognisedText recognisedText = await textRecognizer.processImage(inputImage);

  print(recognisedText.toString());
}

If I try using textDetector() instead of textDetectorV2(), the following error occurs when print recognisedText.toString()

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0

I added the following on Podfile
pod 'GoogleMLKit/TextRecognition', '2.2.0'
My development environment is as followes
iOS 14.7.1
Xcode 12.4
Please help me to solve this issue
Thanks in advance

any solutions ??

@kodol73 , @mahmoud-atef-eden : try our new plugin: google_mlkit_text_recognition.
We have split google_ml_kit in multiples plugins to allow devs to only include to their apps only what they need.
More info here:
https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_ml_kit
https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_text_recognition


Update BOSH-Lite garden-runc to v1.9.4

Garden-runc v1.9.4 running in a garden-runc v1.9.2 container cannot create nested containers.
/cc @julz

bumped with compiled bits. thanks.

thanks, @cppforlife !


Add support for Ceph deployment

Validation results on Homogeneous deployment:
http://pastebin.test.redhat.com/928882

Validation results on Homogeneous deployment:
http://pastebin.test.redhat.com/928882

@venkataanil @masco rebased the Ceph patch. Please have look

@venkataanil @masco rebased the Ceph patch. Please have look

also, would be great if there was a test for osp16.1, because that's the current LTS (long-term support) release that customers will be using.  Finally, why does travis say the build is "passing" when it appears not to work?   thx again -ben

also, would be great if there was a test for osp16.1, because that's the current LTS (long-term support) release that customers will be using.  Finally, why does travis say the build is "passing" when it appears not to work?   thx again -ben

also, would be great if there was a test for osp16.1, because that's the current LTS (long-term support) release that customers will be using. Finally, why does travis say the build is "passing" when it appears not to work? thx again -ben

We are working on building CI pipeline for Jetpack for both OSP13 and OSP16.1. The fix is submitted as Travis test was broken #329

also, would be great if there was a test for osp16.1, because that's the current LTS (long-term support) release that customers will be using. Finally, why does travis say the build is "passing" when it appears not to work? thx again -ben

We are working on building CI pipeline for Jetpack for both OSP13 and OSP16.1. The fix is submitted as Travis test was broken #329


[METADATA UPDATE][Merge by 2023-10-06] Global metadata/header/navigation changes

Description : A Pull Request has been made from the Learn Platform’s Metadata Management System. Please review and merge this Pull Request within 5 days. If you have any questions or concerns about the purpose of these metadata updates, please contact<EMAIL_ADDRESS>If you are not the correct contact for this content and repository, please notify<EMAIL_ADDRESS>If this Pull Request is not merged within 14 days, it will be automatically merged by our system to ensure the timeliness of the metadata update. This includes bypassing the Repository’s Branch Policy, including if Review Required is enabled. Please notify<EMAIL_ADDRESS>if you have questions or concerns or would like Pull Requests for metadata updates to merge automatically in future.
Fixing#892615 Replace invalid ms.topic value "troubleshoot" with valid value "troubleshooting"
Why we make metadata updates
It’s important that metadata is appropriately managed to ensure its ongoing relevancy, usefulness, and reflects the current business. For example, metadata is updated to reflect a product rebrand. Because some metadata values (slugs) are included in the YAML header, metadata updates require changes to the content itself.
For metadata used internally, these updates make reports cleaner, easier to use, more consistent, and more reflective of current business. Once changes to allowlist-driven metadata are merged, standard dashboards and reports will reflect new values. You’ll need to use new filter values in those dashboards and reports. If you have custom dashboards or Kusto queries, you might need to update those as well.
For customer-facing metadata, these updates ensure our customers are seeing the most up-to-date metadata on Learn content that matches what they see elsewhere in the Microsoft universe.
Why we make header/navigation updates
Header changes and other site navigation updates are crucial for improving content findability and are made in support of the navigation model strategy driven by the Learn Information Architecture and Content Architecture teams.
After you accept the header/navigation changes, you may now see a new or different product-level header used on content in your repo, revised breadcrumbs, or other navigation-related changes, which will be specified in the commit message.
Frequently Asked Questions
Why does this Pull Request appear to be made by the Repository Owner? We open Pull Requests two different ways.

For Git Repos with a permissioned Service Account, we open the PR from our Document Build Service Account.
For Git Repos that we either do not have Service Account permission for or the repo is in Azure Repos (ADO)  we open the Pull Requests in an automated way with the PR creator as the Repo owner.

How can I revert a Pull Request that has been merged and created an unexpected issue? Whether a PR has been merged manually or automatically, you can revert it if an issue arises. See Reverting a pull request - GitHub Docs.
CommitMessage : Due to lack of validation in some repos, bad ms.topic values have been added to content. This is to remove invalid values and replace with valid ms.topic values.

@v-savila @mosagie @meaghanlewis  This PR shows as merged into docs on Oct. 10. However, the change is not live. Could someone check into this and push these metadata quality changes live? Thank you!

@v-savila @mosagie @meaghanlewis This PR shows as merged into docs on Oct. 10. However, the change is not live. Could someone check into this and push these metadata quality changes live? Thank you!


Backfilling recording rules via API

Use case. Why is this important?
For the Service Level Objective project Pyrra we are adding support for availability recording rules that pre-aggregate the number of failed and total requests over the objective's window (often like 4w).
Now, if the Prometheus server is running for more than 4w and there's plenty of data available for the objective the displayed graph will only have the recording rule's data since it was created. This leaves users with a seemingly broken graph.

Note: This Prometheus has all the data available, it's just that the recording rule was created less than 2 days ago.
This experiences gets worse if users were to chance the objective's window from 4w to something else like 2w, since the underlying recording rules changes from increase(http_requests_total[4w]) to increase(http_requests_total[2w]) and it's name from http_requests:increase4w to http_requests:increase2w.
Proposal
Rather than creating some extra tooling as part of Pyrra to call the existing promtool tsdb create-blocks-from rules I want to propose adding a API to Prometheus itself to create these back filling blocks.
In my particular use case the back filling doesn't need to be instantly either and is fine to take a couple of minutes (depending on the amount of data).
As for the API I can imagine a RESTful admin API call containing such payload:
> GET /api/v1/admin/tsdb/blocks/rules HTTP/1.1
> Host: localhost:9090
> User-Agent: curl/7.81.0
> Accept: */*
> {"start":<PHONE_NUMBER>, "rules": ["http_requests:increase4w"]}

The response wouldn't be blocking until the blocks are created but could return 201 CREATED and thus signal that the request was successfully queued.
Obviously the actual implementation is up for discussion and I don't have a strong opinion.
cc @JessicaGreben @GayathriVenkatesh @roidelapluie

Hey 👋
Are there any ongoing plans of implementing this backfill API?

Hello from the bug-scrub! Nobody has stepped up to implement this in two years, so we will close the issue.
It still seems like a valid idea; we can re-open if someone has concrete plans to deliver it.


Whitespace visualisation at start of line

Thanks for the great software. I'm trying to modify the invisibles plugin so that it only shows whitespace at the beginning of the line, but I can't get the regexes right. I think it should be this:
tokens.tab = {
	pattern: /(^|\s)\t/m,
	lookbehind: true
};
tokens.space = {
	pattern: /(^|\s) /m,
	lookbehind: true
};

(I'm not sure about the m but it doesn't seem to make any difference.)
This almost works, but for some reason it also shows whitespace after other tokens, like this:

Any idea what I'm doing wrong?

(I'm going to assume that tokens is a language definition (e.g. C++).)
If you add the patterns for tab and space like in the above code, they will be appended at the end of the language definition meaning that they will be matched last.
As a consequence, ^ (in the beginning-of-string sense) will match after tokens like ) because of the way Prism splits the input code making lots of substrings.
To fix this, it should be enough to make both tab and space greedy (greedy: true).
The problem that will still remain is that leading spaces inside of tokens (e.g. multi-line comments) are not going to be matched.
A better approach is to let Prism tokenize the code with the vanilla language definitions (so without your tab and space). Then you let Prism tokenize the code a second time with only your tab and space. With the positions of all leading tabs and spaces, you can now modify the token stream of the highlighted code (the one tokenized first).
This is way more complicated than your approach, but it will work correctly in (I think) all scenarios.

And the m flag does not make a difference because if present it makes ^ a lookbehind for \r and \n which are also included in \s. So it doesn't matter in this case.

Thanks for the reply - what I ended up doing was looking through the tokenisation stream and finding unmatched tokens (since nothing matches space by default) and converting those to space/tab tokens. Seems to work ok. Feel free to add it as a plugin if you like!
Prism.hooks.add("after-tokenize", function(env) {
	// Tokenise leading spaces and tabs after the rest of the tokenisation
	// because its really difficult to do otherwise.
	for (let i = 0; i < env.tokens.length; ++i) {
		let str = env.tokens[i];
		if (typeof str === "string") {
			console.log(JSON.stringify(str));
			// If the first token is a string it doesn't start with a newline but
			// we start visualising whitespace anyway. After that we only start
			// when we encounter a newline character.
			let vis = (i === 0);
			let replacement = new Array();
			// Replace space or tab characters with tokens.
			for (let k = 0; k < str.length; ++k) {
				if (vis) {
					switch (str[k]) {
					case " ":
						replacement.push(new Prism.Token("space", " ", undefined, " ", false));
						continue;
					case "\t":
						replacement.push(new Prism.Token("tab", "\t", undefined, "\t", false));
						continue;
					}
				}
				if (replacement.length > 0 && typeof replacement[replacement.length-1] === "string") {
					replacement[replacement.length-1] += str[k];
				} else {
					replacement.push(str[k]);
				}
				vis = (str[k] === "\n");
			}

			env.tokens.splice(
				i, 1,
				...replacement
			);
			i += replacement.length - 1;
		}
	}
});

I think that this might be a nice extension of the Show Invisibles plugin.


The Geocoder is returning an empty array (but works fine on console)

Hello good afternoon.
I am facing a strange problem.
The Geocoder is returning an empty array.
It is returning [] when I run the following command directly in html view
Geocoder.search ("São Paulo, São Paulo, Brazil")
But when I run the same command on the rails console, it returns the data correctly (place, lat, long, etc.).
I've changed the timeout to 100, 200, and still does not work.
In fact, 90% of the time does not work. But sometimes, without any explanation it works.
What could be wrong?
I am using the latest version.
Thanks in advance.

Hi
Which lookup are you using? could it be that you're sometimes reaching your
query limit?
On Wednesday, February 24, 2016, i7 Webmidia<EMAIL_ADDRESS>wrote:

Hello good afternoon.
I am facing a strange problem.
The Geocoder is returning an empty array.
It is returning [] when I run the following command directly in html view
Geocoder.search ("São Paulo, São Paulo, Brazil")
But when I run the same command on the rails console, it returns the data
correctly (place, lat, long, etc.).
I've changed the timeout to 100, 200, and still does not work.
In fact, 90% of the time does not work. But sometimes, without any
explanation it works.
What could be wrong?
I am using the latest version.
Thanks in advance.
—
Reply to this email directly or view it on GitHub
https://github.com/alexreisner/geocoder/issues/989.

Hello, thanks for response.
I am using google.
Here is my geocoder config.
Geocoder.configure(
geocoding service
lookup: :google,
geocoding service request timeout (in seconds)
timeout: 30,
default units
units: :km
)
Is something wrong?
Thank you

Hi @nonato
I was unable to reproduce that error.
I created a new rails app 4.2.0, ruby 2.3 and tried doing the
<%= Geocoder.search ("São Paulo, São Paulo, Brazil") %>

in my html.erb and did not have any issues.

Hello. tanks for response.
Can it be a problem with the version of rails?
I'm using 3.2.3.
I really do not understand.
Even so, thank you for your attention.

If it works in the console, chances are that the problem is not related to Rails or Geocoder. My suggestion for debugging is to think about the ways running the command in the console is different from running it in a view. What happens in a controller, for example? Is there caching? What are the differences in environment between console and view that could be affecting this? Without knowing a lot more about your app, it's hard to know what to suggest.


USB Coral no longer works with Protection Mode enabled

Since #13 and the corresponding change in the supervisor I can't get the USB coral working with protection mode enabled. Before I always had this enabled (as is by default) without problems.
I expect the following change to cause this.
New
volumes.update({"/dev/bus/usb": {"bind": "/dev/bus/usb", "mode": "rw"}})

vs what the Frigate addon specified before
    "/dev/bus/usb:/dev/bus/usb:rwm",

It's now missing the mknod permission on the docker bind for the usb bus.
According to the docker documentation the given mode is ignored when a container runs privileged (which it does when disabling protection mode in the HA supervisor).
Can it be that the Coral stick changes device id upon initialisation makes it to require this extra bit?
Eg the deconz addon still runs fine in protection mode while utilising its zigbee usb stick.
So this might need to be fixed/changed on the supervisor side. It's getting late and I'm getting tired so won't test my theory now. I wanted to create an issue in case someone else ran into the same problem. (okay still diving into it writing this issue but I want to help as I love the product!)
I'm using

HA core-2021.2.2
HA supervisor-2021.02.6
Frigate Hassio Addon 1.9
Running HassOS vmdk on Proxmox with USB passthrough for Coral

Protection mode enabled
 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.app                    INFO    : Camera processor started for garden: 34
frigate.app                    INFO    : Camera processor started for driveway: 35
frigate.app                    INFO    : Capture process started for garden: 36
detector.coral                 INFO    : Starting detection process: 32
frigate.app                    INFO    : Capture process started for driveway: 37
frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate.mqtt                   INFO    : MQTT connected
frigate.edgetpu                INFO    : No EdgeTPU detected.
Process detector:coral:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 152, in load_delegate
    delegate = Delegate(library, options)
  File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 111, in __init__
    raise ValueError(capture.message)
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/frigate/frigate/edgetpu.py", line 124, in run_detector
    object_detector = LocalObjectDetector(tf_device=tf_device, num_threads=num_threads)
  File "/opt/frigate/frigate/edgetpu.py", line 63, in __init__
    edge_tpu_delegate = load_delegate('libedgetpu.so.1.0', device_config)
  File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 154, in load_delegate
    raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from libedgetpu.so.1.0

Protection mode disabled
Disable Protection mode for the Frigate addon (don't change anything else) and restart addon.

 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.mqtt                   INFO    : MQTT connected
frigate.app                    INFO    : Camera processor started for garden: 36
frigate.app                    INFO    : Camera processor started for driveway: 37
frigate.app                    INFO    : Capture process started for garden: 39
frigate.app                    INFO    : Capture process started for driveway: 40
detector.coral                 INFO    : Starting detection process: 33
frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate.edgetpu                INFO    : TPU found

And everything works 👍

Thanks for helping track this down.

I was wrong about the mode.
This is actually the latest code that sets the bind mode for devices.
I did puzzle over lunch and found the solution, creating PR.


Check if Matrix Driver is Alive

Can I2C to check for the address bus

Was able to check address for matrix driver when using i2cdatect -- received slave address 0h74, as specified on the datasheet

@wecodewithmichaelmccloskey I reviewed in class. Looks good


Prevents parent process from exiting

Starting mongodb now prevents the parent process from exiting correctly. This is because it spawns a connected child process that contains a setInterval, so the event loop never empties.
Fix coming soon to a PR near you.

@hgcummings is this resolved at this point? if so, can you please close this ticket?

Yes, thank you, resolved since the release including the linked PR.


[QUESTION] How to use different middleware for different routes/path

First check

[x] I used the GitHub search to find a similar issue and didn't find it.
[x] I searched the FastAPI documentation, with the integrated search.
[x] I already searched in Google "How to X in FastAPI" and didn't find any information.

Description
Is it possible to use different middleware for different routes/path?
Additional context
In my case my need comes from CORS. But, I am sure there is other cases than CORS requirements that someone would need different middlewares for different paths.

I want myapi.com/path1 to allow origins of calls from myfrontend.com
I want myapi.com/path2 to allow origins of calls from anywhere ('*') since it is a public facing api.

I checked if it was possible to add a middleware at a router level and did not find any documentation about it.
Code example
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=['myfrontend.com'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# I want /path1 to allow only calls from 'myfrontend.com'
@app.get("/path1")
async def path1():
    return {"status": "alive"}

# I want /path2 to be a public facing api that can be accessed from anywhere ['*']
@app.get("/path2")
async def path2():
    return {"status": "alive"}

I haven't use this way, but you can have a try.
How about use subapp?
documention

Thank you @Dustyposa this looks exactly like what I was looking for.
Here is a example implementation in case someone else stumble upon the same problem
# app1.py

from fastapi import FastAPI

app1= FastAPI(openapi_prefix="/app1")

@app1.get("path1")
async def path1():
    return { "message": "app1"}

# app2.py

from fastapi import FastAPI

app2= FastAPI(openapi_prefix="/app2")

@app1.get("path2")
async def path2():
    return { "message": "app2"}

# main.py

from fastapi import FastAPI
from app1 import app1
from app2 import app2

app1.add_middleware(
    CORSMiddleware,
    allow_origins=['myfrontend.com'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# here we can add middlewares that are only for app2 and not executed on paths of app1
# the CORS policy is different for app2. (allows '*' instead of 'myfrontend.com')
app2.add_middleware(
    CORSMiddleware,
    allow_origins=['*'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app = FastAPI()

app.mount(app1, "/app1")
app.mount(app2, "/app2")

@app.get("/")
async def root():
    return {"message": "alive"}

Thanks for your help here @Dustyposa :bowing_man: :cake:
And thanks for reporting back and closing the issue @philippegirard :rocket:

This is a fine approach for some use cases.  But having route based middleware is still a requirement for many projects I work on.  I understand starlette itself cannot yet do this, so perhaps this is the wrong github page to bring it up.  I will see what Tom Cristie thinks about adding route based middleware to starlette.  Then perhaps fastapi can impliment it in the route decorators router.get('/path', middleware=['abc', 'xyz'] etc...

I'm facing a quite similar issue : I want to add custom 'Content-Security-Policy' header the easiest way to do so is to add a middleware :
@Api.middleware("http")
async def CSPMiddleware(request: Request, call_next):
response = await call_next(request)
response.headers[
    "Content-Security-Policy"
] = "default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline';"
return response

However this CSP block the Swagger UI and thus it would be great to only apply the middleware to a subset of routes.
nb1 : For those who are wondering, i removed the middleware and i had to add a response headers to all routes (ie functions) except for the swaggers (not very clean)
nb2: app.mount does not solve the problem because the swagger are not available for subapps

+1 for router and/or route level middleware

I opened https://github.com/encode/starlette/pull/1286 to see if we can upstream https://github.com/tiangolo/fastapi/issues/1174#issuecomment-905851468 into Starlette (and then get it for free in FastAPI)

https://github.com/encode/starlette/pull/1286 is implemented at the route level, so it should even be possible to do something like:
app = FastAPI()

@app.get("/", middleware=[...])

As well as the original request:
router = APIRouter(middleware=[...])

@router.get("/")

Even combining both (although we'd have to determine the order in which the sequence of middlewares is combined).

Thank you @Dustyposa this looks exactly like what I was looking for.
Here is a example implementation in case someone else stumble upon the same problem
# app1.py

from fastapi import FastAPI

app1 = FastAPI(openapi_prefix="/app1")

@app1.get("path1")
async def path1():
    return { "message": "app1"}

# app2.py

from fastapi import FastAPI

app2 = FastAPI(openapi_prefix="/app2")

@app1.get("path2")
async def path2():
    return { "message": "app2"}

# main.py

from fastapi import FastAPI
from app1 import app1
from app2 import app2

app1.add_middleware(
    CORSMiddleware,
    allow_origins=['myfrontend.com'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# here we can add middlewares that are only for app2 and not executed on paths of app1
# the CORS policy is different for app2. (allows '*' instead of 'myfrontend.com')
app2.add_middleware(
    CORSMiddleware,
    allow_origins=['*'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app = FastAPI()

app.mount("/app1", app1) # if does not work try: app.mount(app1, "/app1")
app.mount("/app1", app1) # if does not work try: app.mount(app2, "/app2")

@app.get("/")
async def root():
    return {"message": "alive"}

@philippegirard which middleware would execute first by default? Can we control the order of execution of the middlewares?

@abhaynayak24 I am not sure. In this example there's is only one middleware per route. Therefore, there exists no routes which executes two middleware in the request in this example.
Experiment to answer your question: Add two middleware to the same route with two different logs and check in the console which one executes first. You can report back on this issue the result of your experiment.
Thank :) !

It is not the cleanest thing in the world but it occurred to me to create a list with the paths that I want to go through the middleware, and within the middleware a routing condition
routes_with_middleware = [
    "/api/endpoint"
]

async def middleware(request: Request, call_next):
    if request.url.path not in routes_with_middleware:
        return await call_next(request)
   else:
        ....

In this way, if your middleware does validations, they do not block the other routes such as the api / docs for example

I haven't use this way, but you can have a try. How about use subapp? documention

Hi, the document has moved to a new link .
Thank you for the recommendation 😄

I feel like having to use sub apps is not the optimal choice, I would like to be able set in a route or path level which middlewares and their order should be running there. Is this still not possible in fastapi?

It won't be possible until https://github.com/encode/starlette/pull/1286 gets merged and FastAPI updates it's Starlette version. Or just copy the implementation in https://github.com/encode/starlette/pull/1286 to a custom subclass of FastAPI's APIRouter if you need it today.

Any news here?  I have a need for route specific middleware.

Also would love to see route level middleware.

The best way to push this forward would be to express your support in https://github.com/encode/starlette/pull/1464 via a 👍.
Maybe also consider donating or having your employer donate to https://github.com/encode/ so that maintainers can spend more time working on Starlette (to the benefit of all downstream projects, including FastAPI) and less time worrying about being a person in a world run by purchasing power.

A bit late to the party but,
Recently I wanted to have an authentication middleware on some of my FastAPI routers, just like you'd do in the Express.JS project.
Even though you can't define a middleware for a router, you can always have a router dependency, (instead of adding it on every individual route), And it very much works like any middleware.
Here's my StackOverflow answer to a similar question: https://stackoverflow.com/a/73233603/10123687
As for the CORS use case, it won't be possible to use the middlewares provided by Starlette, but you can easily write your own and add/modify the response headers.
something like this should work:
async def CORS(request: Request, response: Response):
    response.headers['Access-Control-Allow-Origin'] = 'http://localhost:8000'
    response.headers['Access-Control-Allow-Methods'] = 'OPTIONS,GET,POST'
    response.headers['Access-Control-Allow-Headers'] = 'Content-Type'

router = APIRouter(dependencies=[
    Depends(CORS)
])

# ... Your routes as usual
@router.get('/xyz')
# ...

@adriangb it seems like per-route middlewares would be unblocked as the latest pulls in starlette 0.25 which has your changes. Would a PR adding it to FastAPI be likely to get merged? Having separate routers sort of works but for some use cases where you need some route specific configuration in the middleware it gets very clunky.

I think that yes a PR to FastAPI would be accepted


Dozer is not open source

Dozer's github page only contains a demo folder containing a gif file. The page also states that it's not open source.

@ZetiX Thank you for highlighting this.

Full source is back on this one (https://github.com/Mortennn/Dozer)

@peppy Thanks! Will add it back 👍


Why not use Clearance routes?

the readme says:

As of Clearance 1.5 it is recommended that you disable Clearance routes and take full control over routing and URL design.

As a brand-new Clearance user, I don't know the downfalls of using the default routes. What's the reason?
I'll make a PR for the readme with more detail.
Thanks!

I believe the main reason behind that suggestion is so that if the gem's routes and URL design are changed, your website's URL design won't be affected when you update the gem.

gotcha!
okay, made a PR

The idea was that it would insulate you from clearance changes and also prevents us from having to have configuration options for "I want this route to exist, but not this other one" or "I want the route to this action to be different."
Will clarify further in the doc PR.


Fix classification for Metaflow

Metaflow was incorrectly classified as a workflow orchestrator rather than an ML framework previously.
Pre-submission checklist:
Please check each of these after submitting your pull request:

[x] Are you only including a repo_url if your project is 100% open source? If so, you need to pick the single best GitHub repository for your project, not a GitHub organization.
[x] Is your project closed source or, if it is open source, does your project have at least 250 GitHub stars?
[x] Have you picked the single best (existing) category for your project?
[x] Does it follow the other guidelines from the new entries section?
[x] Have you included a URL for your SVG or added it to hosted_logos and referenced it there?
[x] Does your logo clearly state the name of the project/product and follow the other logo guidelines?
[x] Does your project/product name match the text on the logo?
[x] Have you verified that the Crunchbase data for your organization is correct (including headquarters and LinkedIn)?
[x] ~10 minutes after opening the pull request, the CNCF-Bot will post the URL for your staging server. Have you confirmed that it looks good to you and then added a comment to the PR saying "LGTM"?

This article clarifies how Metaflow plays with workflows orchestrators like Airflow, AWS Step Functions etc.

LGTM

@ibrahimhaddad Can you please bless this PR?


How to change the height of Control View?

I want to make control view smaller, as I don't see why is has to be so high, bu I can't figure out how to do that.

Red square is what it is now
Green square is what I want it to be
Thank you

If anybody is interested, I found a way to do it.
First, I had to integrate the library with downloading and adding all source files to my project, instead of using Cocoa Pods, then in PixelEditViewController change line 293 to this:
controlContainerView.heightAnchor.constraint(equalToConstant: controlHeight)
where controlHeight  is the height you want to set


Added support for new backend system (Azure DevOps, DevTools, and Linguist)

Hey, I just made a Pull Request!
Added alpha support for the new backend system for the Azure DevOps, DevTools, and Linguist backend plugins 🚀
:heavy_check_mark: Checklist

[x] A changeset describing the change and affected packages. (more info)
[x] Added or updated documentation
[ ] Tests for new functionality and regression tests for bug fixes
[ ] Screenshots attached (for UI changes)
[x] All your commits have a Signed-off-by line in the message. (more info)

I've made all the requested changes, seeing as @freben is on vacation @benjdlambert this falls to you but I'm fine if this doesn't happen right away 👍

Nice thanks! :tada:

Thanks @benjdlambert 🚀


allowUnfreePredicate steam not working

Issue description
I want to just allow steam as unfree program, so i set:
  nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.name).name [ "steam" ]);

but i still get the error:
[root@X230:~]# nixos-rebuild switch
building Nix...
building the system configuration...
error: Package ‘steam’ in /nix/store/x2pp84mzmmg519p54pqvsiy3n5w5vjkr-nixos-18.09.2137.168cbb39691/nixos/pkgs/games/steam/steam.nix:31 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

Maybe i'm doing something wrong, but at least the error message is confusing. I also tried to allow steam-original with same result.
Steps to reproduce
  # required for steam https://nixos.wiki/wiki/Steam
  hardware.opengl.driSupport32Bit = true;
  hardware.pulseaudio.support32Bit = true;
  nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.name).name [ "steam" ]);

  # install packages
  environment.systemPackages = with pkgs; [
    steam
    steam-run
  ];

Technical details

system: "x86_64-linux"
host os: Linux 4.14.98, NixOS, 18.09.2137.168cbb39691 (Jellyfish)
multi-user?: yes
sandbox: yes
version: nix-env (Nix) 2.1.3
channels(davidak): ""
channels(root): "nixos-18.09.2137.168cbb39691, nixos-hardware, nixos-unstable-19.03pre169108.36f31600749"
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Could not fully reproduce on master.
{pkgs, config, ...}: {
# required for steam https://nixos.wiki/wiki/Steam
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.name).name [ "steam" ]);

# install packages
environment.systemPackages = with pkgs; [
        steam
        steam-run
];
}

nix-instantiate /home/repos/nixpkgs/nixos -A config.environment.systemPackages -I nixos-config=/tmp/a.nix

error: Package ‘steam-original-<IP_ADDRESS>’ in /home/repos/nixpkgs/pkgs/games/steam/steam.nix:33 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

(use '--show-trace' to show detailed location information)

And adding steam-original and steam-runtime indeed helps.

… and with hasPrefix it would be enough to just say steam-

I encountered this same issue (while installing lutris), and I came to the following solution. (Nixos 19.09)
nixpkgs.config.allowUnfreePredicate =
	let allowedUnfree = [
				"steam"
				"steam-original"
				"steam-runtime"
			];
	in with builtins;
		(pkg:
			(
				((elem "name" (attrNames pkg)) &&
				 (elem (parseDrvName pkg.name).name allowedUnfree))
				||
				((elem "pname" (attrNames pkg)) &&
				 (elem pkg.pname allowedUnfree))
			)
		);

It is my understanding that a name attribute should be created from a pname attribute, but referring to steam-original's name attribute did not solve the problem, and this did. Perhaps  steam-original's name attribute is formatted in an unexpected way. I'm not sure how to check.

It still don't work.
@7c6f434c with your example, i get this error where my nixpkgs is current stable at 6a99d5d6485bf29f948bef0127b1a2904e1d7589.
[davidak@gaming:~]$ nix-instantiate /home/davidak/code/nixpkgs/nixos/ -A config.environment.systemPackages -I nixos-config=/tmp/a.nix
error: attribute 'name' missing, at /tmp/a.nix:5:82
(use '--show-trace' to show detailed location information)

when i change pkg.name to pkg.pname:
[davidak@gaming:~]$ nix-instantiate /home/davidak/code/nixpkgs/nixos/ -A config.environment.systemPackages -I nixos-config=/tmp/a.nix
error: attribute 'pname' missing, at /tmp/a.nix:5:82

the documentation is different now, but that also don't work:
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "steam"
    "steam-original"
    "steam-runtime"
  ];

[root@gaming:/home/davidak]# nixos-rebuild switch
building Nix...
building the system configuration...
error: Package ‘steam’ in /nix/store/a5inn8qk5sa8dgc0zbb6llprcj4rw16a-nixos-20.03.2141.8b071be7512/nixos/pkgs/games/steam/steam.nix:34 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

(use '--show-trace' to show detailed location information)

but the same works with nix-instantiate:
[davidak@gaming:~]$ nix-instantiate /home/davidak/code/nixpkgs/nixos/ -A config.environment.systemPackages -I nixos-config=/tmp/a.nix
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/ln6a39335x7qwn2vqdx8zgadhil6jsvs-steam.drv
/nix/store/pmsygkivhy5agw9kz6r1nmbfizkdakfy-steam-run.drv
/nix/store/m7n94rpiswkn8z125rpi5ywm6b3qjcbw-nixos-container.drv

[davidak@gaming:~]$ cat /tmp/a.nix
{pkgs, lib,  config, ...}: {
# required for steam https://nixos.wiki/wiki/Steam
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
#nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.pname).name [ "steam" ]);
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "steam"
    "steam-original"
    "steam-runtime"
  ];

# install packages
environment.systemPackages = with pkgs; [
        steam
        steam-run
];
}

that's very strange...

Hm. Maybe different channels and different names? I guess I would trace the package and its getName in the allowUnfreePredicate in the non-working version.

still relevant

I have no ide why it is always hard to reproduce on unstable then.
{pkgs, config, ...}: {
# required for steam https://nixos.wiki/wiki/Steam
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
nixpkgs.config.allowUnfreePredicate = (pkg: let pkgname = (builtins.parseDrvName pkg.name or pkg.pname).name; in (pkgname == "steam" || pkgs.lib.hasPrefix "steam-" pkgname));

# install packages
environment.systemPackages = with pkgs; [
        steam
        steam-run
];
}

nix-instantiate /home/repos/nixpkgs/nixos -A config.environment.systemPackages -I nixos-config=$PWD/steam.nix

Somehow works for me just fine with a moderately out of date (a week or two?) unstable checkout.

@raboof and you should post what exactly you tested and what exact error messages you get, this at least creates a chance that someone eventually understands what is even going on…

I'm on nixos-unstable (e9158eca70ae59e73fae23be5d13d3fa0cfc78b4)
Adding steam to /etc/nixos/configuration.nix's environment.systemPackages correctly shows an error telling me to add steam to allowUnfreePredicate, then steam-original and steam-runtime. So far so good.
However, even after rebooting into that profile, nix-shell -p steam does not work:
error: Package ‘steam’ in /home/aengelen/nixpkgs/pkgs/games/steam/steam.nix:34 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

a) To temporarily allow unfree packages, you can use an environment variable
   for a single invocation of the nix tools.

     $ export NIXPKGS_ALLOW_UNFREE=1

b) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

Alternatively you can configure a predicate to whitelist specific packages:
  { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
      "steam"
    ];
  }

c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

(use '--show-trace' to show detailed location information)

(even though running steam works find outside of nix-shell).

I'm on nixos-unstable (e9158eca70ae59e73fae23be5d13d3fa0cfc78b4)
Adding steam to /etc/nixos/configuration.nix's environment.systemPackages correctly shows an error telling me to add steam to allowUnfreePredicate, then steam-original and steam-runtime. So far so good.
However, even after rebooting into that profile, nix-shell -p steam does not work:

nix-shell uses a different Nixpkgs config than system-wide NixOS configuration, so that's to be expected.
, # Fallback: The contents of the configuration file found at $NIXPKGS_CONFIG or
  # $HOME/.config/nixpkgs/config.nix.
  config ? let
      configFile = getEnv "NIXPKGS_CONFIG";
      configFile2 = homeDir + "/.config/nixpkgs/config.nix";
      configFile3 = homeDir + "/.nixpkgs/config.nix"; # obsolete
    in
      if configFile != "" && pathExists configFile then import configFile
      else if homeDir != "" && pathExists configFile2 then import configFile2
      else if homeDir != "" && pathExists configFile3 then import configFile3
      else {}

So you either need to use as Nixpkgs something that import Nixpkgs with your preferred config, or create a Nixpkgs config file either in the default location or in a location referenced via the environment variables.
With flakes it seemed to be a pain untill https://github.com/NixOS/nix/commit/dc4a280318650762a79447dbb299aef887f61d2e as far as I understand, not sure what is the current status of that commit, but I guess eventually it should end up inside some release.

nix-shell uses a different Nixpkgs config than system-wide NixOS configuration, so that's to be expected.

Ah, I misunderstood that then. Then AFAICS this is fixed: it works for me in configuration.nix with:
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "steam"
    "steam-original"
    "steam-runtime"
  ];

and in ~/.config/nixpkgs/config.nix with:
  allowUnfreePredicate = pkg: builtins.elem ((import <nixpkgs> {}).lib.getName pkg) [
    "steam"
    "steam-original"
    "steam-runtime"
  ];

I guess it's good to keep nix-shell as 'pure' as possible, though, so I'll just allow unfree packages selectively on the command-line or in my shell.nix.
Sorry about the noise ;)

@davidak Has consistent behaviour propagated to all the branches you still care about?

@7c6f434c i'm on nixos stable and can still reproduce the issue. is there a fix in unstable that can be backported?
my config.:
nixpkgs.config.allowUnfreePredicate = (pkg: let pkgname = (builtins.parseDrvName pkg.name or pkg.pname).name; in (pkgname == "steam" || pkgs.lib.hasPrefix "steam-" pkgname));
programs.steam.enable = true;
hardware.steam-hardware.enable = true;
error:
error: Package ‘steam’ in /nix/store/0kfg4wbw9zbqhljbmq559m5wqp22vqmx-nixos-20.09.2338.3d2d8f281a2/nixos/pkgs/games/steam/steam.nix:34 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

Michael Raskin<EMAIL_ADDRESS>hat am 21.12.2020 13:21 geschrieben:

@davidak https://github.com/davidak Has consistent behaviour propagated to all the branches you still care about?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/NixOS/nixpkgs/issues/55678#issuecomment-748946405 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAWH2KIZZM3CRBNETKO3ITSV44U5ANCNFSM4GXCJNOA .

@7c6f434c i'm on nixos stable and can still reproduce the issue. is there a fix in unstable that can be backported?

There is no fix, it always just worked for me whenever I tried to reproduce this…

my config.:
nixpkgs.config.allowUnfreePredicate = (pkg: let pkgname = (builtins.parseDrvName pkg.name or pkg.pname).name; in (pkgname == "steam" || pkgs.lib.hasPrefix "steam-" pkgname));
programs.steam.enable = true;
hardware.steam-hardware.enable = true;

Soooooo:
{pkgs, config, ...}: {

boot.isContainer = true;

nixpkgs.config.allowUnfreePredicate = (pkg: let pkgname = (builtins.parseDrvName pkg.name or pkg.pname).name; in (pkgname == "steam" || pkgs.lib.hasPrefix "steam-" pkgname));

programs.steam.enable = true;
hardware.steam-hardware.enable = true;

}

nix-instantiate /home/repos/nixpkgs-whatever/nixos -I nixos-config=/tmp/steam-davidak.nix

/nix/store/inyq2x16fb1d7gyljp1kh6gwk4v230hf-nixos-system-nixos-20.09pre-git.drv
/nix/store/drnanhn71dc5is2p9cpflhfcr3p3j9ni-nixos-vm.drv
/nix/store/d2gb9sb0qr0lsw1hx4d05m5k63hzqbvd-nixos-vm.drv

release-20.03 lacks programs.steam, master evaluates fine and of course reports 21.03pre, I have no idea how to valuate from a checkout to get non-pre version ticker.
release-20.09, nixos-20.09-small, nixos-20.09 — they all just work.
Maybe try the same kind of evaluation from under a fresh user account?

{ config, lib, pkgs, ... }:

{
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "steam"
    "steam-original"
    "steam-runtime"
  ];

  programs.steam.enable = true;
  hardware.steam-hardware.enable = true;
}

(this is less code and easier to understand for me)
[davidak@gaming:~]$ nix-instantiate ~/code/nixpkgs/ -I nixos-config=/tmp/steam-davidak.nix
error: Please be informed that this pseudo-package is not the only part of
Nixpkgs that fails to evaluate. You should not evaluate entire Nixpkgs
without some special measures to handle failing packages, like those taken
by Hydra.

[davidak@gaming:~]$ nix-instantiate '<nixos-unstable>' -I nixos-config=/tmp/steam-davidak.nix
error: Please be informed that this pseudo-package is not the only part of
Nixpkgs that fails to evaluate. You should not evaluate entire Nixpkgs
without some special measures to handle failing packages, like those taken
by Hydra.

I always get this error. ~/code/nixpkgs/ is on master.

Nixpkgs that fails to evaluate. You should not evaluate entire Nixpkgs
without some special measures to handle failing packages, like those taken

Erm, you are evaluating Nixpkgs and not nixpkgs/nixos here.

Right, i didn't read carefully enough.
I found the issue. There was allowUnfreePredicate in a second file. When i remove the lines (not needed anymore), the error disappears.
https://github.com/davidak/nixos-config/blob/974fb2df09410ff025f815d77e0c1f8af675fb07/profiles/personal.nix#L14-L20
So this issue is resolved for me.


Publish revisions with GitHub Actions fails from the portal

The snippet below worked fine with CLI to create a revision :
az containerapp github-action add \
  --repo-url "$git_url" \
  --docker-file-path "./Dockerfile" \
  --branch $git_branch \
  --name $appName \
  --resource-group $rg_name \
  --registry-url $acr_registry_url \
  --service-principal-client-id $sp_id \
  --service-principal-client-secret $sp_password \
  --service-principal-tenant-id  $tenantId \
  --token $git_pat

But it fails in the Azure portal, I mean I can successfully see the Continuous deployment configured in the Container App but when I push an update on the github repo, the deploy Job fails with
az containerapp update -n app-poc -g rg-az-translator -i ***.azurecr.io/app-poc:0704b067f1faf2a941e9e7a7d0e0249f90b741cd --registry-login-server ***.azurecr.io --registry-username  *** --registry*** --debug

DEBUG: msrest.http_logger: {"error":{"code":"AuthorizationFailed","message":"The client '1ef5175a-3774-4ea6-a108-7d84aca9c825' with object id '1ef5175a-3774-4ea6-a108-7d84aca9c825' does not have authorization to perform action 'Microsoft.Web/containerApps/read' over scope '/subscriptions/***/resourceGroups/rg-az-translator/providers/Microsoft.Web/containerApps/app-poc' or the scope is invalid. If access was recently granted, please refresh your credentials."}

DEBUG: msrest.exceptions: (AuthorizationFailed) The client '1ef5175a-3774-4ea6-a108-7d84aca9c825' with object id '1ef5175a-3774-4ea6-a108-7d84aca9c825' does not have authorization to perform action 'Microsoft.Web/containerApps/read' over scope '/subscriptions/***/resourceGroups/rg-az-translator/providers/Microsoft.Web/containerApps/app-poc' or the scope is invalid. If access was recently granted, please refresh your credentials.

Indeed because the Service Principal I did create was limited to the scope below whereas the error message shows that it looks for a scope in another RG "rg-az-translator" :
appName="azconapps"
location=northeurope
rg_name="rg-${appName}-${location}"

sp_password=$(az ad sp create-for-rbac --sdk-auth --name $appName --role contributor --scopes /subscriptions/$subId/resourceGroups/$rg_name --query password --output tsv)

From the Azure portal the GUI does not ask for --resource-group $rg_name, --token $git_pat neither

my bad, the RG name was not set correctly during the Environment creation, issue fixed now.
Closing this issue


Protocol::setUseCompleteQuit PHPDoc minor fix

dev-master already use php:^7.1 as requirement, so probably it is better to change all codebase with type hinting

@samsonasik adding typehints will be BC break, so we can do it only for next major release.

Thanks, @Slamdunk.


Simulator Error Transforming Odometry

Hello,
One of the students on my team for F1TENTH is trying to use the docker agent to test out our code. However, when we start the simulator, we keep getting this error:
Error transforming odometry 'Odometry' from frame '/map' to 'map'

We've tried completely rebuilding the containers for the F1TENTH Docker agent, as well as running it on other computers and so far we cannot figure out the issue. When we just run the simulator container, the error still shows up, so we think it is an issue with the simulator but cannot figure out how to fix it.

It seems like a recent problem in rviz. See relevant issue here https://github.com/laboshinl/loam_velodyne/issues/157.

We tried the suggested solution and the visualization still gives us the same issue.


Disable AWS DynamoDB e2e tests properly

Signed-off-by: Zbynek Roubalik<EMAIL_ADDRESS>
the previous attempt didn't work, we need to enable this test once we have AWS Accoutn ready as requested in https://github.com/kedacore/keda/issues/2803
Checklist

[x] Commits are signed with Developer Certificate of Origin (DCO - learn more)

/run-e2e

Hmm seems like it is doing the exact opposite, it started only aws-dynamodb tests 😄 Need to double check that script, but it looks good on a fast check.

/run-e2e


Build boost:x86-windows failed

Package: boost:x86-windows
Vcpkg version: 0.0.81-unknownhash
CMake Error at scripts/cmake/vcpkg_execute_required_process_repeat.cmake:21 (message):
    Command failed: C:/ccai-dev/other/vcpkg/buildtrees/boost/src/boost_1_64_0/b2.exe;--stagedir=C:/ccai-dev/other/vcpkg/buildtrees/boost/x86-windows-rel/stage;--build-dir=C:/ccai-dev/other/vcpkg/buildtrees/boost/x86-windows-rel;-sZLIB_INCLUDE="C:/cca
i-dev/other/vcpkg/installed/x86-windows\include";-sBZIP2_INCLUDE="C:/ccai-dev/other/vcpkg/installed/x86-windows\include";-j16;--debug-configuration;--hash;-q;--without-python;threading=multi;runtime-link=shared;link=shared;toolset=msvc-14.1;-sZLIB_BI
NARY=zlib;-sZLIB_LIBPATH="C:/ccai-dev/other/vcpkg/installed/x86-windows\lib";-sBZIP2_BINARY=bz2;-sBZIP2_LIBPATH="C:/ccai-dev/other/vcpkg/installed/x86-windows\lib";variant=release;debug-symbols=on
    Working Directory: C:/ccai-dev/other/vcpkg/buildtrees/boost/src/boost_1_64_0
    See logs for more information:
      C:\ccai-dev\other\vcpkg\buildtrees\boost\build-x86-windows-rel-out.log
      C:\ccai-dev\other\vcpkg\buildtrees\boost\build-x86-windows-rel-err.log

Call Stack (most recent call first):
  ports/boost/portfile.cmake:188 (vcpkg_execute_required_process_repeat)
  scripts/ports.cmake:73 (include)

From build-x86-windows-rel-out-0.log:
mt : general error c101008d: Failed to write the updated manifest to the resource of file "C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.exe". The operation failed.

        if exist "C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.exe.manifest" (
            call "echo" x86 >nul
mt -nologo -manifest "C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.exe.manifest" "-outputresource:C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.exe;1"
        )

...failed msvc.manifest C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.exe C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.pdb...
...removing C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.exe
...removing C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c\cxx11_auto_declarations.pdb
...skipped <pC:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c>cxx11_auto_declarations.passed for lack of <pC:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\config\checks\0c2fcf4f2e879acbf54fb50eaffc182c>cxx11_auto_declarations.exe...
...failed updating 2 targets...

From build-x86-windows-rel-out-2.log
mt : general error c101008d: Failed to write the updated manifest to the resource of file "C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.dll". The operation failed.

        if exist "C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.dll.manifest" (
            call "echo" x86 >nul
mt -nologo -manifest "C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.dll.manifest" "-outputresource:C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.dll;2"
        )

...failed msvc.manifest.dll C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.dll C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.lib C:\ccai-dev\other\vcpkg\buildtrees\boost\x86-windows-rel\boost\bin.v2\libs\type_erasure\build\8119a5daf2534cadb146838cc915eb69\boost_type_erasure-vc141-mt-1_64.pdb...

build-x86-windows-rel-err-0.txt
build-x86-windows-rel-err-1.txt
build-x86-windows-rel-err-2.txt
build-x86-windows-rel-out-0.txt
build-x86-windows-rel-out-1.txt
build-x86-windows-rel-out-2.txt

Thanks for reporting this issue!
Looking online [1], it seems that third party antivirus software is often the cause of this problem. Could you try temporarily disabling your antivirus on the vcpkg folder and see if that fixes the issue?
[1] https://stackoverflow.com/questions/3775406/mt-exe-general-error-c101008d-failed-to-write-the-updated-manifest-to-the-res

Boost:x86-windows is failing for me too:
PS C:\GitHub\Microsoft\vcpkg> vcpkg install uWebsockets
The following packages will be built and installed:
  * boost:x86-windows
    uwebsockets:x86-windows
Additional packages (*) will be installed to complete this operation.
Building package boost:x86-windows...
-- CURRENT_INSTALLED_DIR=C:/GitHub/Microsoft/vcpkg/installed/x86-windows
-- DOWNLOADS=C:/GitHub/Microsoft/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=C:/GitHub/Microsoft/vcpkg/packages/boost_x86-windows
-- CURRENT_BUILDTREES_DIR=C:/GitHub/Microsoft/vcpkg/buildtrees/boost
-- CURRENT_PORT_DIR=C:/GitHub/Microsoft/vcpkg/ports/boost/.
-- Using cached C:/GitHub/Microsoft/vcpkg/downloads/boost_1_64_0.tar.bz2
-- Testing integrity of cached file...
-- Testing integrity of cached file... OK
-- Extracting source C:/GitHub/Microsoft/vcpkg/downloads/boost_1_64_0.tar.bz2
-- Extracting done
-- Using cached C:/GitHub/Microsoft/vcpkg/downloads/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff
-- Testing integrity of cached file...
-- Testing integrity of cached file... OK
-- Applying patch C:/GitHub/Microsoft/vcpkg/buildtrees/boost/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed
-- Applying patch C:/GitHub/Microsoft/vcpkg/buildtrees/boost/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed done
-- Bootstrapping
-- Bootstrapping done
-- Building x86-windows-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process_repeat.cmake:21 (message):
    Command failed: C:/GitHub/Microsoft/vcpkg/buildtrees/boost/src/boost_1_64_0/b2.exe;--stagedir=C:/GitHub/Microsoft/vcpkg/buildtrees/boost/x86-windows-rel/stage;--build-dir=C:/GitHub/Microsoft/vcpkg/buildtrees/boost/x86-windows-rel;-sZLIB_INCLUDE="C:/GitHub/Microsoft/vcpkg/installed/x86-windows\include";-sBZIP2_INCLUDE="C:/GitHub/Microsoft/vcpkg/installed/x86-windows\include";-j8;--debug-configuration;--hash;-q;--without-python;threading=multi;runtime-link=shared;link=shared;toolset=msvc-14.0;-sZLIB_BINARY=zlib;-sZLIB_LIBPATH="C:/GitHub/Microsoft/vcpkg/installed/x86-windows\lib";-sBZIP2_BINARY=bz2;-sBZIP2_LIBPATH="C:/GitHub/Microsoft/vcpkg/installed/x86-windows\lib";variant=release;debug-symbols=on
    Working Directory: C:/GitHub/Microsoft/vcpkg/buildtrees/boost/src/boost_1_64_0
    See logs for more information:
      C:\GitHub\Microsoft\vcpkg\buildtrees\boost\build-x86-windows-rel-out.log
      C:\GitHub\Microsoft\vcpkg\buildtrees\boost\build-x86-windows-rel-err.log

Call Stack (most recent call first):
  ports/boost/portfile.cmake:188 (vcpkg_execute_required_process_repeat)
  scripts/ports.cmake:73 (include)

Error: Building package boost:x86-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: boost:x86-windows
  Vcpkg version: 0.0.81-e95a0986962405ab5b6e2da149462f04f199b2c8

Additionally, attach any relevant sections from the log files above.

In my case, the log files listed above are empty. Let me know if I can provide any additional information.

Thanks for posting this. Could you attach your configure-x86-windows-rel logs?
One common cause of Boost build problems is due to the user having a site-config.jam. We still don't know how to solidly fix that issue :(.

It appears this is relevant to machine. I build the boost on windows8 and it is fine.
However It is failed on my windows 7 machine.  I do not think this is related to the anti-virus as I tried to exclude my folder from the virus scanner.

Also I noticed sometimes, rel build is done and failed on dbg build.
mt : general error c101008d: Failed to write the updated manifest to the resource of file "C:\vcpkg\buildtrees\boost\x86-windows-dbg\boost\bin.v2\libs\test\build\0c2fcf4f2e879acbf54fb50eaffc182c\boost_unit_test_framework-vc141-mt-gd-1_64.dll". The operation failed.
    if exist "C:\vcpkg\buildtrees\boost\x86-windows-dbg\boost\bin.v2\libs\test\build\0c2fcf4f2e879acbf54fb50eaffc182c\boost_unit_test_framework-vc141-mt-gd-1_64.dll.manifest" (
        call "echo" x86 >nul

mt -nologo -manifest "C:\vcpkg\buildtrees\boost\x86-windows-dbg\boost\bin.v2\libs\test\build\0c2fcf4f2e879acbf54fb50eaffc182c\boost_unit_test_framework-vc141-mt-gd-1_64.dll.manifest" "-outputresource:C:\vcpkg\buildtrees\boost\x86-windows-dbg\boost\bin.v2\libs\test\build\0c2fcf4f2e879acbf54fb50eaffc182c\boost_unit_test_framework-vc141-mt-gd-1_64.dll;2"
)

build-x86-windows-dbg-err-2.txt
build-x86-windows-dbg-out-1.txt
build-x86-windows-dbg-out-0.txt

I have the same issue
Building package boost:x64-windows...
-- CURRENT_INSTALLED_DIR=C:/builds/vcpkg/installed/x64-windows
-- DOWNLOADS=C:/builds/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=C:/builds/vcpkg/packages/boost_x64-windows
-- CURRENT_BUILDTREES_DIR=C:/builds/vcpkg/buildtrees/boost
-- CURRENT_PORT_DIR=C:/builds/vcpkg/ports/boost/.
-- Downloading https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2...
-- Downloading https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2... OK
-- Testing integrity of downloaded file...
-- Testing integrity of downloaded file... OK
-- Extracting source C:/builds/vcpkg/downloads/boost_1_64_0.tar.bz2
-- Extracting done
-- Downloading https://github.com/boostorg/range/commit/e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff...
-- Downloading https://github.com/boostorg/range/commit/e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff... OK
-- Testing integrity of downloaded file...
-- Testing integrity of downloaded file... OK
-- Applying patch C:/builds/vcpkg/buildtrees/boost/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e9
3b17157fdb6a2.diff.fixed
-- Applying patch C:/builds/vcpkg/buildtrees/boost/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e9
3b17157fdb6a2.diff.fixed done
-- Bootstrapping
-- Bootstrapping done
-- Building x64-windows-rel
-- Building x64-windows-rel done
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process_repeat.cmake:21 (message):
    Command failed: C:/builds/vcpkg/buildtrees/boost/src/boost_1_64_0/b2.exe;--stagedir=C:/builds/vcpkg/buildtrees/boost
/x64-windows-dbg/stage;--build-dir=C:/builds/vcpkg/buildtrees/boost/x64-windows-dbg;-sZLIB_INCLUDE="C:/builds/vcpkg/inst
alled/x64-windows\include";-sBZIP2_INCLUDE="C:/builds/vcpkg/installed/x64-windows\include";-j2;--debug-configuration;--h
ash;-q;--without-python;threading=multi;runtime-link=shared;link=shared;address-model=64;toolset=msvc-14.1;-sZLIB_BINARY
=zlibd;-sZLIB_LIBPATH="C:/builds/vcpkg/installed/x64-windows\debug\lib";-sBZIP2_BINARY=bz2d;-sBZIP2_LIBPATH="C:/builds/v
cpkg/installed/x64-windows\debug\lib";variant=debug
    Working Directory: C:/builds/vcpkg/buildtrees/boost/src/boost_1_64_0
    See logs for more information:
      C:\builds\vcpkg\buildtrees\boost\build-x64-windows-dbg-out.log
      C:\builds\vcpkg\buildtrees\boost\build-x64-windows-dbg-err.log

Call Stack (most recent call first):
  ports/boost/portfile.cmake:202 (vcpkg_execute_required_process_repeat)
  scripts/ports.cmake:73 (include)

Error: Building package boost:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: boost:x64-windows
  Vcpkg version: 0.0.81-3ebcdd384b58ff5d5f92996a6eb2e9fed0be1710

build-x64-windows-dbg-err-0.txt
build-x64-windows-dbg-err-1.txt
build-x64-windows-dbg-err-2.txt
build-x64-windows-dbg-out-0.txt
build-x64-windows-dbg-out-1.txt
build-x64-windows-dbg-out-2.txt

Hi @zhiweicai , thanks for post this issue!
Boost built successfully in the latest version(v1.69.0), could you update vcpkg and try again?
Thx.

Please open a new issue if this is still a problem for you.
Thx.


Make EntityManager Clone

Since the EntityRepository is Clone, you could remove the Arc around the EntityManager and instead make it Clone as well, since the DocHandle is Clone.
Besides removing the arc, if you were ever to start using DocHandle.changed somewhere, you would get what I think is a more intuitive kind of result than if you were to use the same refcounted doc handle everywhere: with the current setup it could lead to some updates apparently not propagating(because each doc handle keeps track of the latest state it has seen, and the arc would make this a single global thing as opposed to a local thing, see this note).

Thank you for your suggestion. I've pondered this some, but I think the current shared EntityManager is correct. The only way to get a DocHandle from the EntityManager is the doc method, where we're already cloning.
It'd in fact be problematic to have more than one EntityManager for the same document as it wouldn't be much of a manager at all. Currently the only shared state is the DocHandle, but I think that could change.
In the case of EntityRepository it's probably fine as it's just a way to query the document (so long as transactions are fully consistent between clones of DocHandles, I think?)

It'd in fact be problematic to have more than one EntityManager for the same document as it wouldn't be much of a manager at all.

Right, but that's not something that is inherently guaranteed by the current use of the Arc, since the DocHandle itself is clonable(so one could create multiple EntityManager to the same doc, each with a clone of the doc handle), which is why I think you may as well remove it.
Why does the  EntityRepository need to be Clone?

transactions are fully consistent between clones of DocHandle

Yes they are, it's only the use of changed on multiple Arc<DocHandle> that could turn out confusing, so at this point it's only a hypothetical problem.

since the DocHandle itself is clonable(so one could create multiple EntityManager to the same doc, each with a clone of the doc handle)

Sure, but at that point the user is actively choosing to create a new EntityManager (no ambiguity like in the case of Clone), so they should already know each EntityManager is independent. And the changed problem does not arise as they're cloned DocHandles.

Why does the EntityRepository need to be Clone?

IIRC it doesn't need to be, and I'm okay with removing it to allow for a possible future where DefaultEntityRepository might need to hold some shared state that doesn't have an obvious Clone semantics.

Ok, I think it would be clearer to remove the Clone on the repository, and then also remove the arc around the entity manager.

remove the arc around the entity manager

That's the thing. The EntityManager is supposed to be shared. If we remove the Arc the user would be forced to create new EntityManagers, which is exactly what we don't want to happen.

I think I don't completely understand the API you are sketching.
To be clear on my side:

Sharing DocHandle, indirectly via a shared EntityManager, is ok but could lead to unexpected behavior if you ever start using the changed method, because the idea is that each clone of a DocHandle keeps it's own state with regards to whether the doc has changed since the doc handle last used it. So if you use an Arc<DocHandle>, and clone it in different threads, one thread may not wake-up on changed if the other thread already saw the last change.
So if you expose changed via the API of the EntityManager, and then shared it in an arc, it could be confusing.

Besides the above, which in some ways does not matter for the current use, it appears strange to me that an non-clonable EntityManager is used to wrapped a clonable DocHandle.

The point of the DocHandle is to make it easy for users to share the same automerge document across threads. So the DocHandle is Clone because cloning it is an easy way to use it in different places. And each clone keeps it's own state with regards to the last version of the document seen, so that changed works as expected from the point of view of one thread/task. So the underlying document is shared, but not the state pertaining to changed.
So, even though you are not using changed, it might still be a good ok to keep the use of the DocHandle "consistent" with what I describe above. And putting it inside an Arc<EntityManager> is similar to using an Arc<DocHandle>.
So that's it on my side :)
Now, with regards to what you are trying to do:

The EntityManager is supposed to be shared. If we remove the Arc the user would be forced to create new EntityManagers, which is exactly what we don't want to happen.

Why is it supposed to be shared?
Looking at the example, it seems you hand it over to the repository, and then transact on it, and then expect the repository to find the book transacted. If you were to transact in another task or thread, the expectation would break down(unless you used something like changed to synchronize).
So to me it appears that, similar to a DocHandle, you want the underlying document to be shared, not necessarily the thing wrapping it.

Currently the only shared state is the DocHandle, but I think that could change.

You can later add arcs to other shared state internally, as opposed to putting the thing itself in an arc.

It'd in fact be problematic to have more than one EntityManager for the same document as it wouldn't be much of a manager at all.

Please explain more about what you want it to achieve as a "manager".

Thanks for your patience in trying to explain all this to me. I'm pretty sure I must have been missing something.
Anyway, I'll have to take a long hard look at the code and get back to you.

Earlier you said:

it's only the use of changed on multiple Arc<DocHandle> that could turn out confusing, so at this point it's only a hypothetical problem.

But now you also said:

If you were to transact in another task or thread, the expectation would break down(unless you used something like changed to synchronize).

Does using multiple cloned DocHandles (not Arc<DocHandle> - as far as I can tell we never use that anywhere) lead to out-of-sync views when updating / querying the document from different threads / tasks?

If I understand the code in https://github.com/automerge/automerge-repo-rs/blob/847d0ff53ace756599eaf5380740b9c2ab356b1b/src/dochandle.rs correctly, last_heads is only relevant when using changed, so it's not relevant for our use case. And even if someone calls changed on the DocHandle we return from EntityManager::doc, that's already cloned. It will be the caller's conscious decision if they do decide to put it behind a shared pointer.
So I'm not really sure what's the problem...

Does using multiple cloned DocHandles (not Arc - as far as I can tell we never use that anywhere) lead to out-of-sync views when updating / querying the document from different threads / tasks?

Using cloned DocHandles would be correct, and it's using Arc<DocHandle> that could lead to unexpected behavior.

Arc - as far as I can tell we never use that anywhere

An Arc<EntityManager> that internally owns a DocHandle is similar, if you were to internally use changed on the handle.

So I'm not really sure what's the problem

At this point it's not a problem yet, but it may become a problem later, for example if you do anything with changed inside the entity manager. The problem at this point is rather one of design I would say. Putting the doc handle inside the Arc<EntityManager> goes against how I would use the doc handle, which is supposed to be owned by a given thread/task.

Is it correct to say that DocHandle should be !Sync then?

Is it correct to say that DocHandle should be !Sync then?

That pretty much sums it up :)


Boot with Tow-Boot

As I know, it is currently not possible to boot GloDroid using Tow-Boot..
Why could that be the case? What could be potential hurdles? How could successful boot be achieved?
Thanks for providing a Pinehone Pro and builds of Glodroid!

Please follow this issue for more information


pass raw request args to handshake

Summary
What

This PR makes a change to pass raw request args to our signer selection and handshake methods
Why
To enable smart wallet onboarding optimization through the passing of request params

How did you test your changes?
Locally
Unit Tests

🟡 Heimdall Review Status

Requirement
Status
More Info

Reviews

🟡
0/1

Denominator calculation

Show calculation

1 if user is bot
0

1 if user is external
0

From .codeflow.yml

1

Additional review requirements

Show calculation

Max
0

0

From CODEOWNERS

0

Global minimum
0

Max

1

1

1 if commit is unverified
0

Sum
1