Bug: parameters confusing is combining get_parameter and get_parameters results

Expected Behaviour
Given SSM parameters:

/foo/bar/param1
/foo/bar/param2
/foo/bar/param3

Calling parameters.get_parameters("/foo/bar") should return a dictionary of all 3 parameters.
Calling parameters.get_parameter("/foo/bar") should ALWAYS raise a GetParameterError. This error should be raised even if the get_parameter call comes after the get_parameters call.
Current Behaviour
Given the same parameters as above:
If I call parameters.get_parameters("/foo/bar") all 3 parameters are cached under the parameter /foo/bar and returned as a dictionary.
If I subsequently call parameters.get_parameter("/foo/bar") it returns the same dictionary as the get_parameters call instead of raising the GetParameterError.
Code snippet
# Update paths below to PATH of actual SSM parameters in your account and not parameter NAMES.

from aws_lambda_powertools.utilities import parameters

print(parameters.get_parameters(path="/foo/bar"))
print(parameters.get_parameter("/foo/bar"))

Possible Solution

Cache get_parameter results separately from get_parameters results.
Note in the cache whether the values being cached are from get_parameter or get_parameters.

Steps to Reproduce

Add multiple SSM parameters to parameter store under the same path.
Run Code Snippet above referencing the SSM parameters' path.

Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.9
Packaging format used
Lambda Layers
Debugging logs
No response

Looking at this now

I have a couple of ideas, and will follow up tomorrow morning

@beck3905 I'm looking at this again, and I'm wondering what's the use case that requires you to use both get_parameters and get_parameter with the same key. Can you expand a little on what are you trying to achieve? I need to understand the problem a little bit better in order to help the best way possible :)

@beck3905 I'm looking at this again, and I'm wondering what's the use case that requires you to use both get_parameters and get_parameter with the same key. Can you expand a little on what are you trying to achieve? I need to understand the problem a little bit better in order to help the best way possible :)

@rubenfonseca I have a config class in my code that reads all my parameters from SSM on load and adds them as attributes of my config class. The code that loads the SSM parameters reads both individual parameters by name or multiple parameters by path. It does this by wrapping the get_parameter call in a try/except and then in the except block calling get_parameters.
For example, let's say I have an SSM path of /dev/auth and I have SSM parameters /dev/auth/client-id and /dev/auth/client-secret. The config class would look up all parameters under /dev/auth by first attempting to get_parameter("/dev/auth"). This would raise an exception and then the config class would call get_parameters("/dev/auth"). Once it receives the parameters it loops through them and adds them as attributes of the class so that I can call config.auth_client_id and config.auth_client_secret.
I ran into this issue because multiple modules will load the config class and get different values. So the first module to load the config class will go through the process above and get the correct parameter values to use locally. However, the second module to load the config class will call get_parameter("/dev/auth") and get the dictionary {"client-id": ..., "client-secret": ...}instead of raising an exception. Then the individual parameters under/dev/auth` do not get added correctly as attributed to my config class in that second module.

Hi @beck3905! Thanks for explaining in detail your use case and what we can to help you.
We agree that we should split caching between single fetch and multi fetch to avoid errors like this one. Do you have the bandwidth to send a PR fixing this? It would be awesome to have your code contribution to the Powertools project.

Checking in to confirm whether there's been any updates.

Confirmed with @leandrodamascena that we were waiting for another contributor who signaled wanted to pick this one up as a learning exercise.
It's a bug and we should fix it soon. If we don't hear from this contributor who wants to tackle it by EOD, I'll re-assign it and start working on this for the next release.
Apologies for the delay, we got our wires crossed when prioritizing it (bug not bug?)

Hello everyone! @paritosh16 will start working on this!

Maintainer took over and we're releasing this fix today. Apologies on the coordination issue we had; we normally fix a bug within the same day, this was an exception.
We've fixed our process issue to prevent bug fixes being dependent on non-maintainers.
Thank you for the patience.


Changed report and removed /results/qc

Just an idea of formatting changes for the output.md to make it look more like other nf-core pipelines while improving navigation

We felt the /qc dir in the results was redundant because the contents of that dir were just the qc_lines from our process that gets made into the final qc report which can be found in results/stats

I like the doc changes. Agree with the removal of the qc dir.

@sateeshperi Tagging you here, I think you wanted to start a dev branch to merge changes into between releases.

yes, we have a dev branch now. closing this in favor of #36


examples/skipdraw: wrong rendering result with SetScreenClearedEveryFrame(false)

Ebitengine Version
Both v2.6.7 and v2.7.0
Operating System

[ ] Windows
[ ] macOS
[X] Linux
[ ] FreeBSD
[ ] OpenBSD
[ ] Android
[ ] iOS
[ ] Nintendo Switch
[ ] PlayStation 5
[ ] Xbox
[ ] Web Browsers

Go Version (go version)
go version go1.22.0 linux/arm64
What steps will reproduce the problem?
Run github.com/crgimenes/neko commit: eb5fed9b4f321d7914da25d03e88c0710d423c02
What is the expected result?
The rendering result is correct
https://github.com/hajimehoshi/ebiten/assets/16950/1ad4c010-fbd3-4140-bf59-6d98460f6809
What happens instead?
The rendering result is not correct
Anything else you feel useful to add?
This issue is forked from #2951
After removing SetScreenClearedEveryFrame(false) and fixing the code to always render the sprite, the issue was fixed.

This could be reproduced with examples/skipdraw.

This doesn't seem a fixable issue as vsync doesn't work in my environment
       _,met$$$$$gg.          parallels@debian-gnu-linux-12
    ,g$$$$$$$$$$$$$$$P.       -----------------------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 12 (bookworm) aarch64
 ,$$P'              `$$$.     Host: Parallels ARM Virtual Machine 0.1
