Update script

Hi @pablobiedma
Love the work you've put in to this, but I think some elements are not working anymore. I get the "unable to locate element" error for example.
Would it be possible to update the script so it works with the latest changes to the site?
Would love to help out where I can btw!

Hello @ybjlus thank you for your interest in this repository :)
I understand that it is no longer working as intended.
One of the main reasons is that I originally based it on XPATHs that are dynamically changing so the code is not finding the right buttons as the links are different.
At present I am extremely busy with work, study, and projects, and, much to my dismay I wouldn't be able to devote the required time to get this to work 100% again. I really hope you understand.
Nonetheless, it would be amazing if you could make some functioning modifications, for instance, updating the XPaths, or changing the structure of the script to make it generalizable rather than XPath-specific and requiring constant updates (maybe GPT can help in modifying the code). If you managed to do this, I would be most thankful, feel free to create a Pull Request and I'll accept it.
Thank you for your understanding, I hope you understand. Keep me updated.
All the best,
Pablo

Of course I understand! Its a hobby project after all!
Yeah I saw the xpath's being wrong, I've corrected a few and it definitely solves some of the problems.  But after some research I think the api approach is more viable and more future proof. Especially for tickets which are like really really popular.
Thnx for the reply btw!

Is it possible to share the updated code? Would love to get some tickets for me and my friends.

Hi ybjlus, did you share it anywhere?
Thanks in advance!

Hi ybjlus, did you share it anywhere?
Thanks in advance!

Hi,
No I didn't, because I just played around with it. Quickly corrected some x paths to see how it worked.

Hi,
I think you won't share it then, or do you maybe want to share it with me?
I'm trying to get tickets for my friends, but this site is the worst.

Hi,
I think you won't share it then, or do you maybe want to share it with me?
I'm trying to get tickets for my friends, but this site is the worst.

I didn't save anything, it was just a quick test to see how this script worked.

@Williehack Nope, am currently trying a macro on my android using MacroDroid.

okay how can i uninstall the npm (if that makes sense, i dont know anything about this I just wanted to reserve tickets on ticketswap lol)

@Williehack uninstall the what?


Competitive Programming Contests?

Hello !! may I add several Competitive Programming Contests?

Sure, contributions are welcome :)


[BUG] input nic ip and vip with same ip address in Harvester-Installer

Describe the bug
when input nic ip and vip with same ip address, not any verify message.
To Reproduce
Steps to reproduce the behavior:

set the nic ip first, eg: <IP_ADDRESS>, and next.

set the vip ip, eg: <IP_ADDRESS>.

Expected behavior
they mustn't be same, mustn't to continue
Environment:

Harvester ISO version: v1.0.0
Underlying Infrastructure (e.g. Baremetal with Dell PowerEdge R630): intel xeon e5-2678

Verified fixed on master-26bff4f1-head (6/10). Close this issue
Result
During Harvester ISO installer process, when we set static node IP address with the same one as the VIP IP address
There will be an error message to prevent the installation process
VIP must not be the same as Management NIC IP

Test Information

Test Environment: 1 node harvester on local kvm machine
Harvester version: master-26bff4f1-head

Verify Steps

Launch ISO install process
Set static node IP and gateway

Set the same node IP to the VIP field and press enter

@chrisho
Please also update doc, claim that the VIP should be different than any NODE IP. Thanks.
https://docs.harvesterhci.io/v1.0/install/management-address/

Just NOTE, backport PR is on https://github.com/harvester/harvester/issues/2377


Wrapping div causes styling limitations

This is:

Bug
Feature request

Specifications

version:
OS:
Browser:

Expected Behavior
Passing the <input> a grid item property via the getDropZoneProps should result in the <input> being laid out upon the grid
Actual Behavior
Due to to the component's wrapping <div>, the <input> is not a direct child of a wrapper with the display: grid property, and so is not placed on the grid.
Steps to Reproduce the Problem