',$$P       ,ggs.     `$$b:   Kernel: 6.1.0-9-arm64
`d$$'     ,$P"'   .    $$$    Uptime: 5 hours, 6 mins
 $$P      d$'     ,    $$P    Packages: 1905 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.15
 $$;      Y$b._   _,d$P'      Resolution: 1800x1126
 Y$$.    `.`"Y$$$$P"'         DE: Cinnamon 5.6.8
 `$$b      "-.__              WM: Mutter (Muffin)
  `Y$$                        WM Theme: cinnamon (Default)
   `Y$$.                      Theme: Adwaita [GTK2/3]
     `$$b.                    Icons: gnome [GTK2/3]
       `Y$$b.                 Terminal: gnome-terminal
          `"Y$b._             CPU: (2)
              `"""            GPU: 00:0a.0 Red Hat, Inc. Virtio 1.0 GPU
                              Memory: 1081MiB / 1978MiB

@hajimehoshi If you send me the example skipdraw code, I can test it on my machine. Idk if that would help in any way.

Thanks. I need to test this with a proper Linux machine rather than a Parallels VM first.

On ChromeOS's Debian, the first frame blinked. This might be related but is another issue.

I failed to reproduce this on ChromeOS's Linux. My guess is that there is an issue in OpenGL driver for Parallels...

This hack fixes the issue (a patch to b9dce05ca1b490a643b949e794231dab46f6c17e)
diff --git a/internal/ui/context.go b/internal/ui/context.go
index 8c4795886..064a07bf5 100644
--- a/internal/ui/context.go
+++ b/internal/ui/context.go
@@ -15,6 +15,7 @@
 package ui

 import (
+       "image"
        "math"
        "time"

@@ -197,19 +198,24 @@ func (c *context) drawGame(graphicsDriver graphicsdriver.Graphics, ui *UserInter
        // isOffscreenModified is updated when an offscreen's modifyCallback.
        c.isOffscreenModified = false

+       const maxSkipCount = 4
+
        // Even though updateCount == 0, the offscreen is cleared and Draw is called.
        // Draw should not update the game state and then the screen should not be updated without Update, but
        // users might want to process something at Draw with the time intervals of FPS.
        if ui.IsScreenClearedEveryFrame() {
                c.offscreen.clear()
+       } else {
+               if c.skipCount < maxSkipCount {
+                       pixels := make([]byte, 4)
+                       c.offscreen.ReadPixels(pixels, image.Rect(0, 0, 1, 1))
+               }
        }

        if err := c.game.DrawOffscreen(); err != nil {
                return false, err
        }

-       const maxSkipCount = 4
-
        if !forceDraw && !c.isOffscreenModified {
                if c.skipCount < maxSkipCount {
                        c.skipCount++

My current understanding is that there is an issue in the graphics driver in Linux Parallels. Vsync doesn't work. Just adding a small wait fixed the issue.

As this is a driver issue, I'll close this as 'won't fix'.


Implement podman support for devfile/registry-operator

/kind user-story
Which area this user story is related to?

/area registry
User Story
Issue opened as a result of https://github.com/devfile/api/issues/1334 for implementing podman support across our repositories.
As a contributor I want to be able to run the build scripts using podman, so that I can develop for devfile with the use of podman instead of docker.
The registry-operator repository uses a Makefile to run scripts. Possible solutions to this issue could be to add podman support scripts to the Makefile or reference the setenv.sh script in https://github.com/devfile/registry-support
Acceptance Criteria

[ ] Implement podman support for devfile/registry-operator
[ ] Update documentation to reflect changes in the build/deploy process.
[ ] Sufficiently test changes made.

Created PR: https://github.com/devfile/registry-operator/pull/61


Budget Allocator

https://github.com/facebookexperimental/Robyn/blob/4300767cd11e4058f8f41d664b041659599c2f42/demo/demo.R#L374
Hi all -
I have one question, currently BudgetAllocator by defaults uses the last month for budget allocation exercise. How do I change to the entire period of time?

date_range = "all"
Please check the documentation ?robyn_allocator

Thank you very much!


Data Plane Proxies show only first service/zone from tags

What happened?
When we show tags for Data Plane Proxies (both list and detail views), we only read the first service and zone from the annotations even though there could be multiple.
How do we want to handle this?

Triage: @kleinfreund to reach out to design to ask. We could list all services in one cell separated by the new line

There are places in the Konnect UI that show multiple entries and an ellipsis to make things still compact. Is this what we should do here?


Revise the review policy

Based on discussions like https://github.com/r-multiverse/help/issues/83.

Implements https://github.com/r-multiverse/help/issues/103.
If approved, this revision will be effective 2024-12-17.

Thanks for approving, @shikokuchuo. If there are no objections from now until 2024-12-17, I will merge then.

We have 2 approvals and no dissent (I believe I addressed specific feedback). Merging as per https://github.com/r-multiverse/help/issues/103#issuecomment-2481410488


to add TGL support for legacy features as on ICL

to add TGL support for legacy features as on ICL
Compared to ICL, the vp8 decode and encode were removed support on TGL for iHD driver

https://github.com/intel/vaapi-fits/pull/161 is trying to fix this

closed this issue with patch merged


bug: conda cache does not work

Are you use the envd server?

[ ] Yes, I am using the envd server.
[X] No, I am not using the envd server.

Describe the bug
def build():
    config.repo(url="https://github.com/tensorchord/envd", description="gnn")
    base(os="ubuntu20.04", language="python3.7")

    install.cuda(version="11.3.1")

    install.python_packages(name = [
        "dgllife",
    ])

    install.conda_packages(
        name=[
            "pytorch",
            "cudatoolkit=11.3",
            "rdkit",
            "dgl-cuda11.3",
        ],
        channel=[
            "pytorch",
            "conda-forge",
            "dglteam",
        ],
    )
    shell("bash")

The conda cannot be cached
To Reproduce

run with the build.envd

Expected behavior
No response
The docker info output
None
The envd version output
v0.3.11
Additional context
No response

@cutecutecat
Could you please have a look?

May be I can have a try.

I can't download dependencies... I wonder if it's due to my OS(macOS).
#32 [internal] /opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3 pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3
#32 73.23 done
#32 73.23 Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
#32 410.1 Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
#32 1866.9 Collecting package metadata (repodata.json): ...working... WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
#32 2078.4 WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0.*, but conda is ignoring the .* and treating it as 1.9.0
#32 2078.4 WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0.*, but conda is ignoring the .* and treating it as 1.6.0
#32 2157.3 done
#32 2157.3 Solving environment: ...working... DEBU[2024-01-09T13:15:48+08:00] stopping session

#32 ERROR: process "/opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3" did not complete successfully: exit code: 137
------
 > importing cache manifest from docker.io/tensorchord/python-cache:envd-v0.3.43-cuda-11.3.1-cudnn-8:
------
------
 > [internal] /opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3 pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3:
#32 2157.3 Solving environment: ...working...

#0 1.682 Collecting package metadata (current_repodata.json): ...working... WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
#32 73.23 done
failed with initial frozen solve. Retrying with flexible solve.
WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
#32 2078.4 WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0.*, but conda is ignoring the .* and treating it as 1.9.0
#32 2078.4 WARNING conda.models.version:get_matcher(537): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0.*, but conda is ignoring the .* and treating it as 1.6.0
#32 2157.3 done
------
ERRO[2024-01-09T13:15:48+08:00] Buildkit error: failed to solve: process "/opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3" did not complete successfully: exit code: 137
(1) attached stack trace
  -- stack trace:
  | github.com/tensorchord/envd/pkg/builder.generalBuilder.build.func1
  |     /home/runner/work/envd/envd/pkg/builder/build.go:265
  | golang.org/x/sync/errgroup.(*Group).Go.func1
  |     /home/runner/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75
  | runtime.goexit
  |     /opt/hostedtoolcache/go/1.19.10/x64/src/runtime/asm_arm64.s:1172
Wraps: (2) Buildkit error
Wraps: (3) failed to solve: process "/opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3" did not complete successfully: exit code: 137
  | (1) failed to solve: process "/opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3" did not complete successfully: exit code: 137
  | Error types: (1) *builder.BuildkitdErr
Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *builder.BuildkitdErr
ERRO[2024-01-09T13:15:48+08:00]                                               error="failed to load docker image: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.43/images/load?quiet=1\": context canceled" language-version=v0 tag="envd-quick-start:dev"
FATA[2024-01-09T13:15:48+08:00] exit                                          app=envd error="failed to build the image: failed to build: failed to wait error group: Buildkit error: failed to solve: process \"/opt/conda/bin/conda install -n envd -c pytorch -c conda-forge -c dglteam pytorch cudatoolkit=11.3 rdkit dgl-cuda11.3\" did not complete successfully: exit code: 137" version=v0.3.43

My docker info:
Client:
 Version:    24.0.2
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.0
    Path:     /Users/x/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.19.1
    Path:     /Users/x/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/x/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /Users/x/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.6
    Path:     /Users/x/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/x/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/x/.docker/cli-plugins/docker-scan
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  0.16.1
    Path:     /Users/x/.docker/cli-plugins/docker-scout

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 24.0.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.49-linuxkit-pr
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 5
 Total Memory: 7.667GiB
 Name: docker-desktop
 ID: 0a1c4432-d01a-4090-b9da-8cf7b4464c9d
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  <IP_ADDRESS>/8
 Live Restore Enabled: false

@Electronic-Waste can you provide your envd build file?

My envd build file is the buggy file provided by @gaocegege .


Distributed tracing support

To generate openzipkin compatible traces/spans for network calls (to start with) and later for internal (within runtime) calls.
Tracing should be sampled and on-demand.

This is implemented and in master. See : https://github.com/flipkart-incubator/grpc-jexpress/wiki/Distributed-Tracing


re-enable test "flutter_driver_screenshot_test_ios" in framework repo

Location: https://github.com/flutter/flutter/tree/master/dev/integration_tests/flutter_driver_screenshot_test
This test was disabled because we wanted to move the golden image out of the flutter/flutter repo, we should re-enable it as soon as possible, it might be done in one of the two ways:

Move the golden image to the flutter/golden repo and do the image diff with a remote image.
Update the golden api so that we can use it in the device lab.

(triage) Closing this since the test has been deleted in #76575


metadatasvc: secure container registration/unregistration

Currently any process on the host can issue registration and unregistration requests and they will succeed. Secure that via Authentication header or only listening for these requests via a unix socket (and granting permissions to the socket only to a certain group).

Unix socket sounds good to me.


OLH-1488 Update 404 page - Fix

Proposed changes

What changed
Changed the way 404 page behaves depending on whether a user is logged in or not.
For logged in users, navigation is displayed and the main CTA button goes to your-services page
For not logged in users, navigation is not shown and the main CTA button goes to sign in page.
Why did it change
Because that’s the more appropriate place to send users who get a “not found” while navigating their One Login home, and less confusing when we don't show the navigation
Related links

Checklists

Environment variables or secrets

[ ] No environment variables or secrets were added or changed

[ ] Added a local variable res.locals.isUserLoggedIn

Testing
Local testing for both logged in and not logged in users

How to review
Navigate to any non-existent page to see the 404 page. Check both navigation and CTA  button copy

Hi @aenciso thanks for persevering with this!
Nice solution adding the middleware, makes everything cleaner. Can you explain like I'm 5 😄: what is the benefit of setting the value of activeNav to an invalid one (by "invalid" I mean one that doesn't match any of the IDs of the existing navigation links) vs not setting activeNav at all on pages where it is not required such as the 404 or 500 error pages?

Sure, basically, activeNav defaults to "security", that means 404 and 500 pages will still show "security" as an active navigation element, even if we set it to "null" or "undefined" which from a UI perspective is wrong as none of those are pages you can go to via navigation links. By setting it to something that does not exist, the navigation links don't become active for those specific cases.
Now the why. Another way we can achieve this is by removing the default option and then set it manually for each page, that means add activeNav in each page, not difficult but I didn't want to add more refactor to this (initially simple) task and more code to review.
Another way of doing it, which was my initial thought, was to create a nunjucks filter that would parse the URL and check if the current page was somehow in the location, neat but we would have to store a variable with all the URL's and pages that belong to each journey e.g. enter-password, change-phone, add-mfa-method, etc. would belong to security and would set the item active, again, not big but probably a lot more changes, and if someone adds a new page and forgets to set the activeNav it won't show as active.
There's still room for improvements as more journeys get added or if perhaps breadcrumbs get added but in short, this was the option which required less changes and got the desired result.

Sure, basically, activeNav defaults to "security", that means 404 and 500 pages will still show "security" as an active navigation element

Ah, of course. I forgot that was the way it worked! Thanks for going over it @aenciso  🤦🏻♀
Yeah perhaps the approach makes sense in that case seeing as you would have had to refactor everything about the logic around the active element in the navigation otherwise!
In some ways it's not ideal the way it works now, but if I remember correctly the reason it was designed this way was most pages were under the "security" area of the account (which is still the case) and we never wanted to show the nav without an "active" element.
But of course the logic doesn't work so well anymore now that the nav has to appear without an active link on these pages.


Update to 1.21.1

with 1.21 being here now it would be nice seeing this mod be updated to it thank you
^^

Mod is now updated to 1.21: https://modrinth.com/mod/dataloader/version/1.1.6+1.21


Add a VariantF datatype and a membership proof.

I've added a module Type.Set.VariantF with two major components.

A way to prove that if ForAllIn c bst then c (Follow ss bst) is true as long as ss :: [Side] points to an actual element of bst.

The typeclass ForAllIn c bst is equivalent to forall f.

A VariantF (bst :: TypeSet (* -> *)) (a :: *) :: * datatype that can hold f a for some f in bst.

This comes with instances of Functor, Foldable, Traversable, and an iffy Show instance. (The latter because it's really nice for debugging even if there can't be a valid Read instance)
Here's a quick test:
type VF = VariantF (Insert [] (Insert Maybe Empty)) Int

l :: VF
l = toVariantF @[] [1,2,3,4]

b :: VF
b = toVariantF @Maybe (Just 3)

main :: IO ()
main = do
  print . fromVariantF @[] $ l
  -- Just [1,2,3,4]
  print . fromVariantF @[] $ fmap (+5) l
  -- Just [6,7,8,9]
  traverse print l
  -- 1
  -- 2
  -- 3
  -- 4
  print l
  -- toVariantF @([SomeType]) $ [1,2,3,4]
  print b
  -- toVariantF @(Maybe SomeType) $ Just 3

Very cool, thanks for the PR. I have some questions about the wider maintainability of this library (in an ideal world we don't need new versions of Variant for every kind!)

Very cool, thanks for the PR. I have some questions about the wider maintainability of this library (in an ideal world we don't need new versions of Variant for every kind!)

Yeah, I'm not sure how to do that within the current bounds of Haskell. I'll play with it more tomorrow, but it would be nice to have something like
data VariantK (bst :: TypeSet (k -> *)) (a :: k) where
  VariantK :: SSide ss -> Follow ss bst a -> VariantK bst a

but that doesn't quite work since the ideal interface would let us instantiate that as VariantK (bst :: TypeSet (* -> * -> *) (a :: *) (b :: *) :: * with some sort of type level curry/uncurry.
Though it doesn't seem too hard to just define 'VariantK' and let some newtypes or type synonyms capture the common cases for k. That would mean having only Variant and VariantK defined in the library and moving from there.
I'll play with it tomorrow and see what I can do.

Hmm, that wouldn't solve the instance problem, but with ForAllIn and forMember writing those instances follows a simple pattern that shouldn't be hard for people using the library to follow.

Unpack all the ForAllIn constraints by matching on the Dicts you get from forMember.
Write the instance pretty much like normal.

Hmm, It works fine on my box. I'm happily using my fork in a separate project.
I'm pretty sure the error is because the .cabal file is included in the repo and hasn't been updated to account for 'constraints' being added to the deps. I just ended up deleting the .cabal file at one point and never actually updated it.
Anyway, major changes:

Moved ForAllIn and associated elements to Type.Set.Variant where they make more sense
Added Eq, Ord and Show instances to Variant and VariantF
Generalized the kind of VariantF into VariantF (bst :: TypeSet (k -> *)) (a :: k) :: *. It matches the VariantK idea from above, but because I didn't get something like VariantP (bst :: TypeSet (k1 -> k2 -> *) (a :: k1) (b :: k2) :: * working, I didn't change the name.

Yeah, there's some issue with the cabal file and trying to debug from here takes far too long.
I've got no more time set aside for randomly exploring this, but if you have concrete changes you'd like me to make I'll be happy to do that. Likewise if you've got some specific idea you want me to test.

Also I'd argue that VariantF with it's one type parameter is a sufficient stopping point for the library. It's very useful for defining an EADT type and working with complex F-Algebras in general.
I could maybe see an argument for VariantP with its two parameters, because of categories, lenses, and (pro|bi)functors. But the net utility of adding VariantP seems a lot lower than the net utility for VariantF, and the net utility of anything with more than two type params seems vanishingly small.

Awesome, thanks!


Allow enabling mlflow/wandb/whylogs with the class-based api

Describe changes
Pre-requisites
Please ensure you have done the following:

[x] I have read the CONTRIBUTING.md document.
[x] If my change requires a change to docs, I have updated the documentation accordingly.
[ ] If I have added an integration, I have updated the integrations table.
[ ] I have added tests to cover my changes.

Types of changes

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

Ah wait mypy failed


$contains/$containsNone/$cotainsAny does not return exact proper values

Hi,
If a DB query is made using either $contains/$containsNone/$cotainsAny, it doest not return exact values.
For example an array contains these set of values ['1', '3', '4', '10'], and I query using $containsNone.
collection =  ['1', '3', '4', '10'];
filterList = ['1'];
collection.find({ 'Id': { $containsNone': filterList }});
The above query returns the following value ['3', '4'], whereas it actually has to return ['3', '4', '10'].
Thanks & Regards,
Shashank

Hey shashank, i'm trying to refamiliarize myself with these ops and think now is a good time to expand our 'Query Examples' wiki documentation to clarify how all the ops.  I'm going to have to figure out some of those as a go as I didn't implement a lot of them.
@VladimirTechMan if you get some time in the near future maybe you can help fill in missing areas where you may be able to.
It seems like all of the 'contains' functions have multiple 'modes?' depending on what what you pass in and what they are being applied to.  This needs better documentation.
I think the simpler op which may do what you are trying to do is $in/$nin?  I am about to add documentation for $nin but I think that may be the op that would work as described.
So over the next few days I will try to add in some rough documentation of those ops to the wiki (maybe I will see if they can be included somehow in jsdocs as well).  That will hopefully establish a good documentation coverage which we can expand on until all are fully explained.

Alright so I expanded the wiki page with what I think is how many of these ops work and I think the 'contains' functions, when applied to a string property will do a substring pattern match (thus matching '1' and '10' for pattern of '1').  If your 'id' property had been an array, it would have checked for the exact string in any of the elements.  If your 'id' property had been an object, it would have checked to see if the property was defined on that object.
So I think in this example, $in and $nin are the ops you are looking for?
If you have more complete example, post that since I had to guess as your use.

$containsNone works as you have mentioned above in my case. So I think $nin is the op which I should be using.
Before $nin was not included in the documentation, so I had to use $containsNone. Thanks for updating the document :)
I will try $nin instead of $containsNone.
Thanks for the update :)


[RFC] What's the future of Spec?

After the recent refactor of spec in #8125 we lost of a bit of functionality, which I now kind of regret.
In the past spec was simple: everything ran from top to bottom as soon as you wrote things. For example:
require "spec"

describe "something" do
  some_var = SomeObj.new

  it "..." do
    use some_var
  end

  it "..." do
    use some_var
  end

  some_var.cleanup
end

In the old spec we could create an object, share it in a couple of specs, then clean up. In the new spec this isn't possible because the code surrounding it will run before the contents of it.
Now, RSpec works this way. But in RSpec you have before/after hooks, you have let and you have instance variables you can share in your specs.
We have two options:

go back to the old spec, but resign to some features (focus, randomized tests, maybe parallel tests)
continue with the current spec but add new features like before/after hooks, some form of let to be able to share variables between specs, etc.

I think I prefer the first option, only because it's simpler. Maybe we don't know focus, randomized specs and so on. The second option brings a lot more complexity, which RSpec is known for (and I don't like it).
Thoughts?

Maybe we can iterate some ideas that do not match 100% with rspec.
With implicit or explicit creation of the context of execution.
private class Context
  property something = SomeObj.new

  def {before|after|around}_{suite|each}
  end
end

describe "something", using: ctx = Context.new do
  it "..." do
    use ctx.something
  end

  it "..." do
    use ctx.something
  end
end

The feature I am most interested in is tagging the specs.

At that point it wouldn't be less complex to just do like
def do_with_context
  context = Context.new
  yield context
end

do_with_context do |ctx|
  describe "something" do
    it "..." do
      use ctx.something
    end

    it "..." do
      use ctx.something
    end
  end
end

Which worked before.  It's what I was using for Athena tests.  Method starts a server in the background with the given config/env settings, news up a http client pointing to that server, yields the client and executes the tests, then closes the server.
This is just really moving complexity from the user's code into the compiler IMO.  Keeping things simple would be more preferable in my opinion.

@bcardiff the problem is there's no way to implement that with the current language.
:+1: to revert spec to the previous form?

@asterite It's too early in my opinion.
It's a good selling point for the language to have fast executing tests, and with parallelization it would become even stronger.

Let's remember that Ruby's Minitest has i_suck_and_my_tests_are_order_dependent! I believe tests should always be run in random order by default. Crystal has concurrency and now parallelism, so tests should always run concurrently and in parallel by default, too. Missing on these in the official test suite runner would be such a loss!
What's missing is a context to share state for each before/it/after to run in. In Minitest (and maybe RSpec) there is an instanciated class so we have a self object to rely on (isolated from other tests).

Maybe it's just time to give up on the DSL and just go the test/unit route of
class MyTest < UnitTest
  def before_all
    @shared = create_shared
  end

  def test_a
    assert_sane @shared
  end

  def test_b
    assert_happy @shared
  end
end

As much as I'd hate that...
Now of course we could have the macro foo create classes like that, but that goes against Ary's KISS wishes and also if we then allow nesting that easily creates a shitload of classes overloading the compiler, as early experiments by some of us (mine's at https://gist.github.com/jhass/e9219dd9da24204a073d) have shown in the past.

Thank you all for some good answers!
I'm also surprised my proposal got 3 👍 but 5 👎 so far, which means maybe the current approach isn't that bad.
I'm starting to think that if before the spec refactor doing setup/teardown was already kind of hard, now it's harder, but that might be a good thing. For example in this Haskell article they mention that to do setup/teardown you have to do it inside each test, which makes it clear what goes on (you don't need to look up up in the file to see whether there's some set up going on), so each test becomes self-contained. This is something I really like about our spec, and with this change we encourage this more (you can't have a test share a variable declared outside of it).
I do think adding before_each/before_all,after_each/after_all might come handy to set up some global state, like setting up a DB structure once for all tests, so I'll send a PR for that later.
Finally, having a form of controlled let that let you define a value to share across some tests, but where each test gets a different value/instance of it, so tests can still run in parallel, might be a good compromise.
I'll first send a PR for the hooks, then I'll draft a PR for let.

I love having the focus feature, and have been using it every day since it came out. I also love having the Spec.before_suite, and Spec.after_suite because using the at_exit in a spec_helper always felt like a hack.
I agree that it's nicer to have more simple code, but if the language is simple, then each project becomes more complex. I also believe that even though our Spec takes most of it's DSL from RSpec, I think it's ok if we break off and make it more "crystal-like".
We could pass in context to the blocks. Doing Spec.before_each could run before each test in the entire suite where ctx.before_each runs before each test in that context. Maybe we could have a way to add our own custom context and such...
describe SomeClass do |ctx|
  ctx.before_each do
    only_run_before_each_thing_in_ctx
  end

   describe "sub thing" do |ctx2|
      ctx2.before_each do
         another_block
      end
   end
end

Not to say it needs to be exactly like that, but the idea being that we don't have to copy rspec 100%. We just need what's best for our community to make testing a first class citizen, and fun to do while being robust.

@asterite I like your point here:

For example in this Haskell article they mention that to do setup/teardown you have to do it inside each test, which makes it clear what goes on (you don't need to look up up in the file to see whether there's some set up going on)

I think this is super important. RSpec specs with tons of befores can get unwieldy. With that said, sometimes before or around is helpful for setting up and tearing down for stuff like database connections or servers  that aren't really related to the test, but may be necessary to make the test work.
So I would not be against adding those features. I think the real problem is using let inside blocks and being able to override lets within other describe blocks. That and instance vars in before blocks. This makes tests so unwieldy as they grow because you have to look in a million places to figure out where data is being set up and passed around. I'd consider it a feature if you could not pass data from before blocks or set instance vars in them. Instead before is meant for test setup like starting servers, starting a db transactions, etc.
If you have a lot of setup I think private methods work super well, but I realize this may also be my opinion. Some people love let

I've been using my own patch that adds around_each for some time now, and as has been previously mentioned, this is absolutely necessary if you are wrapping specs in a database transaction, as this cannot be done with simple before/after hooks.  I'd be happy to submit a PR if that is the direction we are going.
Regarding spec ordering, in my opinion specs should be randomly sorted by default, with the option to specify alternate orderings. There are so many errors that can go missed if you always run specs in the same order. Depending on specs to be run in some particular order is an anti-pattern.
I realize this creates the issue rspec has to deal with where setup code is difficult because it blocks aren't run immediately. I think a better solution than let is to do whatever has to be done to ensure that @ variables defined in hooks are available to all specs. I'm sure some clever macroing could make this happen.
In general, a lot of our users are coming from ruby/rails, and will be familiar with how rspec behaves, so I don't see this as a bad thing.

@sam0x17 I agree
In case you are working on hooks, just know that I already submitted a draft PR for this: https://github.com/crystal-lang/crystal/pull/8302
I'll finish it soon so we can review it.

This is my feature wishlist for Spec:

skip: true to be consistent with focus: true
parallel specs (not on by default, as many codebases aren't parallel ready I imagine)
random spec ordering, on by default, can be configured via Spec.default_ordering or command line parameters. Can specify seed via Spec.random_seed or crystal spec --seed [seed]. Seed is printed upon any failures for easy reproduction of order-dependent errors.
around_each hooks
after_failure hooks -- useful for recording failure statistics / in CI situations if there are non-deterministic errors that fail a small percentage of the time. Block should be provided with an object representing the failure, including profiling information, stack trace.
printed warnings for specs that take longer than [some threshold]. Threshold can be configured via Spec.runtime_warning_threshold or crystal spec --threshold 5s.
group: :some_name shorthand for defining groups of specs that can be run like crystal spec --group some_name. Allow for a spec to belong to multiple groups via group: [:slow_specs, :some_name]. Also pre-populate the hierarchy of describe values as group names for the current spec, so you can do crystal spec --group User and all specs within describe User will run.
depends_on: :group_name allows creating a dependency hierarchy. Could use this to figure out the minimal set of specs that need to run to cover a particular feature/change. A lot of this could be automatic, e.g. an untracked change in the User class means the spec group for User needs to run. crystal spec --minimal would try to run just the specs that directly cover untracked git changes. crystal spec --auto would try to first run all specs that cover features that are depended on by specs in crystal spec --minimal followed by all specs in crystal spec --minimal. Specs that live in a "bad" describe block that can't be automatically linked to a file or piece of code, e.g. describe "some string that provides no context", would just always run since we can't know what code those specs cover so we have to assume they are always needed. The main idea of this approach is you run the fewest number of specs possible, and spec ordering is done such that if A depends on B, the specs for B will run first, to the best of our ability. With cyclic dependencies, we fall back to random.

@sam0x17 When using around_each for db transactions, how do you inject the transaction instance into the example blocks?
Regarding your wish list:

skip: true is essentially not much different from pending. So while being simple to implement, I doubt it's worth adding another concept.
parallelism should eventually be possible
Randomisation is already happening in #8310
Grouping is already happening in #8068
depends_on sounds like a lot of complexity and IMO questionable usefulness. It's defined a longer term discussion.
I doubt retries would be a god thing. Specs should be made sure to succeed always. The occasional failure for unrelated reasons is fine and shouldn't be hidden. Maybe it's a sign to apply some improvements instead. Besides, you can always implement some manual retry of fault-prone behaviour.

Parallel specs by default would, on the other hand, be a great way to actually find real issues early, for the same reason random ordering do. It may force some additional ways to flag stuff that uses the same external resource though.

I could see implementing bisect being a thing. Sometimes just getting a test failure for the random order isn't sufficient for actually finding what it is that trigger the error.

@straight-shoota that's some very good feedback, and generally I agree.
Having seen a lot of rails apps in production at various companies, I will say this. Once an app is large enough, there are almost always going to be "unstable" specs, and usually managing these becomes a CI nightmare. Are they bad? yes. Are they terrible? yes. This is a very common thing with integration testing involving javascript. Sometimes it just chaotically doesn't work. So my motivation for wanting a retries feature is to provide a framework for doing unstable specs in an organized way, rather than whatever even worse way users come up with (such as re-running the spec suite from start to finish until it passes, which I have seen too many times in the wild).
depends_on style specs is probably going to end up being my own shard when I get around to doing it. I believe in a testing methodology where coverage is detectable (imagine doing this with annotations) and we can completely determine which specs need to run for a particular set of changes or to cover a particular piece of code.
Didn't know about pending -- that does what I need just fine

@straight-shoota to illustrate my point based on your comment,

The occasional failure for unrelated reasons is fine and shouldn't be hidden

Once you get to 3000+ specs (which is the average spec suite size of companies I have worked with), occasional almost always happens at that volume.

Some of the mentioned features are already included in feature rich shards like Spectator.
So far I thought Spec of the standard library just was focused to be kind of minimal but yet functional. On the other hand it would obviously be nice having wonderful spec features available within the standard library as well.
Is there so far a general consensus on the 'high-level general idea' of Spec (minimal vs feature rich)?

I think in general we are trying to keep things simple, but still have goodies like parallelism, around_each, grouping, etc., without complicating the existing API footprint.
In other words, be a better, simpler, faster rspec.

On Oct 14, 2019, at 5:37 AM, Alexander ADAM<EMAIL_ADDRESS>wrote:
Some of the mentioned features are already included in feature rich shards like Spectator https://gitlab.com/arctic-fox/spectator.
So far I thought Spec of the standard library just was focused to be kind of minimal but yet functional. On the other hand it would obviously be nice having wonderful spec features available within the standard library as well.
Is there so far a general consensus on the 'high-level general idea' of Spec (minimal vs feature rich)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/crystal-lang/crystal/issues/8289?email_source=notifications&email_token=AAOE4LL6NV65NI7ZUML46FDQOQ4WDA5CNFSM4I6JVVS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBD5QYI#issuecomment-541579361, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOE4LNRXVYR3BSOH3G42XLQOQ4WDANCNFSM4I6JVVSQ.

Yes, stdlib spec should be minimal but include enough features for a basic experience. Additional features can be added by third party shards. depends_on and retries would better be suited for a shard.

I prefer some of the features of spec and testunit.
I like the assert style tests. I find it to be more predictable in my assumption of what is going on.  I know some people find the syntax adds clarity, but I like the simplicity of the interface.  I also like the structures of describe, context and it so I use those to setup tests.
When it comes to structure, I like to have more helper methods call in specs and fewer hooks surrounding test suites.  I find there are a host of problems that can come up, and they are not offset by the consciousness or line count of the code.
I want an assert style syntax with describing and it blocks and less reliance on before and after hooks.

I agree on "the fewer hooks, better it is".
How to solve this, that's a tough question.

How to solve this, that's a tough question.

This was already answered by @wontruefree:

have more helper methods call in specs

And I fully agree to that. Until recently, there have not been any useful hooks in spec. But we still managed to have quite extensive spec suites for the stdlib, compiler and many shards. I have never really missed hooks while writing hundreds of specs in Crystal. In fact, I've even adapted to using less specs with rspec because the directness of helper methods adds more clarity what's going on.
That being said, now that hooks have been implemented (with the updated internals this wasn't a big deal), I don't mean for them to go away. I just won't use them much (or at all). And I'll probably advocate to stay with helper methods in every project I'm contributing ;)

Note, though, that the stdlib and compiler don’t involve a database (production apps typically do), and with many of the database shards (clear-orm for example), the ONLY way to put something in a transaction is wrapping via a block. This means that without around_each hooks, it is physically impossible to wrap specs in database transactions without patching the ORM itself.

On Oct 14, 2019, at 1:15 PM, Johannes Müller<EMAIL_ADDRESS>wrote:
How to solve this, that's a tough question.
This was already answered by @wontruefree https://github.com/wontruefree:
have more helper methods call in specs
And I fully agree to that. Until recently, there have not been any useful hooks in spec. But we still managed to have quite extensive spec suites for the stdlib, compiler and many shards. I have never really missed hooks while writing hundreds of specs in Crystal. In fact, I've even adapted to using less specs with rspec because the directness of helper methods adds more clarity what's going on.
That being said, now that hooks have been implemented (with the updated internals this wasn't a big deal), I don't mean for them to go away. I just won't use them much (or at all). And I'll probably advocate to stay with helper methods in every project I'm contributing ;)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/crystal-lang/crystal/issues/8289?email_source=notifications&email_token=AAOE4LIC6JAAI6OTQFMI3TLQOSSM3A5CNFSM4I6JVVS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBFUMMQ#issuecomment-541804082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOE4LM7EYEOGAR3HNSGZDLQOSSM3ANCNFSM4I6JVVSQ.

just to clarify I think hooks are useful and handy to have in a test suite.  But like in the words of the agile manifesto I prefer setup helpers over hooks.

These are the sorts of things I regularly have to put in hooks:

wrapping all specs in a database transaction
automatically dropping, creating, migrating, and seeding test database before the test suite is run
clearing the current cookie jar between specs (for integration specs)
clearing session-specific context information between specs (e.g. I have an Auth.current_user that I have to clear out, among other things)
Timecop-style stuff, sometimes for all specs in a particular file (this could be done in helpers though)
any analysis I want to perform on my own on all specs, such as benchmarking

Things I never use hooks for:

instantiating prefabs / test objects
setup code

@sam0x17 Yes, I've written lots of database specs as well. They're usually wrapped in transaction blocks. It's not a big deal. It's just nice to work with. It makes the connection directly available as block arg. How do you get access to that when it's initialized in a before_each hook?
Of course, hooks can be useful at times and I won't condemn using them.
And I think we all agree that hook support in spec is here to stay.

Right now using my around_each patch.

On Oct 14, 2019, at 2:00 PM, Johannes Müller<EMAIL_ADDRESS>wrote:
@sam0x17 https://github.com/sam0x17 Yes, I've written lots of database specs as well. They're usually wrapped in transaction blocks. It's not a big deal. It's just nice to work with. It makes the connection directly available as block arg. How do you get access to that when it's initialized in a before_each hook?
Of course, hooks can be useful at times and I won't condemn using them.
And I think we all agree that hook support in spec is here to stay.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/crystal-lang/crystal/issues/8289?email_source=notifications&email_token=AAOE4LMUEB6ICRTQ5V2LHB3QOSXURA5CNFSM4I6JVVS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBF2FAI#issuecomment-541827713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOE4LKMTLLLH276QVTGZHDQOSXURANCNFSM4I6JVVSQ.

I personally thing that Crystal's Spec should offer the following, but not much more:

basics: describe/context/it/pending + built-in matchers
each/all/suite setup and teardown
ability to set up common variables (a simpler let or some way to do it with before_each or private methods *more comment below)
filtering (by pattern, file glob, file:line, tag, and focus)
tagging/grouping
randomization (preferably on by default)
parallelism
maybe bisect, but I could see that being a shard

As most of these are already implemented or in PRs, I think the direction it's going is good, though I do understand that the current implementation may make it difficult to do particular things like the variable sharing.
Specifically on the assert style vs should style, I personally don't like the assert style, preferring the should/expect style.  However, I think that ultimately comes down to how each person's brain prefers to see things... infix notation (a eq b) vs prefix notation (eq a b).  I think it would be good in this particular instance for Crystal to offer both to accommodate both types of person.

For example in this Haskell article they mention that to do setup/teardown you have to do it inside each test, which makes it clear what goes on (you don't need to look up up in the file to see whether there's some set up going on)

I've always felt this was one of the downsides to the RSpec style...that is, a lot of setup ends up "far away" from the code under test.  But, this happens with helper methods too...you create a method at the top of the file and then reference it over an over at the bottom of the file, so I'm not sure it's something that can be avoided.
I agree with @paulcsmith that where it gets extremely unwieldy is when you have lets and nestings overriding lets, and agree that avoiding that as an anti-feature would be a good thing.  Instance vars in before blocks are similar in that they can override each other, so I could see that also being avoided.  However, I think there needs to be a way to set up context, which includes settings up variables, and once you offer that I'm not sure you can't really prevent overrides.

@Fryguy Regarding let, in projects I manage I always encourage a methodology of either creating directly in the spec, or using a prefab that gets automatically seeded right before the suite runs. Combine that with wrapping each spec in a database transaction, and running drop, create, migrate, seed before each suite run, and you get a pristine database environment, with reusable prefabs, for each spec. So long story short you can get around using let entirely, it's just down to how you set things up
In terms of what we should do, I have no problem with adding let. I just won't use it very often if at all.

@sam0x17 How do you get access to the prefabs?

@asterite I use a macro that makes them available via method names at the top level (basically cheatsy global variables), and I also have Prefab.[whatever].

So long story short you can get around using let entirely, it's just down to how you set things up

I think databases are kind of unique in that respect because they offer transactional rollbacks, which can even support parallelism.  If you're writing specs, that, say, shell out to commands that modify the system, then I think it's a bit harder.  I see let (or memoized methods or whatever) being useful for things like "create a temp dir and store the name of the temp dir in a variable to use later in the spec", where I want a brand new temp dir for each spec to get that "pristine environment"

@Fryguy that's true. I never thought of it that way. If I was testing stuff like that I would default to using helper methods, but it's true one could use let.

high level description of how my prefab setup works:
I have a Prefab module. I define [] and []= methods for the module, with logic for the relevant models. Models are stored in a Hash(Symbol, ParticularModel) class variable. So for the user "sam", it would be Prefab[:sam] and (via a hook), Prefab.sam. I also have logic so that when a model is accessed within a spec, it is marked as dirty, and then after each spec, all dirty models are reloaded from the db, in case they have been mutated (since specs are wrapped in a db transaction). In this way, I use the same prefab objects as much as possible, and only reload if I absolutely have to, but I always have a clean state. I then have a macro at the end of the file that makes all the prefabs available as top-level getters, so I can just do sam in a spec and it will work.

i have a simple example that works for me
require "spec"

require "./../../game/Round.cr"
require "./../../models/Character.cr"

private class Context
  getter :enemy

  def initialize()
    @luck = 10
    @hero = Models::Character.new("user1", 100.0, 30.to_i64)
    @enemy = Models::Character.new("user2", 100.0, 30.to_i64)
  end

  def enemy_energy_after_calling_update_state()
    _, enemy_after_round = Game::Round.new.update_state(@hero, @enemy, @luck)
    enemy_after_round.energy
  end
end

describe Game::Round do
  describe "#update_state" do
    describe "when luck factor is less than 15" do
      ctx = Context.new
      it "returns enemy with the same energy before round" do
        ctx.enemy_energy_after_calling_update_state.should eq ctx.enemy.energy
      end
    end
  end
end

From a reusability standpoint I kinda like https://github.com/crystal-lang/crystal/issues/8289#issuecomment-539403319 this approach.  The main reason being since they are just classes you are able to use inheritance/modules to share common logic between tests.  Such as by using inheritance, modules, and/or abstract methods to more easily setup specs for a common thing.
I ran into this recently when working on my validation shard.  It would be nice to have something like:
abstract struct AbstractComparisonTestCase < Crystal::TestCase
  protected abstract def create_constraint(**args)
  protected abstract def create_validator
  protected abstract def valid_comparisons
  protected abstract def ivalid_comparisons

  def test_valid_comparisons : Nil
    self.valid_comparisons.each do |(expected, actual)|
      assert_no_violation create_validator, create_constraint(value: expected), actual
    end
  end

  def test_invalid_comparisons : Nil
    self.ivalid_comparisons.each do |(expected, actual)|
      assert_violations create_validator, create_constraint(value: expected), actual
    end
  end
end

struct EqualToValidatorTest < AbstractComparisonTestCase
  protected def create_validator
    EqualToValidator.new
  end

  protected def create_constraint(**args)
    EqualTo.new **args
  end

  protected def valid_comparisons
    [
      {1, 1},
      {"foo", "foo"},
      {ComparableMock.new(5), ComparableMock.new(5)},
      {Time.utc(2020, 4, 7), Time.utc(2020, 4, 7)},
      {1, nil, "nil"},
    ]
  end

  protected def ivalid_comparisons
    [
      {2, 1},
      {"bar", "foo"},
      {ComparableMock.new(10), ComparableMock.new(5)},
      {Time.utc(2020, 4, 8), Time.utc(2020, 4, 7)},
    ]
  end
end

My current workaround for this would be to just use private method/constants and a macro to define the describe blocks:
private def create_validator
  AVD::Constraints::EqualToValidator.new
end

private def create_constraint(**named_args)
  AVD::Constraints::EqualTo.new **named_args
end

private VALID_COMPARISONS = [
  {1, 1, "numbers"},
  {"foo", "foo", "strings"},
  {ComparableMock.new(5), ComparableMock.new(5), "comparable types"},
  {Time.utc(2020, 4, 7), Time.utc(2020, 4, 7), "times"},
  {1, nil, "nil"},
]

private INVALID_COMPARISONS = [
  {2, 1, "numbers"},
  {"bar", "foo", "strings"},
  {ComparableMock.new(10), ComparableMock.new(5), "comparable types"},
  {Time.utc(2020, 4, 8), Time.utc(2020, 4, 7), "times"},
]

# This would live in spec_helper
macro define_comparison_test
  describe "#validate" do
    VALID_COMPARISONS.each do |(expected, actual, message)|
      it "valid #{message}" do
        assert_no_violation create_validator, create_constraint(value: expected), actual
      end
    end

    INVALID_COMPARISONS.each do |(expected, actual, message)|
      it "invalid #{message}" do
        assert_violations create_validator, create_constraint(value: expected), actual
      end
    end
  end
end

describe AVD::Constraints::EqualToValidator do
  define_comparison_test
end

Id be curious to hear if anyone has a better idea

@Blacksmoke16 Can you use minitest.cr instead>

@asterite Probably.  Although I'm hesitant about introducing an external dependency JUST for that.  Plus it's just something else someone has to learn if they want to contribute.

I think there's no need for define_comparison_test to be a macro? If that's the case, this is just composing methods.

Having the macro content be in every spec file would also work.  My thought was that this way the code is centralized.  I.e. if you wanted to add something else you update the macro and possibly add some new method to each file as opposed to updating the describe blocks and add a method for each file.

Although I'm hesitant about introducing an external dependency JUST for that. Plus it's just something else someone has to learn if they want to contribute.

When you're already hesitant to add something to your project because it's a separate shard, I'm even more so about such a huge change in stdlib JUST for that. =)

Oh I'm definitely not saying we should refactor the whole stdlib to use a new Spec implementation.  Just pointing out something that could be useful to give insight into future improvements/changes.
I'd for sure rather keep things simple as my current workaround is pretty decent for what its doing.  If anything, some build in feature around something like data providers could be handy.  Granted I haven't put much thought into if that would even be possible or how it would work in the current implementation.

Plus it's just something else someone has to learn if they want to contribute.

So is a new style for the stdlib spec.
There's a huge value in having one standard way to do things, even if you don't like the standard personally.

FWIW I threw https://play.crystal-lang.org/#/r/9i04 together as a proof of concept I had.  IDK if we'd want something like that in the stdlib, but it was fairly easy to expand the current Spec implementation to allow for a more OOP class/method testing approach.  It essentially solves the reusability problems I was having as part of https://github.com/crystal-lang/crystal/issues/8289#issuecomment-604523903.  It also adds some extra features like the DataProvider.  In the end it's just an abstraction on top of Spec that generates the describe and it blocks based on the type/methods. The downside is it's of course another way to do what is already possible.
I'd be happy to improve the implementation/feature set if this is something we'd want in the stdlib.  Otherwise, I might just make a shard with it.


Fixed generation of default methods

I'll update the tests after my other PR is done.

This is great, thanks! Just let me know when you're done with all the changes and I'll get these merged for you.

Ok, I'll update the tests now, and we can do this one first.

This is good to merge now I think. I'll update #7 right after.

Fantastic, thank you!


Shop view fixed on frontend side.

Shop view is better now. But there is still many work to do.

[x] Write a clean html code
[x] Complete missed css codes
[ ] Complete missed js codes.

Hi @alican22,
Thanks for looking into this. The frontend looks a lot better with these changes. 👍
One thing I would like to ask has to do with the assets: I see the new CSS code includes some images from the original game servers, like this example:
#shopcomponent #planet {
    background: url("//gf3.geo.gfsrv.net/cdnb2/dbba5547458345f9e3b3baa09c3ef2.jpg") no-repeat;
    height: 250px;
}

In order to have OGameX be independent of the original game the goal is to include all required assets into the repository. I already did this for all existing assets which looks like this:
#messagecontainercomponent .content .singleTab.marker {
    background: url("/img/icons/112960c1ace80c7dcb03ca88d4b6fc.png") no-repeat;
}

My request therefore would be if you could take a look at copying over the relevant files and replacing the external paths in the CSS with the new local relative paths. This will ensure that OGameX will always properly work, now and in the future.
Thanks again! 🚀


More Robust Support for Decimal

Have had several use cases where an old mainframe computer is looking for a fixed-width file where some of the numeric values where not allowed to have '.' separators. i.e in a 0-padded 20 length field the number<PHONE_NUMBER> needs to be written as<PHONE_NUMBER>3453226565.
I added some optional config parameters for decimal to accommodate this.
I added some CONFIG verification in the python def __init__() function and added some light documentation in the README.
I added one test. (all 4 are passing)
Let me know if you need me to tweak anything.

@ShawnMilo , I'm @ mentioning you here in case you did not get notified of this PR.

@ShawnMilo, this is again conflict free. Do you mind giving it a look?

Hi. Sorry! I didn't see your previous notifications. I'll look at it now, girevik.

First: Thanks for using and liking my package, and taking the time to create a PR!
I think that this functionality shouldn't be part of fixedwidth, for these reasons:

It alters the data (via rounding), which I don't think it should do, and others may not expect. Especially since fixed-width data (in my experience) is usually going to a bank
Formatting (such as removing decimal points from numbers) seems like it's outside the scope of this package -- this should be handled in the program which imports this package
Decimals are already supported for most use cases
The amount of code added (increases the codebase by more than 50%) increases the complexity and readability more than I think the feature is worth -- especially since most people don't need the feature

However, I'm going to leave this PR open for a while in case anyone has arguments that may change my mind. Also, I hope you have no trouble refactoring the changes to use in another part of the data chain. It's usually a good idea to propose changes before putting the work in so the effort isn't wasted if the feature is rejected, but in this case I think you should be able to re-use the code pretty easily.
Keep doing those ladders!

Thanks for giving it a look. The primary reason for the addition was to support a bank data format I have been forced to work with. I'll review the code a bit and see if I can make it a bit more minimal.


tpar enqueue working directory

at the moment, tasks run with
tpar enqueue

are executed in the directory where the server was started.
It would be great if in stead it would be executed in the directory where enqueue was called from.
alternatively, the working directory should be configured, e.g.
tpar enqueue -d=$dir

Done


Do not return value in console storage listing

The console storage list view has no use for the value, which for large stored values on low hardware deployments could cause an OOM.

@sesposito Add a changelog entry too please. 🙏


Can we update the price when the store is disconnected?

Is it possible to update the price when the store is disconnected by using Commerce scale unit?

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

ID: b3904172-4dc3-3602-05a6-6bc0fcd1c7e3
Version Independent ID: 2eaac493-f165-5f34-8d05-e441e741a8b8
Content: Commerce Scale Unit (self-hosted) - Commerce | Dynamics 365
Content Source: articles/commerce/dev-itpro/retail-store-system-begin.md
Service: dynamics-365-commerce
Product: ****
Technology: ****
GitHub Login: @josaw1
Microsoft Alias: josaw

Bug 756034 has been logged to address this issue.

@jashanno can you please review this?

It's not quite clear to me what the customer refers to by saying "update the price". If it's about price configuration in back-office system, sure you can do it regardless of POS connectivity status, because HQ and POS are technically two different systems. If it's about "price override" function in POS app, yes that's also supported for POS in offline mode, which is outlined in https://learn.microsoft.com/en-us/dynamics365/commerce/pos-operations @josaw1 Bug 756034 FYI


A few things updated into dev branch, took on board changes and reworked code to flow in line with re-write

New:

Added AzVault module for spraying
Added MS_Template for creating microsoft/azure specific spraying modules

Updated:

Added in discord webhook function into notify
Pushed fire.py into utils folder for tidier root, changed credmaster.py to import from correct location

WIP:

Began work on rewrite of config file to factor in other webhooks
Began research into GCP/Azure alternatives for API gateway and increased opsec

Took on board all comments from previous pull and corrected areas where required and added in new additions to align to re-write


Feature/Add Confluence Document Loader

Issue:
https://github.com/FlowiseAI/Flowise/issues/222
Results

 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.

There is no support for data center/server version where personal token is userd.
 else if (personalAccessToken) {   const loader = new ConfluencePagesLoader({     baseUrl: "https://example.atlassian.net/wiki",     spaceKey: "~EXAMPLE362906de5d343d49dcdbae5dEXAMPLE",     personalAccessToken,   });   const documents = await loader.load();   console.log(documents); } else {   console.log(     "You need either a username and access token, or a personal access token (PAT), to use this example."   ); }
Personal Access Token (Server/On-Prem only)
This method is valid for the Data Center/Server on-prem edition only. For more information on how to generate a Personal Access Token (PAT) check the official Confluence documentation at: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html. When using a PAT you provide only the token value, you cannot provide a username. Please note that ConfluenceLoader will run under the permissions of the user that generated the PAT and will only be able to load documents for which said user has access to.
`import { ConfluencePagesLoader } from "langchain/document_loaders/web/confluence";
const username = process.env.CONFLUENCE_USERNAME;
const accessToken = process.env.CONFLUENCE_ACCESS_TOKEN;
const personalAccessToken = process.env.CONFLUENCE_PAT;
if (username && accessToken) {
const loader = new ConfluencePagesLoader({
baseUrl: "https://example.atlassian.net/wiki",
spaceKey: "~EXAMPLE362906de5d343d49dcdbae5dEXAMPLE",
username,
accessToken,
});
const documents = await loader.load();
console.log(documents);
} else if (personalAccessToken) {
const loader = new ConfluencePagesLoader({
baseUrl: "https://example.atlassian.net/wiki",
spaceKey: "~EXAMPLE362906de5d343d49dcdbae5dEXAMPLE",
personalAccessToken,
});
const documents = await loader.load();
console.log(documents);
} else {
console.log(
"You need either a username and access token, or a personal access token (PAT), to use this example."
);
}`


CF-2631 Can't terminate deployment

Retry request in the case of getting ‘Address family not supported by protocol’ error(which causes failed pending action and then creating of instance orphan)

please bump version in https://github.com/rightscale/right_cloud_api_base/blob/master/lib/right_cloud_api_base_version.rb

lgtm


🚀 [Feature] Give Frontend GDD float

:rocket: Feature
Return all GDDs to frontend as float already divided by 10.000

Hint: String is not  good option since we have the language switch changing the comma


Add MockOracle for APIConsumer & tests

This PR adds MockOracle.sol for use with APIConsumer.sol tests in APIConsumer.t.sol.

Left a few comments, but all in all, this is awesome!

Also, do you think we should use the test.t.sol filename convention for tests?

Left a few comments, but all in all, this is awesome!

Thanks for the quick review, and glad you think so! Will start addressing comments and request re-review when ready.

Also, do you think we should use the test.t.sol filename convention for tests?

Yes, I think this convention is pretty standard from other repos I've seen using Foundry -- so I guess we should change the other file names to reflect this?

Thanks again for making this!


GLBuffer-related bug fixes

A small set of fixes for issues I ran into when using GLBuffer inputs directly.
Note that I first fixed iterate(::GLBuffer) before replacing the implementation (so that we can always go back to the old implementation, but in a working state), which means it may be better to merge this instead of squashing the commits.

Thanks :) I think squash merge is fine (the others are disallowed and I don't think it's too bad to still squash)...


[neovim] Terminal window fails to close with 'up'/'left' option

In Neovim, calling fzf#run() with the 'up' or 'left' options results in the terminal window not closing when fzf exits (either by accepting an item or hitting ESC). Using 'down' or 'right' instead works as expected.
I can reproduce the issue using this example from the wiki by changing 'down' to either 'up' or 'left'.
https://github.com/junegunn/fzf/commit/355d004895eb8cb7e6ca7f8cf0b095f381d6e41b looks like it could be the culprit.

Thanks for the report. I believe the above commit should fix the problem. Let me know if you see any issues.

Confirmed fixed. Thanks.


Added checks for template index.

Fixes #834  .
Changes proposed in this PR:

add cap for ERC20 enterprise token creation

Please add tests to keep coverage the same. I would recommend and expect over 90% differential coverage.

The code looks MUCH better. To quote a classic, "another life".
Please add the exception tests and we're good to go.


HEAD is now at cfacdc1 fix: CLI analytics fix (#101) error: failed to parse lock file at: /root/.nexus/network-api/clients/cli/Cargo.lock

Running scripts with one click always seems to be a problem

how to fix it

yes,
error: failed to parse lock file at: /root/.nexus/network-api/clients/cli/Cargo.lock
Caused by:
  lock file version 4 requires `-Znext-lockfile-bump`

same


Minor edits to Docker Automation Docs

This patch updates the Docker Automation PR to include a leading $ at the beginning of each command line to indicate the beginning of a new shell command. Additionally, the commands are split into multiple steps to make the process more visually evident.
To compare and contrast:
Old Layout

Patched Layout

LGTM


Scrolling is not smooth in insiders

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

VS Code Version: 1.64.0-insider
OS Version: Catalina

Steps to Reproduce:

Install VSC Code insiders.
Version: 1.64.0-insider (Universal)
Commit: 16856037e075275f53b25b7e2dec2303e8e25728
Date: 2022-01-19T05:14:31.474Z (1 day ago)
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 19.6.0
Jupyter v2022.1.1001717102 pre-release
Work in the .ipynb with a conda kernel. Scrolling is not smooth. It stops from time to time.

@RGBYCP can you please share the notebook you were using?


Update Vulkan headers to v1.2.182

Verbatim header snapshot from the KhronosGroup/Vulkan-Headers git repo.
Required for the extensions used by https://github.com/doitsujin/dxvk/pull/2260

Since I'm here I'm happy to update these to the now-latest version - ~1.2.191 rather than this PR's 1.2.182.  But I've been building and testing against 1.2.182 and haven't really proven 1.2.191 so :shrug:


arm: mcux (RT1060 EVK) fix USB fail when using on-chip memory, fix #27268

Adds the couple SCB_DisableDcache & SCB_EnableDcache when
config the non-cache area
Signed-off-by: Crist Xu<EMAIL_ADDRESS>

Can you explain in the commit message why disabling the cache before setting up the mpu region addresses the issue.

Updated， And could you please help try if this can fix the issue?

I dont know enough about the ARM cache's to say, but it seems like having the code you had before was safer. To Disable (which will Clean & Invalidate) the d-cache and having it disabled before we setup the MPU region.
@ioannisg @MaureenHelm any thoughts?

I think that the cleaning and invalidation of the D-cache has little to do with the MPU driver initialization, ti begin with.
So I would better see this called in SoC init or platform-init code.
Also, for platforms that have Cache (not sure if this is present in all Cortex-M7 implementations, maybe @CristXu you can investigate this).

Through the Cortex-m7's block diagram, it seems that both the D-Cache & I-Cache are all exists, but yes, i will investigate some MCU to see if they all support the cache.

@MaureenHelm @jfischer-phytec-iot @CristXu can we agree to a fix here?

@CristXu will you pick this up this week or next? We need to fix this for 2.4.

@CristXu will you pick this up this week or next? We need to fix this for 2.4.

Hi，I am waiting for the reponse from the reviewer, no one comment or approve my method.

@CristXu thanks for your investigation.
I think that calling the SCB function for cleaning and invalidating the cache for all Cortex-M7 should be OK to do.
My concern is that it should be executed

only if the no-cache region is used (there are #ifdef's for this)
as part of some ARCH-initialization code. I feel, it should not be done in the static region configuration. I think it fits better in some cortex-m init code, or, at a last resort inside arm_mpu_init code

@CristXu thanks for your investigation.
I think that calling the SCB function for cleaning and invalidating the cache for all Cortex-M7 should be OK to do.
My concern is that it should be executed

only if the no-cache region is used (there are #ifdef's for this)
as part of some ARCH-initialization code. I feel, it should not be done in the static region configuration. I think it fits better in some cortex-m init code, or, at a last resort inside arm_mpu_init code

Hi, Updated the new code, put the cache operation inside the arm_mpu_init, controlled by the CONFIG_NOCACHE_MEMORY


Repurpose INST from DEFINE-VOP for DEFINE-COMPILER

Bytecode generation in SBCL looks something like this:
(define-vop (fast-negate/signed signed-unop)
  (:translate %negate)
  (:generator 2
    (move res x)
    (inst neg res)))

and (after #210) compiled circuit fabrication in quilc looks something like this:
(define-compiler sort-RX-after-Z
    ((x ("RX" (theta) q))
     (y ("RZ" (pi)  q)))
  (list (build-gate "RZ" `(,pi)       q)
        (build-gate "RX" `(,(- theta)) q)))

quilc could benefit from adopting the macro inst, which stows an instruction to be eventually output at the termination of the bytecode generation routine, rather than relying on the compiler author to manually manipulate the list of instructions being returned.
@stylewarning brought this up here, where he also provided an example implementation: https://github.com/rigetti/quilc/pull/210#issuecomment-511951521 . Overall, I think this is a great idea, but I think that the exact implementation that we adopt should...

... hew closer to the VOP version than is presented in the example. One instruction at a time is probably fine; we can try to provide an inst* if it isn't.
... be terser than in the example. In the VOP version, the &rest arguments are used to define the new instruction, and the symbol neg is used to designate a particular operation. If we used the example as-is, we'd have to write (inst (build-gate ...) (build-gate ...) ...), which I find distasteful.

Before I get around to working on this issue, I'd like to solicit other advice about how to make this look its prettiest.

I haven't actually solicited any further advice, but I feel much more confident that I know what I'd like it to look like. Gonna self-assign.


Add Position Sensitive ROI Align functions

rename psroi_pooling -> ps_roi_average_pooling
add ps_roi_average_align
add ps_roi_max_align

Position Sensitive Functions are needed for light-head-rcnn

Split into #795 and #796


Expose some way to use DisposableObjectPool

Is your feature request related to a problem? Please describe.
#973 introduced disposable object pool, but it is not exposed via public API. Manually casting the pool to IDisposable is considered implementation detail, and make it denied in certain projects.
Describe the solution you'd like
Expose the pool type with where T:IDisposable constraint, and expose a factory for it.
Additional context
The behavior of the pool should also be well documented.

and expose a factory for it.

There is DefaultObjectPoolProvider.
From https://github.com/aspnet/Extensions/pull/977

DefaultObjectPoolProvider will choose on T which object pool to create. If T implements IDisposable the (new) DisposableObjectPool will be created, else the DefaultObjectPool.

Why do you think the DisposableObjectPool<T> should be public?

The behavior of the pool should also be well documented.

For this see also https://github.com/aspnet/Extensions/issues/973#issuecomment-549964133

There is DefaultObjectPoolProvider.

The requirement is public signature of factory creation implements IDisposable.

Why do you think the DisposableObjectPool<T> should be public?

The pool's lifetime is bounded to certain medium-life object. When the object is disposed, preserved objects in the pool should be also disposed.

When the DisposableObjectPool<T> gets disposed, all items held in the pool currently will get disposed.
Also you can use ObjectPool.Create<T> if you don't want to use DefaultObjectPoolProvider.

When the DisposableObjectPool<T> gets disposed

If DisposableObjectPool is not exposed, this will require casting ObjectPool<T> to IDisposable, which was strongly rejected.

If you're using DI to construct your object pool then the DI service collection will see that the object pool implements IDisposable and will invoke the Dispose method for you. No need for you to cast and dispose it.
See https://docs.microsoft.com/en-us/aspnet/core/performance/objectpool#objectpool-sample for an example of using DI to construct your object pool. In this example, the pool will be disposed on shutdown since it is created as a singleton. If the pool was created as a transient or scoped service then the lifetime would obviously be shorter and Dispose called earlier.

If you're using DI to construct your object pool

Obviously, I'm not using DI, and the project structure is fundamentally unsuitable for DI.

Not sure how that was obvious. :)
It also seems unnecessary to me that DisposableObjectPool be kept internal. The only reason I can see for doing that is to avoid confusion. These classes are very lightly documented so keeping DisposableObjectPool internal and out of the documentation helps avoid confusion for people who should not be using it directly -- most people using this library are using DI. But a bit of doco on the classes themselves could solve that problem.


Deleting the channel thread does not close the ticket

I've had this bug present ever since the bot was in 2.31.0 beta 0 and now, we're in beta 2 and it's still present

If you delete a channel, how is the bot supposed to know (as it is not monitoring things in real-time)?  To close the thread, use the command to do so (e. g. !close as described at https://github.com/Dragory/modmailbot/blob/master/docs/commands.md#close).  The bot will then take care of deleting the channel.

Yea i didn't know that at the time..


allow for keystores that are part of android source

change is to add a checkbox to allow the user to select to upload a external keystore
@mikenairn

Verification
Create an android release build using the following branch https://github.com/maleck13/android-showcase-template.git AEROGEAR-3309-android-source-keystore
After creating the build click through to the buildconfig and edit the yaml add the following env vars
       - name: KEYSTORE_PASSWORD
          value: 'ASK ME FOR THIS'
        - name: KEY_PASSWORD
          value: 'ASK ME FOR THIS'

save and start the build. The release build should work as expected
@wei-lee watched as I did this


Incorrect Screenshot!

At the very first step under 'Upgrade QnA Maker Management SKU' screenshot attached has highlighted 'Key' section, instead of 'Pricing Tier'

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

ID: 2b37a802-217f-b898-b2fe-c5ec2523b470
Version Independent ID: 6b0d781a-f711-5215-d875-caa046c6b8f4
Content: Upgrade your QnA Maker service - Microsoft Cognitive Services - Azure
Content Source: articles/cognitive-services/QnAMaker/How-To/upgrade-qnamaker-service.md
Service: cognitive-services
GitHub Login: @nstulasi
Microsoft Alias: saneppal

@KasamShaikh Thanks for bringing this to our attention. Your feedback has been shared with the content owner for further review.

@KasamShaikh Good catch. This will be fixed. #in-progress

@KasamShaikh This has been fixed and is now live.

#please-close


Generate PSP as well as role/rolebindings for namespaces

Is your feature request related to a problem? Please describe.
Generate the followings:

PSP
Role that use the PSP
Rolebinding for service account and Role

Describe the solution you'd like
N/A
Describe alternatives you've considered
N/A
Additional context

fixed in #35


Show/reference normal ansible/ansible-playbook options as well

From Simon:

One thing I've been wanting is to be able to show the normal ansible command options. Since we pass those through it would be nice to be able to know what they are. It's still possible to just run ansible-playbook --help to get them so I guess we could just add that as a note to the help docs.

I think it's possible to customize usage, but I'm not sure how easy it is to

mix default and custom usage notes
customize usage notes specifically on subparsers
pull usage notes from another argparse process either via python or by parsing the CLI

I can look into 1 & 2 first, as simply noting "See ansible -h for more options" is an improvement. If we do three, not sure how smart we want to be versus just including a note "In addition, all ansible CLI options, included below for your convenience, are also available" and basically dumping the full ansible -h output at the bottom.


Integration without password

see discussion: https://github.com/leeyuentuen/alfen_wallbox/discussions/73

Close this, will not supported


Pass arguments to errors in YAML

Here is what I have in my errors file:
en:
  errors:
    not_a_date?: "is not a date"
    after?: "must be after %{date}"
    after_or_equal_to?: "must be after or equal to %{date}"

I also added custom predicate:
module Lion
  module Predicates
    include Dry::Logic::Predicates

    predicate(:after_or_equal_to?) do |value, current|
      current >= value
    end
  end
end

Currently if current value is less then required date it returns false, but I need to pass :date key to populate my error.
Don't understand how this can be done.
Thanks.

This will be supported OOTB with the new rule API in 1.0.0


[e2e]: go release main config-ldflags-assets-tag slsa3

Repo: https://github.com/slsa-framework/example-package/tree/v23.0.132
Run: https://github.com/slsa-framework/example-package/actions/runs/3326286303
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.release.main.config-ldflags-assets-tag.slsa3.yml
Workflow runs: https://github.com/slsa-framework/example-package/actions/workflows/e2e.go.release.main.config-ldflags-assets-tag.slsa3.yml
Trigger: release
Branch: v23.0.132
Date: Wed Oct 26 04:56:46 UTC 2022

Repo: https://github.com/slsa-framework/example-package/tree/v23.0.133
Run: https://github.com/slsa-framework/example-package/actions/runs/3334583447
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.release.main.config-ldflags-assets-tag.slsa3.yml
Workflow runs: https://github.com/slsa-framework/example-package/actions/workflows/e2e.go.release.main.config-ldflags-assets-tag.slsa3.yml
Trigger: release
Branch: v23.0.133
Date: Thu Oct 27 04:57:28 UTC 2022

Repo: https://github.com/slsa-framework/example-package/tree/v23.0.139
Run: https://github.com/slsa-framework/example-package/actions/runs/3364396219
Workflow file: https://github.com/slsa-framework/example-package/tree/main/.github/workflows/e2e.go.release.main.config-ldflags-assets-tag.slsa3.yml
Workflow runs: https://github.com/slsa-framework/example-package/actions/workflows/e2e.go.release.main.config-ldflags-assets-tag.slsa3.yml
Trigger: release
Branch: v23.0.139
Date: Mon Oct 31 20:18:39 UTC 2022
Tests are passing now. Closing this issue.


Iteration method stuck in a loop when parent process dies

Hello,
I refer to issue #298.
As it happens to the guy who opened it, the script execution gets stuck inside the for loop that flows the messages from the mqtt broker.
I read in the code of the updated library, in the anext() function that it is unblocked only for:
-disconnecting the broker
-iterating over the next arrived message
However, when the thread/task is a child of another process that dies, its execution gets stuck inside the function and so there is no way to kill the child as well.
I tried the given solution but it overloads the CPU.
To solve this problem I would propose to use the function threading.Event.variable_name.is_set() which checks the state of an asserted flag of the parent process in case it dies.
This check should be put inside the function that iterates anext() messages, so as to interrupt execution.
async def __anext__(variable_name) :
    [...]

    if variable_name.is_set():
        raise Exception("Parent died")

    [...]

Are there better solutions?
Translated with DeepL.com (free version)

Hi there, thanks for opening this issue!
The behavior you describe (__anext__ only returns on disconnection from the broker) is expected and IMO also the right one. What speaks against your proposed changes is that we might still want to be able to start a task that listens for messages in a fire-and-forget way.
Nonetheless, your use case sounds reasonable, so let's see how we can solve it 🙂 I'd suggest using a TaskGroup. The documentation states that "If the body of the async with statement exits with an exception [...] the remaining tasks are cancelled and then waited for, and non-cancellation exceptions are grouped into an exception group and raised."
Let's see an example:
import asyncio
import aiomqtt

async def child():
    print("Child task running")
    try:
        async with aiomqtt.Client("test.mosquitto.org") as client:
            await client.subscribe("temperature/#")
            async for message in client.messages:
                print(message.payload)
    except asyncio.CancelledError:
        print("Child task cancelled")

async def parent():
    print("Parent task running")
    async with asyncio.TaskGroup() as tg:
        tg.create_task(child())
        await asyncio.sleep(1)
        print("Raising exception in parent task")
        raise Exception

asyncio.run(parent())

Let me know if that helps! 🙂

Thank you for your suggestion.
It works, but in order to catch the exception asyncio.CancelledError the client must be alive until the parent dies, causing the CPU to overflow.
# Method to kill thread if parent thread is dead
async def client_killer(t):

    # Polling if parent is still alive
    while not shut_down_event.is_set():
       await asyncio.sleep(0)

    closing_result = t.cancel()

async def client_main(argv,  name_th):

    try:

        async with aiomqtt.Client(brokerIP,port) as client_BandR:
            await client_BandR.subscribe(topic_to_read, qos)
            async with asyncio.TaskGroup() as tg:
               # client_Task is the main function to execute
                task = tg.create_task(client_Task(client_BandR))
               # killer of client_Task
                await client_killer(task)

    except Exception as e:
        u.exception_handler(e)

If we fix the code with  the code I suggested earlier, there is no more need of the while in the killer task.
What do you think?

Thanks for reporting back! 👍
You're right that we should really avoid the await asyncio.sleep(0). There's a lot we can do with asyncio and without changes to aiomqtt. The RealPython asyncio walkthrough is a good introduction to asyncio and the official asyncio docs are a good reference.
If you want to cancel the client manually inside the parent, you can do something like this:
import asyncio
import aiomqtt

async def child():
    print("Child task running")
    try:
        async with aiomqtt.Client("test.mosquitto.org") as client:
            await client.subscribe("temperature/#")
            async for message in client.messages:
                print(message.payload)
    except asyncio.CancelledError:
        print("Child task cancelled")

async def parent():
    print("Parent task running")
    async with asyncio.TaskGroup() as tg:
        task = tg.create_task(child())
        await asyncio.sleep(1)
        # Do something that might raise an exception on which the child should be prematurely canceled
        if False:
            print("Raising exception in parent task")
            raise Exception
        # Cancel the child task manually
        print("Canceling the child manually")
        task.cancel()
    # Do other things
    print("Doing other things inside the parent")
    await asyncio.sleep(2)

asyncio.run(parent())

Let me know if that helps 🙂


[PE-D][Tester D] Sample data tags not very representative of the problem

Current tags for sample data do not seem to reflect the nature of CS1101 Tutor storing their students information. This might be confusing for a new user trying out the sample data.

Labels: severity.Low type.FeatureFlaw
original: joelgoh1/ped#7

Add this to planned enhancements in DG

Closed as this has been added to planned enhancements


Body measurements ?

Hello, thank you for your amazing implementation
How can we measure the body measurements like waist, neck to hand, chest etc.
Thank you

Hi, thanks for your interest.
I'm not sure I understand your question, but currently Pose2Mesh cannot measure the exact length of human body parts as most of other methods.
If you can obtain the absolute depth of a person in image using methods like https://arxiv.org/abs/1907.11346, you can measure the exact length of human body parts.
For example, you can train Pose2Mesh to estimate normalize 3D mesh and pose relative to a fixed focal length.
If you have more questions, feel free to ask!


Improvements to UI/UX, bug fixes, documentation (README.md), security.

Here is a list of the changes:
General
- Improved UI/UX.
- Bug fixes.
Navigation
- Menu is now compatible with mobile devices.
- Login/Logout menu is now context sensitive. Both will no longer appear at the same time.
Header/Footer
- Header and Footer are now easier to configure (header.php and footer.php).
Home (Take Attendance)
- You can now filter the class list on the Take Attendance page.
- When you first access Attendance System, you will be prompted to create an Administrator account. Use this to start creating Classes, Teachers and Students.
- Take Attendance list is now sorted by class.
- Readonly fields on Take Attendance page no longer look like they are editable fields.
Register
- You can no longer create multiple classes with the exact same name (case insensitive).
- You now need to be logged-in to Register teachers and students.
- Class dropdown list on Register page is now dynamically generated.
Classes
- You now need to be logged-in to create classes.
- Added ability to add, view and delete classes.
Report
- Teachers can now access the attendance report without having to login as a student.
Login/Logout
- Fixed logout. Now always works.
- Students can no longer login.
Documentation
- Improved documentation.
- Added To Do list so you know what doesn't work and needs fixing.
Best regards,
Michael MIlette

Please ignore. Will submit a new pull request without conflicts.


Fix fetching setting for plat and dev spacelift stacks

why
for the plat and core spacelift modules the variable root_admin_stack_config is not set. Therefore the stack config null, but in our case we need github_enterprise to be set.
what
Read the config from the stack config as it is there also available.

closing in favour of #904


Week 6

[ ] 1. mmap
[ ] 2. tcp\udp address
[ ] 3. ioctl
[ ] 4. exec

https://segmentfault.com/a/1190000005138358


Cannot see the list of snippet files

Hi
To eliminate effects from personal settings and other plugins, I restricted environment to needed minimum:
LC_MESSAGES=C vim -i NONE -u /dev/null --cmd "set nocp runtimepath=~/.vim/bundle/tlib,~/.vim/bundle/mw-utils,~/.vim/bundle/snipmate"

After running :SnipMateOpenSnippetFiles I get
Error detected while processing /home/paprykarz/.vim/bundle/snipmate/autoload/snipMate.vim:
line  445:
E127: Cannot redefine function snipMate#OpenSnippetFiles: It is in use
Error detected while processing function snipMate#OpenSnippetFiles:
line    1:
E117: Unknown function: snipMate#GetSnippetFiles
E15: Invalid expression: snipMate#GetSnippetFiles(0, snipMate#ScopesByFile(), '*')

and cannot see the list of files. It does not depend on whether any snippets are installed or not.
I have current (0075bb87e60a9233c274e6d43ae8720d3f5f0015) version, but the problem occured also before. Vim version: 7.4.488 from Debian sid.

Of course, this is issue for snipmate, sorry. I try to remove this false issue if possible.


DCO test

Signed-off-by: Daniel Hardman<EMAIL_ADDRESS>

This was just a test. No merge needed.