Place <Files /> component within a wrapping <div> with the css property of display: grid and other grid related syntax
Pass css props via getDropZoneProps placing the input on a grid (e.g. grid-column: 1/2
input will not position correctly

Detailed Description
See pull request
Possible Solution
See pull request

Closed by https://github.com/doitadrian/react-butterfiles/pull/3.


do we care about this

http://projecteuclid.org/euclid.aoas/1469199886
i couldn't download it for some reason

nope, cannot get it there...I also asked Youjin and no success.
If you really want to see it I will email the author?
On Mon, Aug 22, 2016 at 9:29 PM, joshua vogelstein<EMAIL_ADDRESS>
wrote:

Assigned #94 https://github.com/jovo/MGC/issues/94 to @cshen6
https://github.com/cshen6.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jovo/MGC/issues/94#event-763853907, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ALX0y56ZpEYqeP8zOhWKBjSVaSwc8KRqks5qikzfgaJpZM4Jqd3m
.

AOAS1601-012RA0.pdf
found it.  the senior author wrote about quantifying dependency (we cite it),
so i wanted to see if it is relevant for mgc, but doesn't seem particularly relevant.


Find command bugs v1.4

Fix situation where random words are allowed as a preamble to the find command. Now only accepts find unpaid. (Resolves #131 , resolves #145, resolves #149)
Also change clear command's success message to mention HeRon. (Resolves #166)

Codecov Report

Merging #189 (24653fc) into master (d677d8a) will increase coverage by 0.20%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #189      +/-   ##
============================================
+ Coverage     60.63%   60.84%   +0.20%
- Complexity      672      678       +6
============================================
  Files           130      130
  Lines          2688     2692       +4
  Branches        336      338       +2
============================================
+ Hits           1630     1638       +8
+ Misses          933      930       -3
+ Partials        125      124       -1

Impacted Files
Coverage Δ

...ava/seedu/address/logic/commands/ClearCommand.java
100.00% <ø> (ø)

.../seedu/address/logic/parser/FindCommandParser.java
36.14% <100.00%> (+2.81%)
:arrow_up:

...model/person/predicates/PersonIsPaidPredicate.java
66.66% <0.00%> (+66.66%)
:arrow_up:

Continue to review full report at Codecov.

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


WslRegisterDistribution failed with error: 0x80070057

Windows Build Number
Microsoft Windows [Version 10.0.21370.1]
WSL Version

[X] WSL 2
[ ] WSL 1

Kernel Version
5.10.16
Distro Version
No response
Other Software
No response
Repro Steps
install wsl distribution
Expected Behavior
wsl distribution installed.
Actual Behavior
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070057
Error: 0x80070057 The parameter is incorrect.
Diagnostic Logs
No response

This is a duplicate of WSL2 distro not starting since 21364 build

Thanks arunse, this fixed the issue.


[FEATURE] Open Saved folder

There is a button to open the installation directory. What I always missed in ASM was a button to open the Saved folder.
That's where you spend most of your time :grin:
...\ShooterGame\Saved

I understand but how hard is it to go into one directory, I understand your reason but if we add buttons for everything like this the UI will get bloated.

I agree with you, it was just a suggestion. :relaxed:

👍 please keep suggestions in the feedback channel in discord


model.reload() don't update fragmentArray properties (using v6+ and ember-data 4.6)

Hello!
First thanks a lot for the awesome work to make this repository compatible with Ember 4+ 🙏
With version 6 of this addon and ember-data 4.6 we found a little issue, when using model.reload(), fragmentArray properties are not updated correctly
https://github.com/adopted-ember-addons/ember-data-model-fragments/assets/56396753/f18349d0-72d3-4e20-9520-1889b74784cf
If we are looking at model.currentState.recordData.__fragmentData['myProperty'], it contains correct values, but model['myProperty'] still contains the initial value
Reproduced here -> https://github.com/ndekeister-us/ember-test-app_ember-data-model-fragments

I've also experienced not seeing reload on ED 3.28. It looks like this test for reloading is skipped, and it is failing if ran.

I checked out the sample repo here and the PR that I got merged doesn't resolve this issue (because of this rollback). This code is the issue (even though I thought it might not be necessary):
if ((updates[key] === null) !== (original[key] === null)) {
  changedKeys.push(key);
}

It handles if the fragment is null or is becoming null, but doesn't actually detect changes (as the _changedFragmentKeys function name implies).
I'm not sure what the best way to detect changes here. My initial attempt was checking if they === each other, which doesn't work for arrays (so it was always triggering, which did fix the bug). I considered verifying on length and clientId:
let wasOrBecameNull = original[key] === null || updates[key] === null;
let isDifferentLength = original[key]?.length !== updates[key].length;
let hasNewIds = !updates[key].every(record => original[key].includes(record.clientId));
if (wasOrBecameNull || isDifferentLength || hasNewIds) {
  changedKeys.push(key);
}

I've tested this on the provided reproduction (thanks @ndekeister-us!) and it works (as well as a repro in my app), but I haven't written a test for it yet.

@ndekeister-us Can you verify that the latest commit (not released package) works for you?

Released as v6.0.2

Thanks a lot for the fix + release, tested on our main application and on the demo app and it is now working as expected 🎉


Implemented "authorization" error type

Fixes #40

Changes Unknown when pulling 4336ed419920705097fb6ad72fee64cae2ab4d50 on feature/40 into ** on develop**.


Don't change load-balancer endpoint when updating the service

Currently, when we change a service with a LoadBalancer, we will often delete the load balancer and create a new one.  If possible, we should not do that: on GCE it may involve temporary service disruption, although the new LB has the same IP.  On AWS a new ELB is created with a different DNS name, so the user must update their DNS settings.
(We have a PR that fixes this #8366, but it is post-v1; I am filing this bug to document the improvement needed, and then changing the tests to test the current state of the world)

How is the LB preserved?  #11175 indicates it is NOT preserved, making this higher prio.

We do have an e2e test for this, but perhaps it isn't testing what I think it is.  #11030 highlights that we definitely don't preserve it on AWS, but the test should be checking that it is preserved on GCE.


[MM-29844] Fixed email input to allow multiple emails to be typed and trigger validation on more cases

Summary
When copying and pasting emails over the limit, the control wouldn't allow the email to be added, but would still disable the Send button, requiring the user to delete an email unnecessarily.
This PR allows the users to enter as many emails as they want, but will trigger validation on each addition and on typing to ensure that more than 10 cannot be sent out.
Ticket Link
https://mattermost.atlassian.net/browse/MM-29844

/cherry-pick cloud-ga

Cherry pick is scheduled.


Demiroğlu Bilim University

@msinandemir First stage of verification passed, official domain is demiroglu.bilim.edu.tr as far as I verified. This is just an informational note. Pull request is still in the review. I appreciate your patience while waiting for the final decision.

@msinandemir Please provide us with an URL of a page on the official website where the school offers an IT-related long-term (>1 year) course. Thank you!


Issue on page /tutorials/basic-git.html

Found a typo - in the section 'Setting up Git' and below the pink text 'jupyterlab-git' -- the second occurrence of pink text has 'jupyterlag-git'. That is, 'lag' instead of 'lab'.

Closing this as it seems a duplicate of #29


Add ContextManager interface and AsyncHooks implementation

As defined in https://github.com/open-telemetry/opentelemetry-js/issues/46, i've not use types already available in the core package since the goal is for those package to be standalone.
I didn't really tested the implementation (specially the async hooks one) since the API isn't finished but i will add more test in a separate PR.
I mostly based the API on the Opencensus one, i will explain the choice i made for each function so we have a starting point for the discussion.

cc @rochdev @bg451 @hekike @draffensperger

Thanks for the PR. I would suggest to split this huge PR in a few smaller PRs.

Initial skeleton for base
Initial skeleton for AsyncHooks (If you want, you can combine 1 and 2)
Add ContextManager interface
AsyncHooks implementation

thoughts?

Sure no problem @mayurkale22

I made two new PR over there https://github.com/open-telemetry/opentelemetry-js/pull/65 and https://github.com/open-telemetry/opentelemetry-js/pull/66, please review on those


Failed in running docker 1.9.1 & docker 1.11.1 in CORE on Fedora23

Dear Mr. Sebastiaan,
I have failed in running docker 1.9.1 & docker 1.11.1 in CORE on Fedora23
I have taken more than a week to solve it, but I failed.
Could you help me and give some suggestions?
please look at [https://forums.docker.com/t/unable-to-run-docker-images-in-core-on-fedora23/10846]
Best regards,
Tongguang Zhang

now, I make testing again.
//on the host
[root@localhost ~]# systemctl start core-daemon.service
[root@localhost ~]# core-gui
//within a running node
[root@n1 n1.conf]# docker daemon -s overlay &
[1] 78
[root@n1 n1.conf]# INFO[0000] New containerd process, pid: 83
WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=4096
INFO[0001] Graph migration to content-addressability took 0.00 seconds
INFO[0001] Default bridge (docker0) is assigned with an IP address <IP_ADDRESS>/16. Daemon option --bip can be used to set a preferred IP address
WARN[0001] Your kernel does not support swap memory limit.
WARN[0001] Your kernel does not support memory reservation.
WARN[0001] Your kernel does not support oom control.
WARN[0001] Your kernel does not support memory swappiness.
WARN[0001] Your kernel does not support kernel memory limit.

INFO[0001] Loading containers: done.
INFO[0001] Daemon has completed initialization
INFO[0001] Docker daemon                                 commit=5604cbe graphdriver=overlay version=1.11.1
INFO[0001] API listen on /var/run/docker.sock
**[root@n1 n1.conf]# docker images                                                                                **
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             core                47bcc53f74dc        7 weeks ago         1.113 MB
busybox             latest              47bcc53f74dc        7 weeks ago         1.113 MB
[root@n1 n1.conf]# docker run --rm -it busybox /bin/sh
ERRO[1245] containerd: start container                   error=oci runtime error: mkdir /sys/fs/cgroup/cpuset: no such file or directory id=cf230dc842200141ab7126161c19b2419b5452714a741a341e6e161d101edb11
ERRO[1245] Handler for POST /v1.23/containers/cf230dc842200141ab7126161c19b2419b5452714a741a341e6e161d101edb11/start returned error: Container command '/bin/sh' not found or does not exist.
docker: Error response from daemon: Container command '/bin/sh' not found or does not exist..
[root@n1 n1.conf]#

root@n1 n1.conf]# docker info
Containers: 3
Running: 0
Paused: 0
Stopped: 3
Images: 1
Server Version: 1.11.1
Storage Driver: overlay
Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge
Kernel Version: 4.4.8-300.fc23.x86_64
Operating System: Fedora 23 (Twenty Three) (containerized)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.527 GiB
Name: n1
ID: SBWK:GW6I:EMT7:3FZE:DMIU:UYBH:BF3R:C7MB:SDBH:OW4C:ZCCM:2BHF
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
WARNING: No cpu shares support
WARNING: No cpuset support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
[root@n1 n1.conf]# docker version
Client:
Version:      1.11.1
API version:  1.23
Go version:   go1.5.4
Git commit:   5604cbe
Built:        Wed Apr 27 00:57:43 2016
OS/Arch:      linux/amd64
Server:
Version:      1.11.1
API version:  1.23
Go version:   go1.5.4
Git commit:   5604cbe
Built:        Wed Apr 27 00:57:43 2016
OS/Arch:      linux/amd64
[root@n1 n1.conf]#

I'm trying to understand what CORE is doing; is CORE also creating a container, and you're trying to run docker inside that? (you mention "within a running node") I don't have any experience with CORE, so wondering what it actually does here

I am using the latest CORE, that is version 4.8.
Here, [http://www.finmars.co.uk/blog/9-core-and-docker-together-at-last] , use  CORE 4.7.
Here, [http://www.finmars.co.uk/blog/6-common-open-research-emulator-core] , gives introduce to CORE.
The official web site, [http://www.nrl.navy.mil/itd/ncs/products/core]

Have you tried to run the daemon in debug mode (docker daemon --debug ....) to see if there's any useful output? The tutorial you're linking to is over a year old, and a lot has changed in Docker that may influence this. Have you tried contacting the CORE developers, is Docker still supported in CORE? I had a quick look at their GitHub repo, and there doesn't seem to be a lot of activity; there's one pull request to improve the stability of docker in CORE, but that's also created a year ago

yes, maybe you are right. I am contacting  the CORE developers. Thank you for your help very much.
[root@localhost core]# ll kernel/
总用量 48
drwxr-xr-x. 3 root root 4096 4月  27 16:02 core-kernel-2.6.38
drwxr-xr-x. 3 root root 4096 4月  27 16:02 core-kernel-3.0
drwxr-xr-x. 3 root root 4096 4月  27 16:02 core-kernel-3.2
drwxr-xr-x. 3 root root 4096 4月  27 16:02 core-kernel-3.5
drwxr-xr-x. 3 root root 4096 4月  27 16:02 core-kernel-3.8
drwxr-xr-x. 5 root root 4096 4月  27 16:02 freebsd
[root@localhost core]#

If it's using kernel 3.8, that may well be the issue; docker needs kernel 3.10 as a minimum (although 3.8 may somewhat work).
I'll close this issue for now, but feel free to comment after I closed

thanks for your help again.


chore: release 2.0.4

:robot: I have created a release *beep* *boop*
2.0.4 (2019-07-11)
Bug Fixes

allow methodConfig to override request method and uri (#451) (8c2f903)

This PR was generated with Release Please.

@stephenplusplus Are you okay with releasing this as a patch and deferring the TypeScript changes to a major release?

Yep, let's do it!

Release is at https://github.com/googleapis/nodejs-common/releases/tag/v2.0.4

The release build has started, the log can be viewed here. :sunflower:

:egg: You hatched a release! The release build finished successfully! :purple_heart:


Create containers with mkdir

It would be nice to have the mkdir method at least for the lowest level, the container because it seems container are not created on the fly when a mapper is used. If the container testtzis does not exist in the following account, the mapper runs into an error:
a=fsspec.get_mapper("swift://swift.dkrz.de/dkrz_4236b71e-04df-456b-8a32-5d66641510f2/testtzis/testcmip6")
a[".test"]=b"ho"

404, message='Not Found', url=URL('https://swift.dkrz.de/v1/dkrz_4236b71e-04df-456b-8a32-5d66641510f2/testtzis/testcmip6/.test')

Do you think that is possible?

Yes, implementing mkdir and rmdir on containers should be straight forward (I'd consider it the second level though, because there are accounts as well. We'd need (from the SWIFT API):

PUT /v1/{account}/{container} for mkdir
DELETE /v1/{account}/{container} for rmdir

I'd probably even go one step further (maybe in another PR) and also catch the error you describe. Then create the container and redo the request. We might want to make this optional though...
I might not be able to that change very soon, but PR's are welcome.


Gradle Task support for Code Coverage

Xplat Agent now support Code Coverage feature from Gradle task.

Testing:
UTs
Manual validation of base scenarios

approved with suggestions

This agent is deprecated now


Add dependency and codeQL checks

Coverage remained the same at 98.291% when pulling 1c77c1511d6efde5791a15ed6ec2c297e5e42355 on checks into f2963edeb582b51de5f6673cc44d53e0c77b6163 on main.


Getting rid of states using hk.without_state()

I'm using states in my model to capture intermediate activations that I need for testing. For production cases, I don't want to bloat my code with state management.
I expected that hk.without_state() was built for this use case. However, the example doesn't even use states (?).
I adapted said example to include states:
import haiku as hk
import jax
import jax.numpy as jnp

def f(x):
    mod = hk.Linear(10)
    hk.set_state("foo", "bar")
    return mod(x)

rng = jax.random.PRNGKey(42)
x = jnp.zeros([1, 1])

f = hk.without_state(hk.transform_with_state(f))

params = f.init(rng, x)
f.apply(params, rng, x)

What I get: ValueError: If your transformed function uses ``hk.{get,set}_state`` then use ``hk.transform_with_state``.
I also tried using only hk.transform(f) but under the hood that just calls without_state(transform_with_state(f)) as well.
I'm confused - how do I get rid of states here? This is a hacky way of what I'd like to achieve:
f_stateful = hk.transform_with_state(f)
f_stateful = hk.without_apply_rng(f_stateful)

# initialize to obtain an initial state
params, state = f_stateful.init(rng, x)

# wrap initial state & don't return further states
init_stateless = lambda rng, x: f_stateful.init(rng, x)[0]
apply_stateless = lambda params, x: f_stateful.apply(params, state, x)[0]
f = Transformed(init_stateless, apply_stateless)

y = f.apply(params, x)

Thanks,
Fabian

Hey Fabian,
As you've noticed, without_state is just syntactic sugar to clean up the method signatures of hk.transform-ed functions.
Some options, from least to most hacky:

Add a record_internals option to your modules, only hk.{get,set}_state if that's true.
Do your suggestion. Note that XLA prunes unused nodes/constants in a very early compilation pass, so jax.jit(apply_stateless) should in theory compile to the same thing as if you avoided state entirely.
Option 1, but as a global :^)
Monkey-patch hk.{get,set}_state to be no-ops.

Trevor


Allow switch type guards

I have the following code:
function logNumber(v: number) { console.log("number:", v); }
function logString(v: string) { console.log("string:", v); }

function foo1(v: number|string) {
    switch (typeof v) {
        case 'number':
            logNumber(v);
            break;
        case 'string':
            logString(v);
            break;
        default:
            throw new Error("unsupported type");
    }
}

Error:
Argument of type 'string | number' is not assignable to parameter of type 'number'.
 Type 'string' is not assignable to type 'number'.

I was forced to rewrite this using if statements.
function foo2(v: number|string) {
    if (typeof v === 'number') {
        logNumber(v);
    } else if (typeof v === 'string') {
        logString(v);
    } else {
        throw new Error("unsupported type");
    }
}

Please allow for using switch statements are type guards.

Yes please allow switch case there for state-machine. Also the conditional/ternary operator (?:).

+1 for switch and ?:

Approved

+1

Is this the same as https://github.com/Microsoft/TypeScript/issues/2388?

Not quite the same thing, since you don't need #2388 for this.

Is this allow user-defined type guards in switch cases?
Like this:
interface MyType1 { type: number }
interface MyType2 { test: string }

function isType1 (x): x is MyType1 {
   return !!x.type && typeof x.type === 'number'
}

function isType2 (x): x is MyType2 {
  return !!x.test && typeof x.test === 'string'
}

let x = getType1OrType2()

switch (true) {
   case isType1(x):
     console.log('x is MyType1')
     break;
   case isType2(x):
     console.log('x is MyType2')
     break;
  default:
     console.log('Unknown type')
}

@goodmind Your above suggestion breaks common switch rules.  Cases have to be constants.

@electricessence ok. i think https://github.com/Microsoft/TypeScript/issues/165 better for something like my example (but without switch, maybe auto-generated user type guards or so)

@electricessence what do you mean by "common switch rules"? The example provided by @goodmind is valid code.

@goodmind You may want to consider Discriminated Unions to solve this kind of problem. They let you get strong typing in switch cases without writing type guards when you have a common string literal type property to discriminate between them.
Here's the example from the TypeScript Handbook that I linked to:
interface Square {
    kind: "square";
    size: number;
}
interface Rectangle {
    kind: "rectangle";
    width: number;
    height: number;
}
interface Circle {
    kind: "circle";
    radius: number;
}

type Shape = Square | Rectangle | Circle;

function area(s: Shape) {
    switch (s.kind) {
        case "square": return s.size * s.size;
        case "rectangle": return s.height * s.width;
        case "circle": return Math.PI * s.radius ** 2;
    }
}

@rob3c I can't specify kind property because I dealing with external API. I think https://github.com/Microsoft/TypeScript/pull/12114 is what I need (maybe not)

I've got some code similar to @icholy's sample
function dosothing(exprValue: string | boolean | number | RegExp){
    switch (typeof exprValue) {
        case 'number':
            return setNumber(exprValue);
        case 'string':
            return setString(exprValue);
        case 'boolean':
            return setBoolean(exprValue);
    }
}

function setNumber(val: number){
    // ...
}

function setString(val: string){
    // ...
}

function setBoolean(val: boolean){
    // ...
}

You can see it online in Playground
Got this error:
TS2345:Argument of type 'string | number | boolean | RegExp' is not assignable to parameter of type 'number'.
  Type 'string' is not assignable to type 'number'.

@RyanCavanaugh what's the progress about this topic?

@icholy in other languages, switch will be isolated to constants.  Having cases that are evaluated at runtime in the way shown would be done with if statements instead.

@electricessence in other languages, switch statements are compiled into jump tables. In js it's nothing more than syntactic sugar for if.

But if adding run-time evaluations you're basically building a complex if block.

That's a valid use case.

@icholy I understand why you're doing what you are.  It's a bit unconventional.  But I just wanted to be clear about it may end up being more difficult to implement than an if chain.
Here's why C# only allows constants/statics:
http://stackoverflow.com/questions/44905/c-sharp-switch-statement-limitations-why

@electricessence I don't personally use that style, but apparently some people do. My point is that the type system should not be limited to what you think people should be doing.

@icholy I am bringing it up just as a point of contrast.  What I think people should or shouldn't be doing is irrelevant.  Because JS can evaluate dynamic case values, I agree that it would be nice that your example actually work.  I'm only suggesting that 1) it may be more difficult to implement than you may be assuming, and 2) in the scheme of other languages is unconventional and because a working version of it can be written correctly using if blocks, it may be of a lower value to fix compared to other issues/features.
Having it work with constants IMO is expected, hence why I'm on this thread.  Having it work with dynamic values at run-time would be cool, but I don't have that expectation.

@electricessence it's not a dynamic value at runtime. It's a boolean literal which is it's own type so it's known at compile time. Obviously something like this wouldn't work.

function getTrueOrFalse(): boolean {
  return Math.random() > 0.5;
}

switch (getTrueOrFalse()) {
  case isNumber(a):
    // use number
}

@icholy So then I guess the important question for the above example is, wouldn't this be a more normal case?  Passing a constant or literal (true) value to a switch is redundant.  This above example is not.

I found out that discriminate unions and switch type guards as implemented in the ngrx-example app (see https://github.com/ngrx/example-app/blob/master/src/app/reducers/books.ts#L20) worked in TS 2.0.0 but stopped working in TS >= 2.1.
Is this expected behaviour? Is this because the discriminator is a just a string property on a class instead of being a type in the interface?

@metzc I have the same problem, also using code based on the ngrx example app! For the time being I'm sticking with TS2.0.10 until this is sorted out.

@metzc Unfortunately, they've made breaking changes in TypeScript 2.1+ with how string literal types are narrowed for reasons that I don't agree with. The pattern in the ngrx example app can still be made to work, albeit at the expense of a bunch of unnecessarily noisy cruft.  See this playground for the fix, if you can call it that. Here's the full playground code with the newly broken version as well as the hoops you have to jump through to get string literal types behaving again. I'd love to know a better way, but unless the TS team reverts some decisions, I think this popular use case is out of luck.
const actionTypeCache: { [type: string]: boolean } = {};

function ensureSingletonType<T extends string>(actionType: T): T {
    if (actionTypeCache[<string>actionType]) {
        throw new Error(`Action type "${actionType}" is not unique"`);
    }
    actionTypeCache[<string>actionType] = true;
    return actionType;
}

/** placeholders */
interface Action { type: string; payload?: any; }
interface Book { id: string; }
interface State { }
function reduceSearch(state: State, id: string): State { return state; }
function reduceLoad(state: State, book: Book): State { return state; }

/******************** BEGIN BROKEN ********************/

// In TS 2.1+ these properties are only strings instead of literals,
// even though `ensureSingletonType` returns them as literals.
const ActionTypesBROKEN = {
    SEARCH: ensureSingletonType('[Book] Search'),
    LOAD: ensureSingletonType('[Book] Load')
};

class SearchActionBROKEN implements Action {
    // In TS 2.1+ this is only a string instead of a string literal
    type = ActionTypesBROKEN.SEARCH;
    constructor(public payload: string) { }
}

class LoadActionBROKEN implements Action {
    // In TS 2.1+ this is only a string instead of a string literal
    type = ActionTypesBROKEN.LOAD;
    constructor(public payload: Book) { }
}

type ActionsBROKEN = SearchActionBROKEN | LoadActionBROKEN;

function reducerBROKEN(state = {}, action: ActionsBROKEN): State {
    switch (action.type) {
        case ActionTypesWORKS.SEARCH: {
            const id = action.payload; // still string | Book
            return reduceSearch(state, id); // type narrowing is BROKEN!
        }
        case ActionTypesWORKS.LOAD: {
            const book = action.payload; // still string | Book
            return reduceLoad(state, book); // type narrowing is BROKEN!
        }
        default:
            return state;
    }
}

/******************** END BROKEN ********************/

/******************** BEGIN WORKS ********************/

/**
 * Let's declare our string literals in one place to avoid errors.
 * Regardless, duplicating string literals everywhere works the same way.
 */
const SEARCH_ACTION = ensureSingletonType('[Book] Search');
const LOAD_ACTION = ensureSingletonType('[Book] Load');

// In TS 2.1+ these crufty declarations are required to preserve string literals!
const ActionTypesWORKS = {
    SEARCH: <typeof SEARCH_ACTION>SEARCH_ACTION, // TS 2.1+ required cruft
    LOAD: <typeof LOAD_ACTION>LOAD_ACTION, // TS 2.1+ required cruft
};

class SearchActionWORKS implements Action {
    // TS 2.1+ required cruft
    type: typeof ActionTypesWORKS.SEARCH = ActionTypesWORKS.SEARCH;
    constructor(public payload: string) { }
}

class LoadActionWORKS implements Action {
    // TS 2.1+ required cruft
    type: typeof ActionTypesWORKS.LOAD = ActionTypesWORKS.LOAD;
    constructor(public payload: Book) { }
}

type ActionsWORKS = SearchActionWORKS | LoadActionWORKS;

function reducerWORKS(state = {}, action: ActionsWORKS): State {
    switch (action.type) {
        case ActionTypesWORKS.SEARCH: {
            const id = action.payload; // string
            return reduceSearch(state, id); // type narrowing WORKS!
        }
        case ActionTypesWORKS.LOAD: {
            const book = action.payload; // Book
            return reduceLoad(state, book); // type narrowing WORKS!
        }
        default:
            return state;
    }
}

/******************** END WORKS ********************/

@rob3d i already found the ngrx example style to contain too much cruft but this almost kills it for me.. maybe we need to think in a different direction here to implement the same basic idea with less bloat (while still retaining full type support). Do you know of any existing approaches / examples?

Without knowing enough about what the goal of the changes in 2.1.4 are I can't comment about how desirable or not they might be in the long term, but I can comment on the pace of breaking changes with TypeScript: No sir, I don't like it. If you're going to make changes that simply break existing code, it should be done in a major version number. Minor version numbers are supposed to be backwards-compatible.
GRATUITOUS SEMVER LINK

@metzc I found a way to reduce the additional code required to preserve the literals. It leverages the intent of TS 2.1+ type widening to only widen when assigning to a mutable variable/property, while preserving literals when assigning to const variables and readonly properties. I thought I tried this version yesterday unsuccessfully, but I must've missed a detail somewhere because it's working today :-)
Anyhow, here is the updated playground comparing the original ngrx style with a version respecting the TS 2.1+ breaking changes.
And here's the updated WORKS code from the new playground:
/******************** BEGIN WORKS ********************/

// In TS 2.1+ const variables and readonly properties are
// required to preserve literals. Unfortunately, we can't
// declare anonymous objects with readonly properties, so
// we use a class here with static readonly properties to
// to capture the actions as string literals in one place.
class ActionTypesWORKS {
    static readonly SEARCH = ensureSingletonType('[Book] Search');
    static readonly LOAD = ensureSingletonType('[Book] Load');
};

class SearchActionWORKS implements Action {
    // TS 2.1+ requires readonly to preserve literals
    readonly type = ActionTypesWORKS.SEARCH;
    constructor(public payload: string) { }
}

class LoadActionWORKS implements Action {
    // TS 2.1+ requires readonly to preserve literals
    readonly type = ActionTypesWORKS.LOAD;
    constructor(public payload: Book) { }
}

type ActionsWORKS = SearchActionWORKS | LoadActionWORKS;

function reducerWORKS(state = {}, action: ActionsWORKS): State {
    switch (action.type) {
        case ActionTypesWORKS.SEARCH: {
            const id = action.payload; // string
            return reduceSearch(state, id); // type narrowing WORKS!
        }
        case ActionTypesWORKS.LOAD: {
            const book = action.payload; // Book
            return reduceLoad(state, book); // type narrowing WORKS!
        }
        default:
            return state;
    }
}
/******************** END WORKS ********************/

good work @rob3c, that looks much better.
it is also backwards compatible to 2.0, so we can use this in projects that didn't migrate to 2.1 yet.

Looks great! Thanks very much! :)

@mischkl @rob3c on a second thought i think the change in TS may actually be a bugfix rather than a breaking change (thus the versioning would be correct i guess?). The TS compiler can't be sure that a string property of on object isn't changed in runtime. So narrowing it down based on that would be wrong. I remember that because of that i already tried to set the property to readonly on the Action class. What i overlooked though was that we were assigning a variable (ActionTypes.*) that was not readonly, so @rob3c now added this missing bit.

Something like this could be extremely useful:
  private onChildActivation(component: any) {
    switch (component.constructor.name) {
      case "BodyStateAddEditModalComponent" is BodyStateAddEditModalComponent:
        component.bodyState = this.bodyState;
        break;
      case "BodyStateInformationPageComponent" is BodyStateInformationPageComponent:
        break;
      case "PostListSubPageComponent" is PostListSubPageComponent:
        this.loadPosts(component);
        break;
    }
  }

@pleerock this is already supported using tagged union types.
type BodyStateAddEditModalComponent = {
    name: "BodyStateAddEditModalComponent";
    bodyState: any;
}
type BodyStateInformationPageComponent = {
    name: "BodyStateInformationPageComponent";
    isPage: boolean;
}
type PostListSubPageComponent = {
    name: "PostListSubPageComponent";
}

function onChildActivation(component: BodyStateAddEditModalComponent | BodyStateInformationPageComponent | PostListSubPageComponent) {
    switch (component.name) {
        case "BodyStateAddEditModalComponent":
            component.bodyState = this.bodyState; // OK
            break;
        case "BodyStateInformationPageComponent":
            break;
        case "PostListSubPageComponent":
            this.loadPosts(component);
            break;
    }
}

@mhegazy thank you, I'm aware of this feature, however I wanted to make comparison based on class names, but this way it produces too much more redundant code.

The feature tracked by this issue does not handle this either. narrowing in general, whether it is in switch statements or not, only works on union types. so component has to be defined as a union type for component.name check to do anything.
This feature, as noted in the OP, is to enable typeof to work in a switch statement.

@pleerock what's wrong with instanceof ?

private onChildActivation(component: any) {
  if (component instanceof BodyStateAddEditModalComponent) {
    component.bodyState = this.bodyState;
  }
  else if (component instanceof BodyStateInformationPageComponent) {
    // do nothing
  }
  else if (component instanceof PostListSubPageComponent) {
    this.loadPosts(component);
  }
}

@icholy yeah that works, however with switch case it could be much cleaner

This already somewhat works as of TS 2.3.2, but only outside functions:
function calc(n: number) { }
let x: string | number = 0;

switch (typeof x) {
    case 'number':
        calc(x); //works as expected
}

function check() {
    switch (typeof x) {
        case 'number':
            calc(x); //Argument of type 'string | number' is not assignable to parameter of type 'number'.
    }
}

I'm not sure why it works when the switch statement is on the top level or if that is even intentional, but that might be useful info for anyone trying to implement this feature.

@iFreilicht i suppose that it has to do with the variable x being outside the scope of the function, not the switch being inside. If i'm not wrong here, you can never be 100% sure about the value of x since it can be changed from anywhere anytime. I would expect it to work if you put the let x inside the function or as a parameter (didn't test).

@iFreilicht that first part only works because we can "see" the 0 initializer. The switch does nothing.

Ah yes, you're both right, as evidenced by this:
function calc(n: number) { }
let x: string | number = "nope";

switch (typeof x) {
    case 'number':
        calc(x); //Argument of type 'string' is not assignable to parameter of type 'number'.
}

Thanks for clearing that up!

Any update on enabling the ternary if operator as a type guard?

@danielmhanover example? That should work already

@danielmhanover Using type predicates works as you would expect (if I'm guessing your intent correctly):
export type SomeUnion = TypeA | TypeB;

function isTypeA(input: SomeUnion): input is TypeA {
  return (<TypeA>input).propA !== undefined;
}

export const someFunc = (input: SomeUnion) =>
  isTypeA(input)
    ? onlyTypeA(input)
    : otherCase(input);

Hey, looking at
https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions
Can one get this example to work with an additional generic type S?
Use case would be writing a higher order reducer which calculates something if it knows the action and else just delegates it to the provided reducer. This is pretty common in redux.
interface Shape {
  kind: string;
}

interface Square extends Shape {
  kind: "square";
  size: number;
}

interface Circle extends Shape {
  kind: "circle";
  radius: number;
}

// adding | S here causes the cases to loose their type and everything is just ShapeType<S>
type ShapeType<S extends Shape> = Square | Circle | S;

function area<S extends Shape>(s: ShapeType<S>) {
  switch (s.kind) {
    case "square":
      return s.size * s.size; // s should be of type Square
    case "circle":
      return Math.PI * s.radius ** 2; // s should be of type Circle
    default:
      return 0 // s should be of type S
  }
}

Could we combine Discriminated Unions and Type Predicates to get fully exhaustive, statically checked poor-man's pattern matching in Typescript? I don't think this could generalize to any tagged union, but perhaps it could be a good starting point to get most of the plumbing out of the way?

cc @RyanCavanaugh @mhegazy
I'm considering having a go at the original proposal of switch on typeof. E.g:
function logNumber(v: number) { console.log("number:", v); }
function logString(v: string) { console.log("string:", v); }

function foo1(v: number|string) {
    switch (typeof v) {
        case 'number':
            logNumber(v);
            break;
        case 'string':
            logString(v);
            break;
        default:
            throw new Error("unsupported type");
    }
}

Is this still wanted by the TS team?

Is this still wanted by the TS team?

Yes.

Great, I'll give it a shot.

Just for future reference, there's another similar scenario:
switch (obj.constructor) {
  case DerivedType:
    // obj should be a DerivedType
    break;
  default:
    // obj is still a base type
    break;
}
// obj is still a base type

@mhegazy Would it be possible to get a reviewer assigned to this PR?

I'm not sure if @JannicBeck 's issue of discriminated unions is related to this one, but is that being tracked anywhere? I run into the issue he mentions all the time, specifically with Redux. I have a reducer that handles certain actions, but then defers to another reducer of unknown types.

@lukescott One workaround would be to just cast the general type to a known union type: const s = sIn as any as Square | Circle;. But I've made an issue at #26277.

Hi, Is there any way the following can be allowed without error?
class A {
	aa = 5;
}

class B {
	bb = 9;
}

function doStuff(o: A | B): number {
	switch (o.constructor) {
		case A:
			return o.aa; // error!
		default:
			return o.bb; // error!
	}
}

console.log(doStuff(new A()));

Please add type guard narrowing with switch case of the constructor property.

@miguel-leon I believe your suggestion is tracked by #23274

I met a specific case, and I'm wonder if this can be implement.
enum Test = {
  TestA = 'TESTA',
  TestB = 'TESTB',
}
type TestValues = `${Test}`;
type DataType<TypeName> = TypeName extends TestValues
  ? TypeName extends 'TESTA'
    ? TestAData
    : TypeName extends 'TESTB'
    ? TestBData
    : never
  : never;

function exampleForTestA(data: TestAData) {
  // do something...
}

function exampleForTestB(data: TestBData) {
  // do something...
}

function example<T extends TestValues, D extends DataType<T>>(
  type: T,
  data: D,
) {
  switch (type) {
    case 'TESTA':
      return exampleForTestA(data as TestAData); // I have to add type assertion to make it work without error
    case 'TESTB':
      return exampleForTestB(data as TestBData); // same here
    default:
      throw new Error('Unknown type');
  }
}

Why this issue is closed?
This is a very common situation, is there any thread that deals with the same thing?
Typescript: typescript: ^5.1.3
Example:
type ReducerAction = {
  type: 'action-1';
  prop1: string;
} | {
  type: 'action-2',
  prop1: string;
  prop2: string
};

const reducer = (state: State, action: ReducerAction): State => {
  if(action.type==='action-1'){
    action.prop1; // ✅
  }

  switch (action.type) {
    case 'action-1'': {
      action.prop1; // ❌
      break;
    }
    case 'action-2': {
      action.prop2; // ❌
      break;
    }
  }
};


feature/CDAP-14185 Add Google Cloud PubSub Streaming Source

Summary

Adds Google PubSub Streaming source.
It uses Apache Bahir to create DStreams.
It creates a SparkGCPCredentials from the service json file if one is provided and if not then it will use Application Default Credentials Note: ADC part needs to be tested to work yet but since plugin is realtime its pending.
FLL is not supported for Realtime Plugins so this does not include FLL.

Issue: https://issues.cask.co/browse/CDAP-14185

@albertshau Addressed all comments and opened https://issues.cask.co/browse/CDAP-14419 for format support. Please have a look.

Opened a jira to use DirectStream: https://issues.cask.co/browse/CDAP-14438


[Question] should I register sku in some google play console like appstore management system ?

I'm working on integrating asf iab.
The purchase flow is much like google IAB, but where should I register all available Skus ? is there any appstore management system like google play console ?

Hi shaobin0604,
In our IAB flow the SKUs serves only the purpose to identify the item being bought. This identification is only relevant for you and your app. Basically the identification for the SKUs stays only on your side.
So for managing that kind of information, as an example, you can have your own web service that contains all the items your app allows to be purchased, with names and values.
When sent to the wallet, the SKU is added to the information registered on the blockchain, later you can use that identification to check on the blockchain what item was bought with a given wallet address.
No appstore management for purchasable items is available, that management is the app's developer responsibility.

@JoaoRaimundo Thanks for your explanation


Capitalizing FormData header field name

Summary

In general, the header field name should be Capitalizing.
Lowercase FormData field name will cause Stream ended unexpectedly in same server.
Changelog

[General] [Fixed] Capitalizing FormData header field name

@iamdhj Could you please update failing tests?

Thanks for the PR. However, http header names are case-insensitive per the spec. https://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive
Your server should properly handle the spec and case-insensitive headers. If we changed this we would surely get people complaining about it not being the other way.


Add: AddonInstance client SDK

Signed-off-by: Yashvardhan Kukreja<EMAIL_ADDRESS>Ref: https://github.com/openshift/addon-operator/pull/73#pullrequestreview-799908831

/retest

/hold


General style issues

This issue will encompass all stylistic issue..hmm subjective.
If something looks bad to you, put it here

viewEstimateClient.html looks washed out. make the document outline more visible.

I'll check it out

Fixed the viewEstimateClient.html styling, added a pull request.


feature(loops): Added external loop support

from defer import defers

@defers
def f():
    print(1)
    defer: print(3)
    print(2)

for i in range(3):
  f()

cleared up the except a bit but looks good, thanks for the help man

Np. I also modified the code so that it works even when it is inside of statements.

ye i saw that, gj

@pneb i think that might have broken some stuff. might have been too quick there.
i'll revert and investigate further.

Ok so, upto the loop fix we're good. cherry picked it. (and again good thinking, thanks for that).
But your statement commit seems to break.
if you don't mind, go through it again, if all seems good to you, open a different pr for this specific feature and ill review it from there.

Also about that eval, perhaps we could approach it via locals?

Yep, the code is buggy. Fixing it rn

Check the new pr


Add null pointer handling to multiple functions in s2n_connection.c.

Description of changes:
Adds multiple notnull_check()'s to s2n_connection.c functions.
I only added a short unit test over one function - partially to verify my understanding of the macros I was using. I can add more similar tests if needed but the checks are straightforward and it doesn't seem to be standard practice in this project to test simple macro usage exhaustively.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@baldwinmatt I'll take a look at Travis, the failures are because of:

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Restarted the 4 hung Travis Builds. Hung builds were accross multiple different build types: Integration, Fuzz, and SAW tests, and likely means a Travis issue rather than something with this PR.


Fix misleading RegEx type validation error message

Solves issue #164 which @shini4i brought up regarding the misleading validation error in EvalCommand which is thrown when the value does not match the RegEx pattern. I took the suggested solution from the same issue from @rannn505 by adding a condition that changes the message if the type is RegEx. The message now explicitly says that the value must match the pattern and displays the pattern.

@RichardAkman @ShriekinNinja What about the Upsert Command? This is not reusable in any way, gonna revert it!


miga init not consistently sourcing .miga_modules

For Ruby libs and R packages

Hi, I am getting this error when I do miga init:
Should I include MyTaxa modules? (yes / no)  [yes] > yes
Testing Ruby (Required version: 1.9+)... sh: 1: source: not found
Where can I find it?  [.] >
I cannot find ruby. sh: 1: source: not found
Where can I find it?  [.] >
Thanks,
Juliana

I believe this was resolved during the miga init refactoring. I'll close this issue, but please reopen if reproduced with a recent version.


Should we bump power precedence?

Related to https://github.com/KittyCAD/modeling-app/pull/956
Something @JordanNoone noticed for his code
const x = 10
const y = 5
const lengths = [8,10]
const a = x^2
const b =-(lengths[0])^2
const c = y^2

const d1 = x^2-lengths[0]^2
const d2 = x^2+y^2-lengths[0]^2

Has some wacky outputs

to give a simpler example
const yo = 4 ^ 2 - 3 ^ 2

which to me reads as 16 - 9 = 7
instead is actually results is 4 because it's just 4^1 or  4^((2-3)^2)
To me this makes sense to have power have a precedence higher than multiply so bumping it changes the behaviour to what is intuitive to both Jordan and I, but also want to go with what's normal, potentially bike shed topic here.
With this change  4 ^ 2 - 3 ^ 2 is 7 and Jordan's original code is

Looks good to me. But we should probably have a test for this.

Yeah true, there's a failing test, so that at least is capturing some of the old behaviour, but should probably put something more explicit in.


Deprecate/disable query string auth tokens

Changes

Add deprecation warning to Token and AccessToken authentication methods in swagger.
Add deprecation warning header to API response. Example:HTTP/1.1 200 OK
...
Warning: token and access_token API authentication is deprecated
...

Add setting DISABLE_QUERY_AUTH_TOKEN to reject query string auth tokens entirely. Default is false

Next steps

DISABLE_QUERY_AUTH_TOKEN should be true in a subsequent release and the methods should be removed in swagger
DISABLE_QUERY_AUTH_TOKEN should be removed and the implementation of the auth methods in question should be removed

Open questions

Should there be further changes to the swagger documentation? Deprecation is not yet supported for security definitions (coming in OpenAPI Spec version 3.2.0)
Should the API router logger sanitize urls that use token or access_token? (This is obviously an insufficient solution on its own)

This PR aims to solve a security vulnerability in which auth tokens in URL query parameters are leaked to middleware applications that log URL information, including access logs, browser history, and analytics services (such as Google Analytics).
More information here: https://owasp.org/www-community/vulnerabilities/Information_exposure_through_query_strings_in_url
It is a major functional change, as token auth is likely the most common method for authentication. However, a migration to token in headers should be fairly straightforward for users.
The target is to provide deprecation warnings for users starting in 1.22 (along with a gitea config setting that can be used to disable the setting immediately). The default setting will be to disable query-based authentication in 1.23, and then remove the setting in 1.24.

Should we perhaps backport this to 1.21?
Then users have more time to see the pending change, and currently nothing changes.

Should we perhaps backport this to 1.21? Then users have more time to see the pending change, and currently nothing changes.

Yeah, I think that's a great idea.

Doesn't make any difference.
I think this is already included in the message to some extent.

Maybe we shoud update the configuration cheat sheet? I noticed the warning log and tried to check more on https://docs.gitea.com/administration/config-cheat-sheet, but I found nothing and I had to read the code.

Maybe we shoud update the configuration cheat sheet? I noticed the warning log and tried to check more on https://docs.gitea.com/administration/config-cheat-sheet, but I found nothing and I had to read the code.

Yeah, that was an oversite. I can patch that.

Just for ref: this caused an issue in the helm-chart: https://gitea.com/gitea/helm-chart/pulls/590


UNION ALL issue when running snapshots with invalidate_hard_deletes=True

Describe the bug
When enabling invalidate_hard_deletes, the initial snapshot works but subsequent attempts fail with error:
Column 5 in UNION ALL has incompatible types: DATETIME, DATETIME, TIMESTAMP at [119:5].
Other considerations:

the snapshot works fine when invalidate_hard_deletes is omitted and run multiple times
selecting fields individually (as opposed to a select *) does not make a difference
the snapshot table was dropped and recreated between attempts of switching invalidate_hard_deletes on and off
I can reproduce this issue on any table

Steps To Reproduce
snapshot config:
{% snapshot snap_company %}

{{
    config(
        target_schema=generate_schema_name('edw_ods', model),
        unique_key='id',
        strategy='timestamp',
        updated_at='updatedAt',
        invalidate_hard_deletes=True,
    )
}}

select
    *
from {{ ref('company') }}

{% endsnapshot %}

run dbt snapshot -s snapshots/snap_company.sql twice
Expected behavior
The snapshot should work identically on the initial and subsequent runs
Screenshots and log output
n/a
System information
Which database are you using dbt with?

[ ] postgres
[ ] redshift
[x] bigquery
[ ] snowflake
[ ] other (specify: ____________)

The output of dbt --version:
installed version: 0.20.0
   latest version: 0.20.0

Up to date!

Plugins:
  - snowflake: 0.20.0
  - postgres: 0.20.0
  - redshift: 0.20.0
  - bigquery: 0.20.0

The operating system you're using:
Debian
The output of python --version:
Python 3.8.2
Additional context
Add any other context about the problem here.

@inkeysolutions Thanks for opening!
The issue here is that your updatedAt column is of type datetime, whereas dbt-bigquery uses snapshot_get_time → current_timestamp → CURRENT_TIMESTAMP() as the input to dbt_valid_to when capturing hard deletes.
If you cast your column to timestamp first, this should succeed:
{% snapshot snap_company %}

{{
    config(
        target_schema=generate_schema_name('edw_ods', model),
        unique_key='id',
        strategy='timestamp',
        updated_at='updated_at_ts',
        invalidate_hard_deletes=True,
    )
}}

select
    *, timestamp(updatedAt) as updated_at_ts
from {{ ref('company') }}

{% endsnapshot %}

Then it should work just fine!
In the best-case scenario, dbt should dynamically determine whether to use current_timestamp or current_datetime, based on the data type of the column you've set as updated_at. That might be doable, but it's going to be tricky to implement. We do something clever to get a null value of the correct type, and thereby secure the union:
https://github.com/dbt-labs/dbt/blob/1a984601ee964fff59e338805ab49a1e8489e342/core/dbt/include/global_project/macros/materializations/snapshot/snapshot.sql#L51
I'm not sure if/how to repeat the magic trick for a not-null value, picking between current_timestamp, current_date, or current_datetime.
So, if I had to pick one, I think timestamp is the way to go. I don't see a reason to ever prefer a datetime column (no timezone information) to a timestamp column (includes timezone info) when it comes to crucial metadata columns in a snapshot; it's also easy enough to turn a date into timestamp, though not the other way around. I'm thinking that the right next step here is to document that, at least on BigQuery, snapshots' updated_at really must be of type timestamp, when using the timestamp strategy.
If you feel strongly about using datetime across the board, you could reimplement the snapshot_get_time macro in your own project, and have it return a datetime instead:
{% macro snapshot_get_time() %}
    {{ return('CURRENT_DATETIME') }}
{% endmacro %}

I'm going to close this issue for now, but if you have another idea, or think I missed something above, we can re-open!


Re-implement dynamic labels

Closes #46

@waxlamp I'm having some issues with this property calling out to updateVis on updated. Can you take a look and show me what I'm doing wrong?

@waxlamp This is ready for review. I also added node coloring to this PR using a similar mechanism


Qf chen msft patch 1

This pull request includes several changes to GitHub Actions workflows and other configuration files. The most important changes include adding new workflows for various jobs, removing an existing workflow, and adding a credentials file for Azure deployments.
GitHub Actions Workflows

.github/workflows/action1.yml: Added a new workflow named "First Workflow" that triggers on manual execution and issue creation, with two jobs that run sequentially.
.github/workflows/action2.ymal: Added a new workflow named "Azure Bicep" for manual execution, which builds and deploys IaC resources using Azure Bicep.
.github/workflows/deploy.yml: Added another "Azure Bicep" workflow for manual execution, similar to action2.ymal, but with specific client, tenant, and subscription IDs.
.github/workflows/pages.yml: Removed the workflow for building and deploying a Jekyll site to GitHub Pages.

Configuration Files

credentials.json: Added a new credentials file for deploying Azure resources from the TechExcel DevOps practices GitHub repository.


Fix Issue #790

This fixes issue #790 by exposing the FilerWebpackPlugin class through it's own import.
var { FilerWebpackPlugin } = require('filer/webpack');

It also deprecates the following:
var { FilerWebpackPlugin } = require('filer');

And updates the documentation in README.md to reflect these changes.

@humphd what do you think?


Xdebug 3 support

Hi. I updated xdebug from 2.9.8 to 3.0.2 and it started giving this error on almost every step, sometimes straight away when I start debugging:
- [ERROR] {Thu 14 2021 17:05:28} An error occured: <class 'UnicodeDecodeError'>
Traceback (most recent call last):
  File "/home/user/.vim/plugged/vdebug/python3/vdebug/event.py", line 784, in dispatch_event
    Dispatcher.events[name](self.__session_handler).run(*args)
  File "/home/user/.vim/plugged/vdebug/python3/vdebug/event.py", line 660, in run
    self.ui.windows.watch().accept_renderer(rend)
  File "/home/user/.vim/plugged/vdebug/python3/vdebug/ui/vimui.py", line 619, in accept_renderer
    self.write(renderer.render())
  File "/home/user/.vim/plugged/vdebug/python3/vdebug/ui/vimui.py", line 910, in render
    properties = self.response.get_context()
  File "/home/user/.vim/plugged/vdebug/python3/vdebug/dbgp.py", line 125, in get_context
    self.create_properties(ContextProperty(c))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 1023: unexpected end of data

I'm trying to prepare a minimal example that triggers it but nothing "simple" seems to be working so I decided to ask - is this a known issue? The error doesn't prevent following the code step by step but the variable context is empty and pressing <F11> triggers same error again.

It can be easy reproduced by reading binary file content into variable.


Fix trim and keys which cause isses when generating document

In current 0.25.0 document, there are extra _ applied to trim and keys.
This is caused by the variable name which jsdocs used to generate.

:cow2:
Thank you

Thanks!  :herb:


Error: pluginHelpers.isDetailedError is not a function

Which packages are impacted by your issue?
No response
Describe the bug
Doesn't print out the proper error message.
Your Example Website or App
none
Steps to Reproduce the Bug or Issue
I think any error will work?
Here is the real error:
AggregateError: GraphQL Document Validation failed with 1 errors;
Error 0: GraphQLDocumentError: Cannot query field "xxx" on type "Mutation".

Expected behavior
The error is printed out.
I added a solution below that does work.
Screenshots or Videos
No response
Platform

OS: macos
NodeJS: 16.19.1
graphql version: ^14.1.1
@graphql-codegen/* version(s): ^2.3.0

Codegen Config File
overwrite: true
schema: 'http://localhost:4000/graphql'
extensions:
codegen:
config:
arrayInputCoercion: false
immutableTypes: true
namingConvention: keep
scalars:
DateOnly: string
DateTime: string
generates:
src/generated/graphql.ts:
plugins:
- add:
content: |
/* eslint-disable / / prettier-ignore /
/ * * * * * * * * * * * * * * * * * * * * * *
THIS FILE IS GENERATED, DO NOT EDIT!
(use npm run codegen to update)
* * * * * * * * * * * * * * * * * * * * * * */
- typescript
- typescript-operations
Additional context
class Renderer {
    constructor(tasks, options) {
        this.updateRenderer = new UpdateRenderer(tasks, options);
    }
    render() {
        return this.updateRenderer.render();
    }
    end(err) {
        this.updateRenderer.end(err);
        if (typeof err === 'undefined') {
            logUpdate.clear();
            return;
        }
        // persist the output
        logUpdate.done();
        // show errors
        if (err) {
            const errorCount = err.errors ? err.errors.length : 0;
            if (errorCount > 0) {
                const count = indentString(chalk.red.bold(`Found ${errorCount} error${errorCount > 1 ? 's' : ''}`), 1);
                const details = err.errors
                    .map(error => {
                    debugLog(`[CLI] Exited with an error`, error);
                    return { msg: pluginHelpers.isDetailedError(error) ? error.details : null, rawError: error }; // <========= breaking
                })
                    .map(({ msg, rawError }, i) => {
                    const source = err.errors[i].source;
                    msg = msg ? chalk.gray(indentString(commonTags.stripIndent(`${msg}`), 4)) : null;
                    const stack = rawError.stack ? chalk.gray(indentString(commonTags.stripIndent(rawError.stack), 4)) : null;
                    if (source) {
                        const sourceOfError = typeof source === 'string' ? source : source.name;
                        const title = indentString(`${logSymbols.error} ${sourceOfError}`, 2);
                        return [title, msg, stack, stack].filter(Boolean).join('\n');
                    }
                    return [msg, stack].filter(Boolean).join('\n');
                })
                    .join('\n\n');
                logUpdate.emit(['', count, details, ''].join('\n\n'));
            }
            else {
                const details = err.details ? err.details : '';
                logUpdate.emit(`${chalk.red.bold(`${indentString(err.message, 2)}`)}\n${details}\n${chalk.grey(err.stack)}`);
            }
        }
        logUpdate.done();
        printLogs();
    }
}

Solution
return { msg: error?.details ? error.details : null, rawError: error };

I was able to resolve the issue by doing the following:

Delete node_modules
npm i
npm i graphql-codegen

Theres a big chance that you probably just need to run "npm i graphql-codegen" but i followed these steps to resolve the issue

I am getting: pluginHelpers.DetailedError is not a constructor. Does anyone have idea about that? Not sure if I need to create an issue about this. "@graphql-codegen/cli": "2.3.0", "@graphql-codegen/introspection": "2.1.0", "@graphql-codegen/typescript": "2.4.1", "@graphql-codegen/typescript-operations": "2.2.1", "@graphql-codegen/typescript-react-apollo": "3.2.2",
What I did was to clone a repo, install packages and then:

Also getting this error

I am getting: pluginHelpers.DetailedError is not a constructor. Does anyone have idea about that? Not sure if I need to create an issue about this. "@graphql-codegen/cli": "2.3.0", "@graphql-codegen/introspection": "2.1.0", "@graphql-codegen/typescript": "2.4.1", "@graphql-codegen/typescript-operations": "2.2.1", "@graphql-codegen/typescript-react-apollo": "3.2.2",
What I did was to clone a repo, install packages and then:

I upgraded to all the latest and the error is gone!
    "@graphql-codegen/introspection": "^4.0.0",
    "@graphql-codegen/typescript": "^4.0.0",
    "@graphql-codegen/typescript-operations": "^4.0.0",
    "@graphql-codegen/typescript-react-query": "^4.1.0",```

I'm having the same error. Whenever I pass the @Arg to this function, graphql-codegen returns pluginHelpers.isDetailedError is not a function. I have many queries like that, including one that returns only one research and receive the very same arguments. I have tried to delete node_modules and upgrading packages, but nothing solves it for me.

My case was fixed by having unique query aliases in .graphql files.
./bullets.graphql
query Bullets { # This has to be unique, you cannot have another query alias `query Bullets` in different .graphql file
  bulletsFired {
    speed
    hitEar
  }
}

./other.graphql
query Bullets { # this will cause error
}


[stable/sentry] Configure externalIPs

Added value service.externalIPs and fixed notes about access to service of type ClusterIP

/ok-to-test

/assign

/retest

/lgtm

/lgtm


sshd: update de-socket-activationizing instructions to be a little nicer

See individual commit comments.
cc @crawford and @kbrwn

and cc @zbwright since this is os-docs

and one more:
change
You can specify both an IP and an alternate port in a single ListenStream line; additionally, IPv6 address bindings would be specified as, for example, [2001:db8::7]:22 Note two things: first, while a specific IP address is optional, you must always specify the port, even if it is the default SSH port. Second, the FreeBind option is used allow the socket to be bound on addresses that are not actually configured on an interface yet, to avoid issues caused by delays in IP configuration at boot. (This is not needed if you are not specifying an address.)
to
You can specify both an IP and an alternate port in a single ListenStream line. IPv6 address bindings would be specified using the format [2001:db8::7]:22.
Note: While a specific IP address is optional, you must always specify the port, even if it is the default SSH port. The FreeBind option is used to allow the socket to be bound on addresses that are not yet configured on an interface, to avoid issues caused by delays in IP configuration at boot. (This option is required only if you are specifying an address.)

Properly updated to be everything-is-a-dropin.
I manually verified the first section works by launching libvirt machines with each ignition snippet.

cc @crawford @zbwright, I think I addressed all comments.

@crawford look okay to you on the technical side now?


[all] Adding Fills as first class objects in the API

Thoughts on adding Fills to the API?  The value is greater with the web sockets, but many of the APIs I've seen allow you to obtain the fills for a trade.
I'm happy to put something together if the idea is well received.

One example of this is GDAX, which has get order and get fills. Currently, TradeService.getOrder is documented as get's the latest order form the order book that with matching orderQueryParams. However, in GDAX, it seems to be using the get orders API, which also returns completed orders. So either the documentation in TradeService is wrong (since this order is no longer on the order book), or the implementation is wrong. GDAXTradeService.getTradeHistory uses the fills API.
It does seem like UserTrade, which is returned by getTradeHistory, is currently being used for fills. In particular, it has both an order ID (to reference the original order) and an ID (to reference the fill/transaction ID). Would it be sufficient to just use the UserTrade object for fills, as we are already doing for GDAX (and possibly others)?

Oh I didn't realize UserTrade was the fills.  Yeah if there's something in place, I don't care what its called.  My main reason was really on the web socket side, I want to receive the fills in real time off the websocket but needed an object for that.
I'll use UserTrade, thanks.


st_area_spheroid - strange behaviour for polygons with holes

I'm using ST_Area_Spheroid to get area of polygons (landplots) in square meters. It does the work with 2 issues:

Minor issue: The area comes as negative value (but correct in absolute)
Major issue: The area of the polygon with a hole in it is calculated incorrectly (looks like the hole is not substracted).

I've checked the data with PostGIS and GeoPandas which were consistent in correct hole substraction
If I'm doing smt wrong - would appreciate any suggestions to the mistakes made.
If any workaround exist within DuckDB - I would very much prefer to stay with DuckDB (migrating my workflow from PostGIS/GeoPandas)
COPY (
    SELECT
        st_flipcoordinates(st_transform(geom,'EPSG:3857', 'EPSG:4326')) AS geometry,
        st_area_spheroid((st_transform(geom,'EPSG:3857', 'EPSG:4326'))) AS AREA_CALC_DUCKDB
        FROM rr_geo.rr_geo_raw
) TO 'test_export.geojson'
WITH (FORMAT GDAL, DRIVER 'GeoJSON', LAYER_CREATION_OPTIONS 'WRITE_BBOX=YES');

To confirm my suspicions I've used the following GeoPandas procedure:
import geopandas as gpd
gdf = gpd.read_file("test_export.geojson")
gdf["area_gpd"] = gdf["geometry"].to_crs({'proj':'cea'}).area
gdf

Resulting in the following DataFrame:

For reference: Polygons look as follows

The GeoJSON file attached (extension changed due to github limitation)
test_export.geojson.json

Hi! Thanks for filing this issue!
This does indeed seem like a problem on our end. Im working on a fix.


Versioning of Schemas

The schemas follow the versioning scheme of 'Details of the AAAS', for instance, are we currently working on version 3.0 RC01. How can we reflect that in our repo?
Let me make two suggestions for the beginning:

Let's add versions as top-level folders
Let's create releases for each version/revision and maintain only the latest revision as the source in the repo.

What's your opinion, @Manu3756 , @JoergWende, @BirgitBoss ?

I would go with 2: make releases for every official release or bugfix. The master branch should be the newest release. Working version should be on a working branch.

That's also my preference. I just created a develop branch for the working commits. Then let's do the following: master is protected, nobody is allowed to push directly. Merges are only executed at the release of a new version, after approval by the UAG AAS or Steering Committee, which directly triggers a (manual) creation of a new release.
develop can be protected or not. Still, content only in develop must not be used by productive systems.

@mristin: Does that fit to the conventions you formulated when creating the repo?

@sebbader We haven't really put up any convention regarding the branches. Personally, I find your approach fine!

We have an agreement, and this issue has been stale for a very long time. Therefore I am closing it.


Fix blend_modes example UI positioning

Objective
Fixes #8091
Solution
A position_type property was mistakenly deleted. This PR restores it.

The bug only appeared yesterday, so no need for the 0.10.1 milestone.

Oh, apparently I have permissions to do that.


Comparison with https://github.com/jetstack/kube-lego?

A comparison with https://github.com/jetstack/kube-lego would be helpful. AFAICT, both projects have the same goal?

kube-lego can only respond to challenges using the HTTP-01 challenge, and only works for Ingress objects.
kube-cert-manager is a lot more flexible. It:

Supports the other two challenge types (SNI-TLS-01, DNS-01)
Uses xenolf/lego to support a ton of DNS providers
Supports certificates as ThirdParty resources, meaning I can use kube-cert-manager to request TLS certificates for anything, like my IRC bouncer, for example

I also think that kube-lego ends up re-implementing a subset of ACME (instead of using xenolf/lego)


Split initialValue field into intialCountryCodeValue and initialPhoneNumber

As per subject. I think it would make more sense to split the field like that.
Also, it would be nice if it could parse input from packages like https://pub.dev/packages/mobile_number

How can I get the country code and phone number? Only phone number is being returned using controller !!!


Unable to send attachments with email

I am able to successfully able to send emails without attachments.
However, when I try to upload attachments using GTLUploadParamaters, I am getting a 501 error.
I have tried adding the NSData of an attachment from the Photo Library, as well as just sending the URL of an image.
In both cases I got the same error.
`// Create the message
GTLGmailMessage *message = [[GTLGmailMessage alloc]init];
message.raw = [self getFormattedRawMessageForMail:mail];

if(!self.gmailService) {
    self.gmailService = [Utilities initializeGmailService];
}
// Get the data of the image present in the photo library
GTLUploadParameters *image = [GTLUploadParameters uploadParametersWithData:[Singleton sharedInstance].dataImage MIMEType:@"image/jpeg"];

// Use a URL to get image attachment
NSURL *url = [NSURL URLWithString:@"http://res.cloudinary.com/demo/image/upload/sample.jpg"];
image = [GTLUploadParameters uploadParametersWithFileURL:url MIMEType:@"image/jpeg"];

GTLQueryGmail *query = [GTLQueryGmail queryForUsersMessagesSendWithUploadParameters:image];
query.userId = [ORBSingleton sharedInstance].userProfile.email;
query.message = message;

[self.gmailService executeQuery:query completionHandler:^(GTLServiceTicket *ticket, GTLGmailMessage *mail, NSError *error) {
    if(!error){
        handler(YES, error);
    }
    else{
        handler(NO, error);
    }
}];`

As the name implies, uploadParametersWithFileURL: is expecting a file url, there isn't support for fetching something remote and then uploading it.
The built in logging (https://github.com/google/google-api-objectivec-client/wiki#logging-http-server-traffic) can help show exactly what is being sent and returned, try turning that on to better see what is happening.

Thanks for the quick response Thomas and the tip to enable logging!
Ill change to use local URL and update this thread.

@thomasvl Are there any tutorials explaining how to send attachments using the Gmail Objective-C API? I tried searching for the documentation, but nothing was mentioned regarding the Objective-C implementation.

I hadn't even looked at the api until your question.  Looking at https://developers.google.com/gmail/api/guides/sending, and reading the Java, it does seem like it message body and attachement(s) have to go into a single mime document, and then that get uploaded.
The support area on that site includes where to try on stack overflow and their issue tracker, so you could try those places also for help.


Matcher to replace excludePath

This configuration from Spring Security (for OAuth support):
<security:intercept-url pattern="/oauth2.0/accessToken" access="permitAll" method="OPTIONS" />
<security:intercept-url pattern="/oauth2.0/accessToken" access="isAuthenticated()" />

draws my attention on the fact that excluding path can be enhanced with excluding HTTP methods so finally some matching concept.
I would create a Matcher interface with a boolean matches(WebContext context) method and two implementations: ExcludePathMatcher and ExcludeHttpMethodMatcher.
The excludePath parameter would be replaced by a matcherName paremeter in the pac4j implementations (like the clientName and authorizerName parameters): a list of matchers to meet.
The Config would have a new addMatcher, setMatcher and setMatchers methods.
A new MatchingChecker interface and a DefaultMatchingChecker implementation would be necessary for implementations to perform matching.

PR: https://github.com/pac4j/pac4j/pull/350

first implementation for J2E: https://github.com/pac4j/j2e-pac4j/pull/26 + demo: https://github.com/pac4j/j2e-pac4j-demo/pull/21


[JENKINS-22151] Enhanced Extension point

This resolves JENKINS-22151 and should allow to implement JENKINS-21750 with the extension point.

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

Hi @daspilker,
thanks for implementing the Extension point stuff :-)
I'm actually trying to implement the Promotion Plugin Extension and I have a problem with the ContextExtensionPoint.
Given is the following code snippet (PromotionsExtensionPoint.java):
@DslExtensionMethod(context = PropertiesContext.class)
public Object promotions(Runnable runnable, DslEnvironment dslEnvironment) {
	PromotionsContext promotionsContext = new PromotionsContext();
	executeInContext(runnable, promotionsContext);
	return null;
}

and the corresponding PromotionsContext.groovy:
class PromotionsContext implements Context  {
    def promotion(Closure closure = null) {
		System.out.println("promotion: " + closure);
    }
}

When I run this example dsl:
job {
	name('promotion-job')
	properties {
		promotions {
			promotion {
			    name('dev')
			}
		}
	}
}

... I always get this exception:
Caused by: groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.helpers.properties.PropertiesContext.promotion() is applicable for argument types: (script14380043214471369759433$_run_closure1_closure2_closure3_closure4) values: [script14380043214471369759433$_run_closure1_closure2_closure3_closure4@c6d095]

For me it's really weird that it searches for the method "promotion" in the PropertiesContext class. Do you have an idea whats going wrong at this point?
Thank you and Regards...
Dennis

Hm, not sure. Have you pushed your code into a public repo so that I can have a look?

Thanks for your fast reply :-)
I've created a fork from my colleague Thomas into our company repo and updated some versions etc. You can find it here: https://github.com/codecentric/job-dsl-promotions-plugin
The original issue was that we got a ClassCastException in line 27 of this class: https://github.com/codecentric/job-dsl-promotions-plugin/blob/master/src/main/java/org/jenkinsci/plugins/jobdsl/promotions/PromotionsExtensionPoint.java
Maybe it has something to do with using Groovy to extend the DSL (PromotionsContext.groovy)...

Mh, this seems to work:
job {
	name('promotion-job')
	properties {
		promotions {
			promotion('dev')
		}
	}
}

PromotionsContext.groovy:
    def promotion(String name) {
		System.out.println("promotion: " + name);
    }

If you get a ClassCastException when trying to cast to Closure, the reason might be that the Jenkins core brings a Groovy runtime and the Job DSL plugin brings it's own Groovy runtime. The plugin uses some Jenkins class loader magic to separate the two which may cause the problems. I'm going to remove the extra runtime in the next Job DSL release. So you can either wait a few days or try to implement the extension point in pure Java. Or you try a custom Job DSL build with this branch: https://github.com/CoreMedia/job-dsl-plugin/tree/remove-grab.

Ok, I will give it a try with the custom build :-) Thank you for your help!

That seems to work :+1:
But I don't see any detailed log output in the console from the Generator Job. I see only this:
Gestartet durch Benutzer anonymous
Baue in Arbeitsbereich /Users/denschu/git/job-dsl-promotions-plugin/work/jobs/generator/workspace
Processing provided DSL script
Warning: (DSL script, line 1) job is deprecated
Warning: (DSL script, line 2) name is deprecated
ERROR: (DSL script, line 4) Error calling extension
Finished: FAILURE

Any hints on how to switch detailed logging on? :-)

The stack trace should be logged to the Jenkins log, e.g. Manage Jenkins -> System Log -> All Jenkins Logs or /var/log/jenkins/jenkins.log.

Mh, I see only the normal system output from Jenkins in the log, but not from the executed generator job. With version 1.35 it worked fine. I started it with "mvn hpi:run"...

Ah, I changed the logging in 1.36-SNAPSHOT. You need to add a new log recorder for javaposse.jobdsl.plugin in Manage Jenkins -> System Log and set the level to FINE.

Ok, great, the logging works now :-)
Now I get a ClassNotFoundException:
Caused by: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
	at org.jenkinsci.plugins.jobdsl.promotions.PromotionContext.name(PromotionContext.groovy:27)
...
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
	at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1375)
	at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
	at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 214 more

I will dive into it tomorrow... Thank you so much for your help!

Hi @daspilker,
the plugin seems to work now... but I ran into the next problems ;-)
The JenkinsJobManagement.callExtension-method creates the XML with a special XStream-Implementation.
line 409 of JenkinsJobManagement
Object result = Iterables.getOnlyElement(candidates).call(getSession(item), args);
return new XmlParser().parseText(Items.XSTREAM2.toXML(result));

Whats the simplest way to write the correct plugin-name into the root node attribute like in this example:
<hudson.plugins.promoted__builds.JobPropertyImpl<EMAIL_ADDRESS>			<activeProcessNames>
				<string>dev</string>
				<string>dev2</string>
			</activeProcessNames>
</hudson.plugins.promoted__builds.JobPropertyImpl>

Is it maybe a better idea to be able to return the already generated XML from the Extension?
Thanks
Dennis

The actual implementation ist available here:
https://github.com/codecentric/job-dsl-promotions-plugin
And here the JobProperty as Java POJO:
https://github.com/codecentric/job-dsl-promotions-plugin/blob/master/src/main/java/org/jenkinsci/plugins/jobdsl/promotions/JobProperty.java

@denschu that's the correnc XStream instance for creating job XML configs, see https://github.com/jenkinsci/jenkins/blob/jenkins-1.565/core/src/main/java/hudson/model/Items.java#L400.
The idea is that a plugin can directly use it's POJOs as return values, because that's avoids the XML generation, the POJOs exist anyway and it will always generate the correct XML.
I recommend to try to use the JobPropertyImpl from the Promoted Builds plugin. Ideally the Job DSL extension for the Promoted Builds plugin should be a part of the Promoted Builds plugin to avoid problems across different versions of the Promoted Build plugin and changes or refactorings will also be applied to the DSL extension with the need to release an additional plugin.

Ah ok, thanks, I will try this solution :-)

Mh, the JobPropertyImpl from the Promoted Build plugin needs access to the actual project:

Ok, one solution would be, if we completely integrate the DSLExtension into the promoted-builds-Plugin, but in the first step it would be very nice to separate the DSL extension development from the main plugin.
I think generally it's a problem to integrate DSL extensions into the plugin. It would also slow down the whole process.

Ah, I see.
You do not need the plugin attribute on the root node anyway. The Job DSL does not generate these attributes and everything works fine. So you can still use your custom POJO.

Is there already a planned release date for 1.36? :-)
Thank you for your help!

Mh, I tested the POJO-stuff from above in more detail and I have some bad news... The attribute<EMAIL_ADDRESS>is generated by the special XStream-marshaller which is used by the Job DSL. The generator runs successful, but the Promotions doesn't show up in the job configuration.
This does NOT work:
<hudson.plugins.promoted__builds.JobPropertyImpl<EMAIL_ADDRESS>            <activeProcessNames>
                <string>prod</string>
            </activeProcessNames>
 </hudson.plugins.promoted__builds.JobPropertyImpl>

But this works (I changed it manually in the file system):
<hudson.plugins.promoted__builds.JobPropertyImpl<EMAIL_ADDRESS>            <activeProcessNames>
                <string>prod</string>
            </activeProcessNames>
 </hudson.plugins.promoted__builds.JobPropertyImpl>

So it seems to be, that there are some side effects with the plugin attribute.
Furthermore I found out that the POJO needs to extend the JobProperty-class. Otherwise I get a ClassCastException during job generation:
FATAL: org.jenkinsci.plugins.jobdsl.promotions.JobProperty cannot be cast to hudson.model.JobProperty
java.lang.ClassCastException: org.jenkinsci.plugins.jobdsl.promotions.JobProperty cannot be cast to hudson.model.JobProperty
	at hudson.model.Job.onLoad(Job.java:212)
	at hudson.model.AbstractProject.onLoad(AbstractProject.java:318)

That would be the solution, but it looks not very "clean":
@XStreamAlias("hudson.plugins.promoted_builds.JobPropertyImpl")
public class PromotionJobProperty extends hudson.model.JobProperty<Job<?,?>> {

	List<String> activeProcessNames = new ArrayList<String>();

	public PromotionJobProperty(List<String> activeProcessNames) {
		this.activeProcessNames = activeProcessNames;
	}
}

I deleted my last comment, because there is some weird behaviour in my local testing environment. I've to research some more details :-)

Maybe this discussion is interesting for you, @daspilker:
https://groups.google.com/d/msgid/jenkinsci-dev/16a2df29-c855-45bb-b9e7-de7b092bc3d7%40googlegroups.com?utm_medium=email&utm_source=footer


requirements: Upgrade Python requirements

pip.txt upgrades

setuptools: 68.2.0 → 68.2.2

prod.txt upgrades

boto3: 1.28.44 → 1.28.48
botocore: 1.31.44 → 1.31.48
greenlet: 3.0.0rc1 → 3.0.0rc3
openapi-core: 0.18.0 → 0.18.1
pillow: 10.0.0 → 10.0.1
rpds-py: 0.10.2 → 0.10.3
sentry-sdk: 1.30.0 → 1.31.0
stripe: 6.4.0 → 6.5.0
traitlets: 5.9.0 → 5.10.0

Other upgrades

black: 23.9.0 → 23.9.1
boto3-stubs[s3,ses,sns,sqs]: 1.28.44 → 1.28.48
botocore-stubs: 1.31.44 → 1.31.48
filelock: 3.12.3 → 3.12.4
ruff: 0.0.287 → 0.0.289
setuptools: 68.2.0 → 68.2.2
types-redis: <IP_ADDRESS> → <IP_ADDRESS>

Looks great, marked to merge once CI passes.


Bug on Simple Sms Remote: Clear whole log?  Has no "Ok" button to concur to request

Expected behavior
Simple Sms remote is an open source andriod application for controlling a mobile device through messaging. Clearing the log is performed by activating the log at the menu option on the top right hand side of the screen, then clearing the trash on log.
Actual behavior
The case as it may be is a bit different when I try to perform this operation. Everything works fine from clicking on the log at the top of the screen to opening the log, clicking on the trash icon, right up on till the point a dialog shows Clear whole log? with no OK feature to concur with request of clearing the log. The box just displays clear log? with no additional information and hence the process can not easily be carried out successfully.
How to reproduce

Click on the menu option at the top right corner of the application.
Click on log and this will appear.
Click on the trash icon as shown (see image below.
This dialog appears without an OK option to verify or concur to request in carrying out the operation. (see image below)

version of the application : v 1.2.0
last updated : 12/7/17

Browser: F-driod / Simple Sms Remote
Operating system: Andriod 7.0

Recording Of The Bug
https://youtu.be/gcL0-tH7wok
Posted on Utopian.io -  Rewarding Open Source Contributors

Fixed with #24 .

Thanks.
On Apr 13, 2018 18:09, "Andreas Kaltenleitner"<EMAIL_ADDRESS>wrote:
Fixed with #24 https://github.com/tranquvis/SimpleSmsRemote/issues/24 .
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tranquvis/SimpleSmsRemote/issues/28#issuecomment-381201214,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AikU-fN5t8S7hX_2YClFJiHJXz67Z0Wzks5toNvLgaJpZM4TJZYN
.


Remove main field of package.json in future

Also please make a new issue to remove main once the Metro issue is closed. https://github.com/jasonkuhrt/graphql-request/pull/526#pullrequestreview-1425387905

The main field in package.json was restored by https://github.com/jasonkuhrt/graphql-request/pull/526 for backward compatibility.
We hope https://github.com/facebook/metro/issues/670 will be closed and we can drop the main field again.

Thanks @morishin!


Beginner question: usage with nested state

Hi and thanks for this library!
I used it normally until I decided to separate a state of a form from everything else on the page, therefore creating a 'submodel' and a subset of messages for it.
Here's what I did illustrated on your example file:
type alias InputModel =
    { -- Add Autocomplete state to your model
      autocompleteState : Autocomplete String

    -- (Optional) final selected value from user
    , selectedValue : Maybe String
    }

type alias Model =
    { inputModel : InputModel }

type InputMsg
    = -- Autocomplete Msg
      OnAutocomplete (Autocomplete.Msg String)
      -- Your msg to be emitted when user selects a value
    | OnAutocompleteSelect
      -- (Optional) Your msg to be emitted on blur (to close autocomplete)
    | OnAutocompleteBlur

type Msg
    = InputMsg InputMsg

Now I'm getting type error practically saying that AutocompleteView.events now generates ImputMsg events instead of Msg.
I tried to pass messages like this
{ inputEvents, choiceEvents } =
            AutocompleteView.events
                { onSelect = InputMsg OnAutocompleteSelect
                , mapHtml = InputMsg OnAutocomplete
                }

but it obviously doesn't work.
What should I do to resolve this problem?
Full code and error traceback are in this gist: https://gist.github.com/weiss-d/19f4050d2759bd61b1e9ee7790bbf0a8

Based on your type, you nested OnAutoComplete into InputMsg.
When you try to pass InputMsg OnAutocomplete, it is actually an invalid code because that type is malformed as it requires one more argument to complete it (eg. Autocomplete.Msg String).
The correct way is to pass InputMsg << OnAutocomplete (note the <<).
InputMsg << OnAutocomplete is a "function" takes an Autocomplete.Msg String and creates a final InputMsg (OnAutocomplete (Autocomplete.Msg String).
This now fits what mapHtml requires:
https://github.com/futureworkz/elm-autocomplete/blob/a90d52c261e0e6148e89c31fdd0428b9f3ca71f6/src/Autocomplete/View.elm#L100-L112
So this should fix your problem:
{ inputEvents, choiceEvents } =
            AutocompleteView.events
                { onSelect = InputMsg OnAutocompleteSelect
                , mapHtml = InputMsg << OnAutoComplete -- Add << here
                }

FYI In case you are new to Elm, Union types (and also Record types!) works like functions... just like the example above.

Hi @stevenyap !
Yeah, about 2 weeks in Elm :) I felt like I'm missing something fundamental, but just couldn't grasp it. Thank you for the clarification.
Although now error is gone, but status is always stuck on Autocomplete.Fetching. Am I missing something else?

Try throwing around some _ = Debug.log "test" "here" in your code to see what went wrong... if you still can't solve it, post your new code here... it's probably something to do with your fetcher or your logic in your model...
Welcome to Elm! It's a really enjoyable language!
Now update looks like this:
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        InputMsg inputMsg ->
            let
                ( newInputModel, newCmd ) =
                    updateInput inputMsg model.inputModel
            in
            ( { model | inputModel = newInputModel }, Maybe.withDefault Cmd.none newCmd )

And updateInput:
updateInput : InputMsg -> InputModel -> ( InputModel, Maybe (Cmd InputMsg) )
updateInput msg inputModel =
    case msg of
        -- This is the main wire-up to pass Autocomplete Msg to Autocomplete state
        OnAutocomplete autocompleteMsg ->
            let
                ( newAutocompleteState, autoCompleteCmd ) =
                    Autocomplete.update autocompleteMsg inputModel.autocompleteState
            in
            ( { inputModel | autocompleteState = newAutocompleteState }
            , Just (Cmd.map OnAutocomplete autoCompleteCmd)
            )
-- ... the rest of the branches ...

But I have no idea how to convert Cmd InputMsg from updateInput to Cmd Msg in this context. Could you suggest something please?
Also updated the gist with full code and current error message.

Great job in finding out the bug!
To map your Cmd, here's a hint:
Given type Msg = Wrapper InputMsg and you have a InputMsg,
then to make it into a Msg,
you can use Cmd.map Wrapper InputMsg
or simply Wrapper InputMsg (remember Wrapper is a function  😉)
Also, there is no need to use Maybe for your Cmd.
If you don't have a Cmd to execute, simply return Cmd.none which is a Cmd that does nothing.
This saves you the trouble of casing out Maybe.
Hope this helps!
BTW there is https://elm-lang.org/community/slack and https://discourse.elm-lang.org/ where you can post your code to ask for help. The community is very very helpful and friendly so it's good to get in touch with them.

Ok, I see, I just can return Cmd Msg instead of Cmd InputMsg from nested update function and convert inside this function. Not sure if what I've made is beautiful, but it did the job 😄. Updated the gist in case someone stumbles upon this thread.
While I feel like public slacks are somewhat overloaded, I'll definitely check out discoruse.
Big thanks again for all the tips!


[annotation] Consumable event with ClickListener

This pr resolves https://github.com/mapbox/mapbox-plugins-android/issues/966 and is a duplicate of @Ph0tonic's work in https://github.com/mapbox/mapbox-plugins-android/pull/1123. I opened this so that CircleCI credentials would work correctly.
Thank you very much for your contribution @Ph0tonic.
cc @adrianababakanian

You're' welcome. 👍


[Marker.io] lot of information is not present in the mobiile image

Steps to reproduce:

scroll down to the section with animation and mobile image
compare with figma

Actual result: figma shows lot of text etc in the mobile image which is not there in the actual page
Expected result: please check and fix
if current behaviour is not the expected one and is not correct.

Reported by: vinod<EMAIL_ADDRESS>- Contact via Marker.io
Source URL: https://wf-b.stg.prezzee.com/en-us/smart-card
Issue details: Open in Marker.io
Device typedesktopBrowserChrome <IP_ADDRESS>Screen Size1366 x 768OSWindows 10 (10.0.0)Viewport Size1366 x 641Pixel Ratio@1x

🤖 Marker.io bot - This issue was marked as ✅ Resolved in Marker.io