getDestination fails to lookup destination in provider account

Describe the bug
API getDestination fails to lookup destination from the provider account when accessed in the context of a user from subscriber account. This is the case even with option selectionStrategy: DestinationSelectionStrategies.alwaysProvider set. This case fails for authentication types OAuth2JWTBearer and OAuth2ClientCredentials. It works for authentication type OAuth2UserTokenExchange.  It appears from the log that the destination is found in all these cases in provider account, but when sdk requests for credentials, it requests this from subscriber account.
To Reproduce
Steps to reproduce the behavior:

Set up 2 multitenant applications (A and B) in BTP, one (called A) with dependency to destination service
Create a basic nodejs app with dependency to cloud SDK. For example with CAP cds init flights --add nodejs
Subscribe the app A and B from another account.
Grant authorization to a user to the apps (A and B)  in subscriber account.
Grant authorization to a user (can be the same) to the apps (A and B) n provider account.
Create a destination for app B in provider account, example given below. Credentials in the destination are from a key created for the xsuaa for app B.
Configure the destination for authentication type OAuth2ClientCredentials.
Extract the service credentials for the app A to a file default-env.json
Set environment variable access_token with value as jwt token for the user in subscriber account
Use getDestination to lookup the destination using the jwt token and service credentials for app A. Example see the script given in code examples.

Expected behavior
API getDestination should return the destination configured in provider account.
Used Versions:

node version via node -v
v14.18.1
npm version via npm -v
7.16.0
SAP Cloud SDK version you used as dependency
npm ls @sap-cloud-sdk/core
<EMAIL_ADDRESS>C:\Work\cap-mtx-project
└─┬<EMAIL_ADDRESS>└──<EMAIL_ADDRESS>
Code Examples
The following script was used for the tests. Logs from different runs of this is attached. See next section.
To support the script you need default-env.json from the deployed multitenant app.
You also need supply environment variable access-token with the jwt token for an authorized user from provider account and subscriber account, one at a time. I had these in an .env file
const _debug = require("debug")("test:log");
const _debugOptions = require("util").inspect.defaultOptions;
function debug(msg,depth=0){
    oldDepth = _debugOptions.depth
    _debugOptions.depth = depth
    _debug(msg);
    _debugOptions.depth = oldDepth
}
require("debug").enable("test:log")
debug("starting")

const sdk = require("@sap-cloud-sdk/core");
require("@sap/xsenv").loadEnv();
require("dotenv").config();

require("@sap-cloud-sdk/util").setGlobalLogLevel("debug")
let dest = "CAP-Incidents";
let options= {userJwt:process.env.access_token, selectionStrategy: sdk.DestinationSelectionStrategies.alwaysProvider};

// what is the subdomain of the user access token?
debug({ "userJwt-Subdomain": sdk.decodeJwt(options.userJwt).ext_attr.zdn },2);

sdk.getDestination(dest,options).then(d => {
    debug(d,1)
}).catch(e => {
    debug()
    debug({
        "status":e.rootCause.response.status,
        "message": e.rootCause.response.data,
        "path": e.rootCause.request.path,
        "headers": e.rootCause.request.getHeaderNames(),
       // what is the subdomain of the request for destination?
        "Authorization-Subdomain": sdk.decodeJwt(e.rootCause.request.getHeader("Authorization").split(" ")[1]).ext_attr.zdn
    },3);
});

Exported destination configuration looked like:
#
#Mon Nov 15 11:10:22 UTC 2021
Name=CAP-Incidents
ProxyType=Internet
Type=HTTP

URL=https\://112XXXc5trial-dev-cds-mtx-project-srv.cfapps.eu10.hana.ondemand.com

Authentication=OAuth2ClientCredentials

tokenServiceURLType=Common
tokenServiceURL=https\://authentication.eu10.hana.ondemand.com/oauth/token

clientId=-- removed ---
clientSecret=<< Existing password/certificate removed on export >>

Log file
Attached log file err-log.txt has logs for the following runs:

access_token from subscriber, authentication: 'OAuth2UserTokenExchange'
access_token from provider, authentication: 'OAuth2UserTokenExchange'
access_token from subscriber, authentication: 'OAuth2JWTBearer'
access_token from provider, authentication: 'OAuth2JWTBearer'
access_token from subscriber, authentication: 'OAuth2ClientCredentials'
access_token from provider, authentication: 'OAuth2ClientCredentials'

In the log:

subscriber sub-domain is 112XXXc5trial-c1
provider sub-domain is 112XXXc5trial

Impact / Priority
This is forcing us to configure the destination in subscriber accounts leading to effort in creating these, potential leak of credentials specified and high effort in key rotation.
Timeline: GTM is planned for December 2021. First go live expected in 2022.
Additional context
This was discovered in the context of a CAP multi-tenant app development. We have 2 micro services, one needs to call the other.

Hi @dinurp ,
Thanks for raising this up.
I have some questions when reading the description and also created an architectural diagram here for better communication. It would also be great if you can fix the diagram (if I'm wrong) and we can communicate based on that. I renamed the drawio file to txt extension for uploading limits.
Please find my questions below:
In general, where did you execute the code snippets? I assume local machine as you copy the service credential, which should not be the case for CF?

Create a basic nodejs app with dependency to cloud SDK. For example with CAP cds init flights --add nodejs

I assume this is a new app, so I mark it as test application C, which has the code snippets provided. Am I wrong?

Set up 2 multitenant applications (A and B) in BTP, one (called A) with dependency to destination service.
Create a destination for app B in provider account, example given below.

The destination is created in the provider account, where B is deployed. However, previously, you only mentioned A binds the destination service. Are A and B deployed with the same subaccount?

Set environment variable access_token with value as jwt token for the user in subscriber account

Which user are you talking about? A user of Application C?
Thank you very much.
I'm looking forward to your reply.
Best regards,
Junjie

BLI created. Link to private repo visible for internal colleagues.

Should also be fixed by this PR: https://github.com/SAP/cloud-sdk-js/pull/1867.

version 1.53.0 is released, which should fix the issue.

I close the issue to keep our board tidy. If you experience problems please reopen or open a new issue.

Works great. Thanks.


Update demo for battery module

Move config files to root folder
Update tests to comply with mock data path

Codecov Report

Merging #208 (d4e8132) into master (d2e82b0) will decrease coverage by 0.12%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
- Coverage   74.47%   74.34%   -0.13%
==========================================
  Files          42       41       -1
  Lines        2550     2534      -16
==========================================
- Hits         1899     1884      -15
+ Misses        651      650       -1

Impacted Files
Coverage Δ

niimpy/preprocessing/battery.py
51.14% <50.00%> (+0.38%)
:arrow_up:

config/config.py
100.00% <100.00%> (ø)

tests/preprocessing/test_audio.py
100.00% <100.00%> (ø)

tests/preprocessing/test_communication.py
100.00% <100.00%> (ø)

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 d2e82b0...d4e8132. Read the comment docs.


script not working

password is not correct.

Hi @andreykanava ,
Sorry that you seem to be having this issue. I'll do my best to figure out what's going on with your system, as well as recommend a few fixes right now.
On Linux systems, occasionally a bug will occur where the terminal hangs-up on the wifi connection. Already in place is a time.sleep call on Line 147, which seems to fix it on most systems, but may not work on yours.
If you change the time.sleep(3) (Line 147) to another number (say, time.sleep(5)), you may have better results.
Let me know how it goes! If this doesn't seem to work, please comment with some more info, such as your OS, its version, etc.

I'm getting the same error, Increasing the time prevents it in some cases but, would be better to handle the situation with a couple of lines of code when trying to connect,
The code  also needs to cover the case when the SSID is not found (that sometimes happen) and should retry the password trial and not dropped it. I made a pull request, but this part is not solved.

I have code that checks the status now so that it never times out as
before. I will push as soon as I fix a few more bugs (such as spaces in the
WiFi network name causing it to crash)
On Sat, Jan 29, 2022 at 10:32 AM Pablo @.***> wrote:

I'm getting the same error, Increasing the time prevents it in some cases
but, would be better to handle the situation with a couple of lines of code
when trying to connect,
The code also needs to cover the case when the SSID is not found (that
sometimes happen) and should retry the password trial and not dropped it. I
made a pull request, but this part is not solved.
—
Reply to this email directly, view it on GitHub
https://github.com/flancast90/wifi-bf/issues/2#issuecomment-1024932663,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AR2EVEBBFTEGHSMLCPOVIOTUYQB7FANCNFSM5IWXG5PA
.
You are receiving this because you commented.Message ID:
@.***>

fixed. Let me know how it works now.


Hud

lol not done

Looks great, I've merged the current version but feel free to do more work on this pr


429 Limits

Hi,
Are the limits re: 429 errors tied to an IP address or user (if logged in)? Can you run multiple instances if you use different logins?
Thanks

I'm convinced they're tied to the user when logged in, and tied to the IP otherwise. Hence, running multiple instances with different logins should work.
Could you try it and tell us your results?

It is per user (I alternate when downloading HD profile pictures). But, I don't know if today instagram is unstable since I am getting the error way earlier and with two accounts and even when not logged in, or they are checking the IP. When I try it using an anonymous window, it asks me to login right away.
So, I think it blocks first the user, then the IP. I know the instagram API seems to be unstable today, so the IP block might not exist, but the different logins did happen way before.


Curi + React Native integration

I wonder if it works on React Native too?

I think that the @curi/react-native package is in a good enough place right now to close this.
Implementation is mostly similar to a regular React app and the React Native tips guide covers a few extra things to know.


[5pt] Warning: field slop of feature 0 not successfully written

During a spot check of the <IP_ADDRESS> warning log, one jumped out that might require more investigation.  HUC: 08010206.
/logs/unit/08010206_unit.log:248:demDerived_reaches_0 Warning 1: Value -121.045665045639097 of field Slope of feature 0 not successfully written. Possibly due to too larger number with respect to field width
./logs/unit/08010206_unit.log:249:Warning 1: Value -443.331684080534671 of field Slope of feature 2 not successfully written. Possibly due to too larger number with respect to field width
./logs/unit/08010206_unit.log:250:Warning 1: Value -10356.1040600003835 of field Slope of feature 4 not successfully written. Possibly due to too larger number with respect to field width
./logs/unit/08010206_unit.log:251:Warning 1: Value 1159.83345714760412 of field Slope of feature 5 not successfully written. Possibly due to too larger number with respect to field width
./logs/unit/08010206_unit.log:252:Warning 1: Value -156.251740137159544 of field Slope of feature 11 not successfully written. Possibly due to too larger number with respect to field width
./logs/unit/08010206_unit.log:253:Warning 1: Value 2025.08105677148501 of field Slope of feature 32 not successfully written. Possibly due to too larger number with respect to field width
./logs/unit/08010206_unit.log:254:Warning 1: Value -419.425115834844121 of field Slope of feature 98 not successfully written. Possibly due to too larger number with respect to field width

This warning is being generated in the TauDEM streamnet function (https://github.com/NOAA-OWP/inundation-mapping/blob/dev/src/delineate_hydros_and_produce_HAND.sh#L83).


Why the test results are different every time？

I use the same model to detect the results of the validation set, but I get different results each time.

The model are Graphrcnn_po, Graphrcnn_vo and Graphrcnn_voi.

The models are Graphrcnn_po, Graphrcnn_vo and Graphrcnn_voi.


How to implement linear aggression algorithm in visual studio code using python

NOTE: All 1st-time contributors should know Topic approval and PR submission does NOT guarantee your Topic/Article will be published. Our team of Peer Reviewers and Content Moderators will review all PRs that come in to make sure they adhere to the standard of quality we expect from the EngEd community.
We expect all community memebers to go through provided examples, resources, and previously published material before submitting content. As a rule of thumb, please only submit articles (pull requests) that are complete, formatted correctly, and include a fully polished article (ready to be published and error free).
All revisions and edits should be completed on your own forked repo (as to not take up room in the queue). Any PR that is submitted incomplete (meaning not ready to be published as is) will be closed. A PR being closed does NOT mean the article can not be published (or fixed) it simply means that the edits, revisions, and fixes will happen outside of the queue.
NOTE: Any topic suggestion copied/taken/modified from YouTube may Lead to a permanent ban from the community.
Topic Suggestion
How to implement linear aggression algorithm in visual studio code using python
Pre-submission advice
By following all our pre-submission advice and reviewing our Resources folder, you will maximise your chances of your topic being approved.
We ask that you please be patient as our team works through approving and publishing all articles/tutorials in a timely manner.
Allow 1-3 days for a topic to be reviewed and/or approved - allow 3-7 days for an articles to be reviewed and/or published (subject to vary depending on volume and/or backlog of articles).
Be sure to visit our Resources Page for tools, resources, and example articles that will help you propose and write a successful article.
Please ensure that you have only one open issue + linked pull request at a time. This will ensure that we complete the article in a timely manner from inception to publishing.)
We tend to stray away or tend not to publish reviews/comparisons of commercial product offerings.
Writing sample(s):
Include any links or writing samples - to help our team better gauge your writing quality.
Proposal Submission
Proposed title of article
How to implement linear aggression algorithm in visual studio code using python
Use keyword research to improve your article's SEO.
Proposed article introduction
Linear aggression is a statistical model algorithm in machine learning that is used to predict a dependent variable based on a given independent variable. It can be a very important to to identify certain trends and predict the future outcomes. It can be used in e-commerce sites to predicts sales prices inclination or declination.
For the advertisement sites it can be used to predict the expected customer  future action towards a certain product. This article will provide the easiest way to implement agression algorithm in visual studio code using python.
Key takeaways
1.Deep understanding of aggression algorithm
2.Advantages of this algorithm
3.Applicational area where the algorithm is necessary
4 .The tools required in visual studio. Prerequisites of setting python and required libraries in visual studio code.
Article quality
The article is aimed to be unique, simple to understand and well comprehensive. It will touch on key notches that have been abandoned by most sites in the web.
References
Please list links to any published content/research that you intend to use to support/guide this article.
Conclusion
Finally, remove the Pre-Submission advice section and all our blockquoted notes as you fill in the form before you submit.
We look forwarding to reviewing your topic suggestion.
Templates to use as guides

How To Guide Template
Software Review Template
Tutorial Template

Good afternoon and thank you for submitting your topic to the EngEd program.
After some careful consideration it struck us that this topic may be a bit over saturated throughout other blog sites and official documentations. We typically refrain from publishing content that is covered widely on the net or other blogs. We're more interested in original, practitioner-focused content that takes a deeper dive into programming-centric concepts.
But in order to approve the topic it has to serve value to the larger developer community at large. Please feel free to suggest an alternate topic to explore. 🚀
An option and a great way to write this as an in-depth article and make it more add value to the greater developer community at large would be to walk the reader through the USE of methods and functions by building a unique, different, useful project.
If you believe your article is unique enough - please present your case to explain how it will be different from what is currently out there?
https://www.google.com/search?q=linear+aggression+algorithm+in+visual+studio+code+using+python&rlz=1C1CHBF_enUS891US891&sourceid=chrome&ie=UTF-8


Solution for day 10 part 2 ... finally 😌

"AND THEN I MEMOIZED IT AND IT JUST WORKED" said @sometorin from the other room >.>

@tsandall even


Poll frequency?

I couldn't find in the documentation just how often the client polls the proxy.
I presume the answer is once per second, as per the below line in client.go?
			time.Sleep(time.Second) // Don't pound the server. TODO: Randomised exponential backoff.
Thanks!

That code is only used in case of error. It'll generally always have one poll going, though attempting sub-second scrape intervals is generally unwise before even adding PushProx to the mix.

Thanks for the prompt reply, Brian. I was actually looking to reduce the
frequency from (what I thought was) 1 second, to something like 5 or 10
seconds.
On Wed, May 15, 2019, 6:09 AM Brian Brazil<EMAIL_ADDRESS>wrote:

That code is only used in case of error. It'll generally always have one
poll going, though attempting sub-second scrape intervals is generally
unwise before even adding PushProx to the mix.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/RobustPerception/PushProx/issues/52?email_source=notifications&email_token=ACEOMQVHLU4Y32P2VMLOH6LPVPOPFA5CNFSM4HM47Q62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVOGAVY#issuecomment-492593239,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACEOMQXPB3WMYZDFNX6BTKTPVPOPFANCNFSM4HM47Q6Q
.

Brian, after looking into this further, I think my question stemmed from a lack of understanding of the model...
I originally thought that, every so often and under a set frequency, the client would initiate a connection: send to the proxy a request like "hey is there an outstanding request for my metrics?", that the proxy would then respond with either "not at the moment" or "yup send me your stuff", and if the latter then the client would send the metrics - and that was it for that connection.
But after I spent some time looking at tcpdump output, I see that is not exactly the case... Looks like there is only one connection going all the time, and sometimes (every minute) the client will send a packet first (I think 'keepalives', but not sure since I'm using an HTTPS reverse proxy so the contents are encrypted), and other times (also every minute) it will be the proxy initiating with a scrape request.
Although, the above is true with a 1-minute scrape frequency... If I set a longer interval (say 2 min), then I see an error every other minute:
Client-side:
level=error ts=2019-06-04T14:22:28.153Z caller=client.go:167 msg="Error reading request:" err="invalid method \"<!DOCTYPE\""
Proxy-side:
level=info ts=2019-06-04T14:22:29.178Z caller=proxy.go:125 msg="Error WaitForScrapeInstruction:" err="request is expired"
I don't see the above messages when the scrape frequency is 1-minute... I'd love to hear your thoughts Brian?

@brian-brazil , I'll close this issue as my original question has been answered. Thanks for your reply.
As for the "invalid method" errors, while I'm still seeing those (and suspect them to be at the root of a gaps issue I am having), I'll first try installing the latest versions of both pushprox client and server, and should that not help I'll log that as its own separate issue.
Thanks again,
Saul


Inline suggest hover inconsistent keybinding style to other editor hovers

Testing #172029
I'm not saying one is better than the other, but it's an inconsistency that was pretty obvious to me

Also consider using key symbols and setting the key element's title to spell out the key, like ↹ for tab

Initially we used the same font and parentheses as in the first screenshot, but we decided to put less emphasis on the keybinding by using a smaller font-size, a border around the key and making it transparent.
FYI @jrieken

+1 for consistency. also happy to adjust the suggest status bar. Tho, we also have a few more places like link hovers that show/render keybindings

The keybindings editor has had the most UX love so far so that seems like the way to go currently. It also has a slightly different style:

@hediet it looks like the hover isn't picking up the styles despite using that class. I don't see the background color + the special bottom border they use.


🐛 [firebase_messaging] WEB: do something when notification is clicked

I have integrated the firebase_messaging package in my flutter web app. I am able to display notifications both when app is in foregroung or background.
I would now like to open a specific page in my application when the user clicks on the notification. For now, when I click on the notification, the notification is dismissed and nothing happens.
I tried declaring an event handler for the notificationclick event, but it never gets triggered.
This is the code in my firebase-messaging-sw.js file:
//Code for adding event on click of notification
self.addEventListener('notificationclick', function(event) {
    console.log('Notification clicked');
});

importScripts("https://www.gstatic.com/firebasejs/9.15.0/firebase-app-compat.js");
importScripts("https://www.gstatic.com/firebasejs/9.15.0/firebase-messaging-compat.js");

firebase.initializeApp({
  apiKey: "...",
  authDomain: "...",
  databaseURL: "...",
  projectId: "...",
  storageBucket: "...",
  messagingSenderId: "...",
  appId: "...",
  measurementId: "..."
});

const messaging = firebase.messaging();

messaging.onBackgroundMessage(function(message) {
    console.log('Received background message ', message);

    const content = JSON.parse(message.data.content);
    const notificationTitle = content.payload.summary ? content.payload.summary : content.payload.title;
    const notificationOptions = {
      body: content.payload.body,
      data: message.data,
    };

    self.registration.showNotification(notificationTitle, notificationOptions);
});

And then I send test notifications using Postman like this:

{
    "registration_ids" : ["..."],
    "priority": "high",
    "mutable_content": true,
    "data" : {
        "content": {
            "id": 1,
            "badge": 42,
            "channelKey": "alerts",
            "layout": "BigText",
            "showWhen": true,
            "autoDismissible": true,
            "payload": {
                "redirectTo": "contractDetails",
                "id": "00322860-4a11-11ed-b06b-a77c38cad970",
                "title": "Huston!
            }
        },
        "actions": [
            {
                "key": "REPLY",
                "label": "Reply",
                "autoDismissible": true,
                "requireInputText": true
            }
        ]

    }
}

Is there a way to push a route based on the notification payload when the notification is clicked (just like it is possible on android and iOS), or at least to focus my app...?
I've been stuck on this for 5 days now, so any help is greatly appreciated :)

Currently, the documentation does not seem to show how to handle interaction for web.
https://firebase.google.com/docs/cloud-messaging/flutter/receive#handling_interaction
Keeping this issue open for team's attention and insights on expected behavior.
Related: https://github.com/firebase/flutterfire/issues/10268

hi @jorgeroncero
step 2 : Run a bash scrip
run it in which dir. & it is after the build or before it .

I ended up using awesome_notifications and awesome_notifications_fcm to handle notifications on Android and iOS. For web i then integrated the Google JavaScript SDK directly using js and dart interop to handle the callback functions.
Using this setup, the notificationclick handler defined in the service worker works perfectly.
It must be something with this package intercepting the notificationclick event I'd guess that doesn't make it work.

Closing this out in favour of this issue: https://github.com/firebase/flutterfire/issues/10268. They're effectively the same.


The "confirm" prompt will appear inconsistently in these arbitrary conditions

I guess this may be unrelated to volt.
The confirm prompt is called :h more-prompt.
But Vim sometimes behaves slightly different for input by mapping from user input.
You can feed keys to Vim as same as you type using feedkeys() (note that t for 2nd argument).
cnoremap <expr> jk [feedkeys("\<CR>", 't'), ''][1]

Oh... sorry...
I completely misread that this is another repository's issue because I see your name :)
I noticed when I see there is no close button...

Works fine for me, if I start Vim with "vim --clean".  I suspect you have some option set.

https://asciinema.org/a/wIipr1jAXlWQxMR3AcgMdSfCN
Here I demonstrate exactly what the problem is. I also started it with vim --clean as you can see.
What kind of behaviour are you getting?

@AvianY if you don't want to see more-prompt when you hit jk, you can use above setting.

cnoremap <expr> jk [feedkeys("\<CR>", 't'), ''][1]

I tried it and it works fine, but the reason I opened this issue is to highlight a possible bug, since I am not sure how vim works under the hood, others will decide if this is really a bug or just normal behaviour.

That happens, because if you actually type anything into the command line, the flag need_wait_return will be set to FALSE
https://github.com/vim/vim/blob/9e353b5265bd7fa103caf4e5a9b3c99f344f548e/src/ex_getln.c#L2475-L2477
However, when the input comes from a mapping, the need_wait_return will be set to TRUE and so you see the wait-return message. I am not sure we should change it.

(I have no clue, why the code snippet isn't actually put into the issue, sometimes when pasting permalinks to code, github creates a nice little preview of that particular code. Don't know why this does not happen here.)


Refresh page will lost current url path and come back to initial path including "#" at the end

I'm using url strategy along with auto route, i pass some query parameters through the page but once i want directly open that page including the queries then the app will come back to initial route and the # will appear for a bit...
Flutter version: 3.7.5
url_strategy version: 0.2.0

Hey @mahammadbakr
Could you provide us with a minimal reproducable sample to investigate the issue please?


gtest simplification

Hi,
I just took the time and added googletest to CmDaB. So now the second generated CMakeLists isn't needed, and everything runs smooth in on process.
For now I left the compile.sh and run_test scripts in, but as they have hardcoded output-path's and path's where to look for gtest, and are not run at all by now, I hardly doubt that they make any sense in here.
I also ignored the subdirs of the gtest dir, as they seem to me not like tests and more like examples for gtest. In this case I also don't see a reason for keeping them. Except for the tools dir, as they are used in the upnpapi tests.
For now this all is excluded on Win, as the test unconditionally includes <ifaddrs.h>, <arpa/inet.h> and <net/if.h> which just don't exist.
And for the failing tests, I don't know what is failing there, but it's in the containers. As long as one Ubuntu-Build succeeds, everything is fine.

And I just checked, on Mac the tests don't work, too. But there seems to be a problem in the test-scenario as build runs fine.

For win did a short check, if removing the includes and using UpnpInet.h instead, it goes a bit further, but @ingo-h used inet_aton and all that stuff. Yep, it's nice the be able to mock some things, but a multiplattform lib should also have multiplatfrom tests.

With some subdirs it was the idea to show how it works or how it is made so that you can understand it better. If it is not wanted it's no problem to omit them. Having the tests running for the other platforms is one of the steps in the near future. I will make a ToDo list. The idea is for example to run the MS Windows tests together with the Linux tests. As already told in the past, the compile.sh are really not the final solution. What will be used? Cmake scripts? If one can be given as example I would use it.

Take a look at gtest/CMakeLists.txt, there you should be able to reproduce as many tests as you want. Maybe I'll pack that in a wrapper function when more test come in.
For the subdirs, maybe @mrjimenez find's it interesting or usefull, if not we need to know what can be removed. I guess everything except tools/

Guys, I leave it all up to you. Feel free to experiment. I just ask for a little documentation so that we all know how to test and benefit from it.
Regards,
Marcelo.

@Vollstrecker OK, I will use that CMakeLists.txt with a little learning curve. I will remove the extra subdirs and put a documentation into the README and on stack overflow.


Specify Summary quantile semantics

Prometheus Summary semantics aren't currently formally specified, however there is by now a defacto standard.
The quantile is over the last 5ish minutes. If there was no data in that time, then a NaN should be reported. This is as a 0 _count would produce NaN when you did _sum / _count.

As we may be taking in metrics from other systems with different semantics, this will need to be a SHOULD rather than a MUST.

We can suggest a default value, but the wire format arguably needs to be able to handle quantiles over different time frames. Oil pumps are usually queried once per hour or day, power quality meters are precise down to microseconds. I am not even sure if we should mandate the default as SHOULD or MUST.
Prometheus and every other software would be free to drop anything unfitting, of course.

The wire format would have no knowledge of the time frame, it's more aiming for some consistency where possible.

Another question is should we move the quantile label to the metric name

To be super pedantic, should we prevent allowing folks to transport quantiles period? The reason being, at query time, you can't accurately combine them. Instead only transport summaries/histos. (And at the same time, don't allow folks to transport "average")

To be super pedantic, should we prevent allowing folks to transport quantiles period?

While I agree in theory, in practice these are common enough that I think we have to support them.
Post aggregation in a monitoring system, quantiles and averages are valid gauges to have.


Clean up config types

This reduces the additional configs (TallyDynamicConfigDatum, VoteDynamicConfigDatum and VoteMinterDynamicConfigDatum) to just the fields that are actually used in the scripts instead of mirroring all of DynamicConfigDatum.
It's pretty much superseded by #17 - but no harm in merging this first either, whichever your prefer.

Thanks! @Randy1Burrell - I merged the previous one and brought this one up to date with main then, but it requires another approval after that


Use Traefik instead of Contour to work around the end-to-end flakiness of the Gateway tests

This is part of the "Reducing flakiness of our end-to-end suite" effort (https://github.com/cert-manager/cert-manager/issues/4950)

Contour seems to have issues with its Gateway API implementation (or the issue comes from some unknown data race of ours). The Contour controller, sometimes, gets stuck with the following message appearing over and over:
time="2022-03-10" level=info msg="Gateway not found in cache." context=GatewayAPIProcessor

This message usually appears 1 to 3 times:
$ curl -sS https://storage.googleapis.com/jetstack-logs/pr-logs/pull/cert-manager_cert-manager/4933/pull-cert-manager-e2e-v1-23/1501889408746393600/artifacts/cert-manager-e2e-logs/kind-control-plane/pods/projectcontour_contour-79bdf94f8-kprj4_9470876d-a8e7-4a8c-abf3-3cf68a2e8a30/contour/0.log \
  | grep -F "Gateway not found in cache" --count
1

With faulty jobs, the message appears over 3000 times:
$ curl -sS https://storage.googleapis.com/jetstack-logs/pr-logs/pull/cert-manager_cert-manager/4929/pull-cert-manager-e2e-v1-23/1501497109084377088/artifacts/cert-manager-e2e-logs/kind-control-plane/containers/contour-79bdf94f8-rtb5j_projectcontour_contour-efd515faf55c966dd5c82c8eaaebb4ab1c5d2d7a91be1e6bd7aed663c6bec656.log \
  | grep -F "Gateway not found in cache" --count
3129

Here is a list of jobs where numerous Gateway not found in cache messages were seen:

PR
Prow job page
Contour logs
Number of occurences of the message

#4929
4929/pull-cert-manager-e2e-v1-23
0.log
3129

#4994
4994/pull-cert-manager-make-e2e-v1-23
0.log
3038

#4923
4923/pull-cert-manager-e2e-v1-23
0.log
3017

#4934
4934/pull-cert-manager-e2e-v1-23
0.log
3095

#4983
4983/pull-cert-manager-e2e-v1-23
0.log
3245

Since Traefik 1.6.1 added support for v1alpha2, I propose to switch to Traefik until we find what is going on with Contour.
/kind flake
NONE

It seems like the message doesn't show anymore, and I have found no consistent way of reproducing it. I opened https://github.com/cert-manager/cert-manager/issues/5005 to remind ourselves to investigate this weird behavior. I'll close this PR for now.


LinearPath can divide by zero generating NaN

This happens when two equal points are adjacent in the vertex list.
See: http://flashpunk.net/forums/index.php?topic=2723.0
Probably happens with other motion tweens also?

Fixed this issue for a class. If two equal points are adjacent in the vertex list their distance was computed and saved to 0. This was later called in the update() that would return NaN when trying to divide by 0. I fixed it by adding a condition to check if the computed distance was 0 and if it was set it to 1. So when the update() performs the division it returns the same number. This works because there is no distance between two equal points, it is just that point.

Hmm, I'm not sure eric's solution really does what we want it to do. Picking 1 as a default distance is arbitrary, and it will cause wrong results if further points are added after the zero-distance segment (consider the two-segment path (0,0), (0,0), (1,0), which should have distance 1, not 2).
I've put together a comprehensive fix, which you can find in commit 1db71a9c.
That patch does two things (which I should have separated into different commits, but didn't bother). First, it ignores attempts to add path segments that have zero length. This prevents the reported zero division as a side effect. Second, it alters the behavior of the class when only a single point has been added (or when a second point was added, but was ignored because it resulted in a zero-length segment). Previously, the tween would throw an exception when you tried to set the motion's duration or speed, now it will simply stay at that single location for the whole period of the tween (it doesn't move).
While I was looking over the forum thread Draknek linked above, I saw that the poster had reported another issue, that the tween was initialized to (0, 0) and didn't return a point on the path until after its first update. That's rather awkward, so I fixed it to immediately set its coordinates to the first point on the path in commit 6635ff59. You can find both commits on my LinearPath-fix branch.

Great, thank you both. :-)


Fix typoes, include some links, clean up

Actually the dependency may have to be
compile ('de.madcyph3r:materialDrawer:1.0.6@aar') {
    transitive = true;
}

but I'm not too sure. Seems to work fine without that.

Hello, for now it works without transitive = true, because there are no dependencies. Thank you for your commit :).


alt! combined with !tag_s is sensitive to ordering

When using the alt! combinator with tag_s!, short strings are required to be listed first. If a longer string is listed first, the parser errors.
Consider the following example that I expect to succeed, but fails:
#[derive(Debug, Eq, PartialEq)]
enum Greeting {
    Short,
    Long,
}

named!(greeting(&str) -> Greeting,
    alt!(
        tag_s!("hello") => { |_| Greeting::Long } |
        tag_s!("hi") => { |_| Greeting::Short }
    )
);

#[test]
fn test_greetings() {
    assert_eq!(greeting("hi"), IResult::Done("", Greeting::Short)); // <---- fails
    assert_eq!(greeting("hello"), IResult::Done("", Greeting::Long));
}

---- test_greetings stdout ----
       	thread 'test_greetings' panicked at 'assertion failed: `(left == right)` (left: `Incomplete(Size(5))`, right: `Done("", Short)`)', src/main.rs:89

If I reorder the greeting parser, then it will succeed:
named!(greeting(&str) -> Greeting,
    alt!(
        tag_s!("hi") => { |_| Greeting::Short } |
        tag_s!("hello") => { |_| Greeting::Long }
    )
);

it is an expected behaviour, because if there's not enough data for tag_s!("hello"), alt! should not see it as an error and try the next branch. If you do not need to handle the Incomplete case, you can wrap a parser with complete! which will transform Incomplete in an error. You can also uses alt_complete! which is equivalent to wrapping every branch with complete!.

@Geal that makes sense, but wouldn't you expect tag! to exhibit the same behavior?
This passes:
#[derive(Debug, Eq, PartialEq)]
enum Greeting {
    Short,
    Long,
}

named!(greeting(&[u8]) -> Greeting,
    alt!(
        tag!("hello") => { |_| Greeting::Long } |
        tag!("hi") => { |_| Greeting::Short }
    )
);

#[test]
fn test_greetings() {
    let empty = &b""[..];
    assert_eq!(greeting("hi".as_bytes()), IResult::Done(empty, Greeting::Short));
    assert_eq!(greeting("hello".as_bytes()), IResult::Done(empty, Greeting::Long));
}


Developer-friendly getting-started

Currently the README says in: https://github.com/source-academy/frontend#installation-of-source-academy-latest-version-available-in-github-pages
the following:
Copy the .env.example file as .env and set the following variables:

REACT_APP_USE_BACKEND=FALSE
REACT_APP_PLAYGROUND_ONLY=TRUE
You may want to refer to Setting up your environment below for more configuration options, if you wish to set up e.g. the GitHub or Google Drive integrations.

If we make these two setting the default, we can get rid of item 4 in the vanilla setup instructions: no need to deal with .env as a beginner.

Would this come in handy to handle the issue: https://www.npmjs.com/package/dotenv-defaults
?


fix reference in readme

Fix docs so they match what is in use in values etc

This change is

/assign @timstoop

This is fine, however, a lot of work is being done on the elasticsearch charts. You may want to check #elk-charts on the Kubernetes Slack if you'd like to join in on it. Your work might be completely overwritten in the next few weeks.

/ok-to-test

There was a larger change a week ago - but how it is now the README is not in sync with the actual implementation - if it changes in future - no problem - all I want is the docs to be coherent with the values. I've already joined the slack for the elk-chart.

@simonswine @icereval for your consideration, seems a good thing to keep the docs up-to-date

/lgtm

/assign @icereval

/assign @simonswine

/lgtm


[SPARK-6930][Build]Build with Hive Thrift Server error, because of missing guava

change scope of dependency guava to default value : compile

Can one of the admins verify this patch?

Please close this, it's a duplicate.

OK


Supplementary materials

Hi there,
It's a good work and I like it so much! But I noticed the paper mentioned there exists a supplementary materials. May I know where can I see the material? It seems I cannot find the link to it.
Thanks!

I found it at https://arxiv.org/abs/2204.00097
I think this issue can be closed.


Stop using node modules in client-side libraries

Describe the bug
Currently, the azure-client package and its dependencies driver-utils and container-loader, are using node-only builtins when it's intended to be a client-side library, therefore it is currently impossible to use this library with Vite or Webpack 5.
The node builtin that are being used are: url and querystring
To Reproduce

Start a client-side project using Vite as a bundler
Add the azure-client package
Build

The build will fail with errors:

Expected behavior
Successful build and use

@alabaki Do you have a project reproducing this that you can share?

@tylerbutler Please refer to:
https://github.com/alabaki/azure-client-issue
npm install
npm run dev

@alabaki Thank you! I was able to get past the node dependencies by including the polyfills. My fork of your repo is here if you want to see those changes. I'll use this issue to track getting the full list of node deps and either removing them or replacing them with isomorphic code.
Anyway, the polyfills will unblock the build, but there is still a problem related to the debug package.
'debug' is not exported by node_modules\debug\src\browser.js, imported by<EMAIL_ADDRESS>file: E:/code/azure-client-issue/node_modules/@fluidframework/telemetry-utils/lib/debugLogger.js:6:9
4:  */
5: import { performance } from "@fluidframework/common-utils";
6: import { debug as registerDebug } from "debug";
            ^
7: import { TelemetryLogger, MultiSinkLogger, ChildLogger } from "./logger";
8: /**
error during build:
Error: 'debug' is not exported by node_modules\debug\src\browser.js, imported by<EMAIL_ADDRESS>    at error (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:158:30)
    at Module.error (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:12423:16)
    at Module.traceVariable (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:12808:29)
    at ModuleScope.findVariable (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:11588:39)
    at ChildScope.findVariable (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:6953:38)
    at ClassBodyScope.findVariable (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:6953:38)
    at FunctionScope.findVariable (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:6953:38)
    at ChildScope.findVariable (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:6953:38)
    at Identifier.bind (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:6468:40)
    at CallExpression.bind (E:\code\azure-client-issue\node_modules\rollup\dist\shared\rollup.js:5076:23)

I haven't figured out that issue yet.

Related issues:
#8298
#4843
#6623

@tylerbutler Thank you! I believe you didn't push your changes to the forked repo, however, I also replaced the url module with a polyfill and it solved that issue. Regarding the debug package issue, I included the @types/debug package and now it's building properly, you can refer to the repo to see the changes.
But just like you mentioned, all node modules need to be replaced. Thanks for the help!

@alabaki You're right, I forgot to push to my fork. 🤦🏻♂ Thank you for sharing the changes you made to get unblocked!

There are more node dependencies beyond version 0.54. If you upgrade client dependencies, the repo doesn't works anymore.
Since 0.55, @fluidframework/routerlicious-driver depends on node-fetch which requires stream, http, process, buffer, util and I was not able to get it to work with vite even after providing polypills.
https://github.com/microsoft/FluidFramework/commit/9d1fcb2cd338bcb2a4ce51aa7559058aafc74992

There are more node dependencies beyond version 0.54. If you upgrade client dependencies, the repo doesn't works anymore.
Since 0.55, @fluidframework/routerlicious-driver depends on node-fetch which requires stream, http, process, buffer, util and I was not able to get it to work with vite even after providing polypills.
9d1fcb2

oof
@znewton Can you comment on the intent of the original change?  It looks like node-fetch is targeted for node environments but routerlicious-driver needs to be browser-compatible.  The webpack issues described above make these errors less apparent as part of our validation unfortunately.

Yes absolutely.  The reason for switching to fetch was that Axios doesn't provide streaming capability which was something we wanted to experiment with. Unfortunately, the choice to use node-fetch was simply "ODSP driver established a precedent of using node-fetch in browser and Node, so it should be fine." That, plus the fact (unknown to me) that Webpack 4 automatically bundles Node polyfills made me think that there was no problem.
I'm actively working on righting this by switching to cross-fetch since @tylerbutler brought this to my attention this morning, but am sadly hung up on mocking it for UTs.

Just FYI, we currently use node-fetch v2, which just bind to the browser version of it fetch in the browser context and should not require the node polyfills.
node-fetch v3 dropped supported for browser support (see link)
So if we upgrade to it, we will have to put in a shim ourself or switch to other libraires.

Fetch API has landed into Node.js since v17.5 and will be a first class citizen in Node.js 18 (LTS). Probably it makes sense to call global fetch() in both node and browser instead of referencing node-fetch directly. As per suggestion by the node-fetch authors, you can call global fetch() in node using the following method.
Main benefits:

Allows to switch to node-fetch v3
Uses native browser implementation
Uses native node implementation when available

// fetch-polyfill.js
import fetch, {
  Blob,
  blobFrom,
  blobFromSync,
  File,
  fileFrom,
  fileFromSync,
  FormData,
  Headers,
  Request,
  Response,
} from 'node-fetch'

if (!globalThis.fetch) {
  globalThis.fetch = fetch
  globalThis.Headers = Headers
  globalThis.Request = Request
  globalThis.Response = Response
}

// index.js
import './fetch-polyfill'

@znewton, wasn't node-fetch v3 a better option?

@malekpour Upgrading to node-fetch v3 would impact everywhere else in the repo that uses node-fetch. If what @curtisman says is true, then our use of node-fetch v2 is important for other places (e.g. odsp-driver) to not require Node.js polyfills. I did not want to take on the scope of altering their fetch usage.

Upgrading to  node-fetch v3 is possible as long as we add the shim to redirect it to the browser implementation ourselves.
I haven't look into cross-fetch, but I believe it has browser polyfill as well?  My concern would be that it will increase bundle size in the browser context because of the unused polyfill (we don't support browser that doesn't have the 'fetch' API)   Would be good to make sure that cross-fetch doesn't bring additional code for browser.

I think cross-fetch is using node-fetch v2 for node and native fetch for browser.

According to cross-fetch README,

Just like isomorphic-fetch, it is just a proxy. If you're in node, it delivers you the node-fetch library, if you're in a browser or React Native, it delivers you the github's whatwg-fetch. The same strategy applies whether you're using polyfill or ponyfill.

So I guess it does indeed add the polyfill/ponyfill of WhatWG-Fetch :/
My main hesitation for touching ODSP's node-fetch usage is I don't know how to locally validate odsp-driver changes. @vladsud thoughts here?

In the section of the node-fetch upgrade guide that @curtisman linked to, they seem to recommend using cross-fetch "if you are using node-fetch client-side". Switching the r11s-driver to cross-fetch would immediately solve this issue, but would indeed increase bundle size as Curtis pointed out.
We have a separately versioned package, common-utils that already has a split browser/node entrypoint. Would it make sense to more slowly resolve this issue by exposing fetch from common-utils via adding fetchNode.ts (using node-fetch v3) and fetchBrowser.ts (relying on built-in fetch) there? Then when that version of common-utils is released we can consume it within R11s-driver and ODSP-driver at our teams' individual paces.

Merged #9433 to resolve the immediate issue that r11s-driver does not work without host adding their own Node polyfills. Opened #9443 to track improvement of the solution so that we don't include Fetch polyfills (i.e. WhatWG-Fetch).

I ran into this issue 6 months ago when I was trying to onboard Fluid Framework for our app. We also use Vite, and I ended up giving up feeling like the Client libraries aren't ready to play around with yet. I started playing around with it again this weekend and am disappointed to see this is still an issue.
The workarounds with polyfills described above also weren't working for me anymore. I had to install the url Node package into my project directly to resolve the build issues.

@tylerbutler What is the update here? Will the packages be fixed? Most front-end frameworks are now using webpack 5 or vite  rendering this library unusable

@curtisman @tylerbutler bumping this thread.

@RishhiB is actively working on several issues related to this. 👍

We've addressed the url, assert, and events issues, and these changes will be in the next release of azure-client and related packages. However, buffer still needs to be polyfilled in some cases. Still investigating that.


Command to open app in browser

It would be great to have a command like flynn open to quickly open an application in the browser.

Flynn is unmaintained and our infrastructure will shut down on June 1, 2021. See the README for details.


[WIP] SystemVM upgrade improvements

Description
This PR aims at making the upgrade path a bit more seamless, by removing the need to register the systemvm template prior to initiating upgrade. This is done by packaging the templates as part of cloudstack-management and on performing yum upgrade cloudstack-management, if the template isn't already registered, it'll register the template automatically.

Types of changes

[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New feature (non-breaking change which adds functionality)
[ ] Bug fix (non-breaking change which fixes an issue)
[X] Enhancement (improves an existing feature and functionality)
[ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale

[X] Major
[ ] Minor

Screenshots (if appropriate):
How Has This Been Tested?

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 726

@blueorangutan text

@blueorangutan test

Trillian test result (tid-1452)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35547 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5264-t1452-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
Smoke tests completed. 88 look OK, 1 have error(s)
Only failed tests results shown below:

Test
Result
Time (s)
Test File

test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80
Error
0.07
test_internal_lb.py

test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80
Failure
403.48
test_internal_lb.py

test_03_vpc_internallb_haproxy_stats_on_all_interfaces
Failure
111.77
test_internal_lb.py

test_04_rvpc_internallb_haproxy_stats_on_all_interfaces
Failure
158.01
test_internal_lb.py

@blueorangutan package

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 744

@blueorangutan package

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 798

@blueorangutan test

@Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan package

@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian.

@Pearl1594 can we close this pr ?

Yes @weizhouapache - this is open only for code review - I'll address all the provided comments in #4329

I think this is merged with https://github.com/apache/cloudstack/pull/4329 @Pearl1594 pl close this so we'll carry on review/testing on a single PR (than split-brain between the two)

Closing this PR - all comments provided have / are being addressed as part of #4329


Fix issues with static variables

This fixes the issue where attempting to start a new game either through Speedrun mode, or by hitting "Start New Game", would throw an error and create a bogus save file. This also fixes another small issue where the "1.12" version was missing from a few places, such as the bottom right of the start screen (it just showed as "v"), and the debug log.
Starting a new game uses the static variable ForcedLevelName to decide which level to load. For whatever reason, the presence of the static patch_Fez method was causing all static variables in the Fez class to not be properly initialized. Not sure if that's a C# thing or a MonoMod thing ¯\_(ツ)_/¯ Regardless, to fix the issue we need those variables to be loaded as normal.
This pull request removes the static function and moves the code that was there into the Initialize function. This seems to work just fine, however I feel it is likely that you chose to put the code in that static function instead, so I don't know if this is the best solution. My other solution, which is even dumber, is to just manually set the relevant variables in that static function:
diff --git a/Patches/Fez.cs b/Patches/Fez.cs
index ce29f9d..27d32f8 100644
--- a/Patches/Fez.cs
+++ b/Patches/Fez.cs
@@ -21,6 +21,8 @@ namespace FezGame
                 IHatInstaller installer = (IHatInstaller)Activator.CreateInstance(type);
                 installer.Install();
             }
+            ForcedLevelName = "GOMEZ_HOUSE_2D";
+            Version = "1.12";
         }

         protected extern void orig_Initialize();

That also seems to work ok, but it's very rigid and potentially only works with the exact version of the game I tested this with (DRM free copy from humble bundle, I didn't try it on steam). Anyways, these are my proposed solutions, you probably know much better than me what is the best approach so I leave it up to you.

Executing IHatInstallers as soon as possible is wanted behaviour - that's why it was originally located in static constructor. However, I didn't expect it to cause such weird things as not initializing static members of the class, so thank you for pointing out this issue. I fixed it in 6c61d18 by applying patch to the regular constructor instead, which shouldn't introduce any unwanted behaviour anymore.


How to count words under each heading?

Hi,
I would like to count the words under each heading (such as those obtained with dumppdf.py -T).
Any ideas?
Thanks in advance.

Hi @igavronski, you should give some more context. Please add an example PDF to this issue and give an example of the output that you would like to have.

Hi @pietermarsman,
An example would be: lorem.pdf
An example output would be:
python pdfwc.py --indent lorem.pdf
This is the first heading 1: 50 words
    This is the first heading 2: 100 words
    This is the second heading 2: 150 words

python pdfwc.py --csv --levels --noheaders lorem.pdf
1,This is the first heading 1,50
2,This is the first heading 2,100
2,This is the second heading 2,150

Thanks!

@igavronski As far as I am aware, I don't think this functionality is provided as-is. However, since you can explicitly access all of the pdf elements, you can still use pdfminer.six to do this. The following script produces the correct output.
A note on LAParams -> I've chosen the line_margin such that the headings get split from the content under them, but the main blocks of content are still counted as one text box. The increased word_margin is because some of the words have slightly larger gaps between them, which was causing pdfminer.six to insert two spaces instead of one. This is specific to your example PDF.
from collections import defaultdict
from logging import currentframe

from pdfminer.high_level import extract_pages
from pdfminer.layout import LAParams, LTTextContainer

page = list(
    extract_pages("lorem.pdf", laparams=LAParams(line_margin=0.18, word_margin=0.25))
)[0]

counts = defaultdict(int)
current_heading = None

for idx, element in enumerate(page):
    if isinstance(element, LTTextContainer):
        # Check the size of the first character to see if it's a header
        first_line = list(element)[0]
        first_char = list(first_line)[0]
        is_heading = first_char.size >= 13

        if is_heading:
            current_heading = element.get_text().strip()
            continue

        if not current_heading:
            raise Exception("First element was not heading")

        text = element.get_text().strip()

        if text == "":
            # Empty elements - ignore
            continue

        counts[current_heading] += len(text.split(" "))

for heading, count in counts.items():
    print(f"{heading}: {count} words")

Output:
This is the first heading 1: 50 words
This is the first heading 2: 100 words
This is the second heading 2: 150 words

I hope that helps. Please do close the issue if it resolves your problem.

I am sorry! I got no warning on this response. I will check as soon as possible and get back to you.

@jstockwin -- In fact, your solution relies on font size. This is not possible for 95% of the papers in my library. I needed to walk through the bookmarks structure, which is what dumppdf.py does.
Any ideas?

See:
dumppdf.py -T lorem.pdf
<outlines>
<outline level="1" title="b'This is the first heading 1 '">
<dest><list size="5">
<ref id="9" />
<literal>XYZ</literal>
<number>0</number>
<number>792</number>
<keyword>b'null'</keyword>
</list></dest>
<pageno>1</pageno>
</outline>
<outline level="2" title="b'This is the first heading 2 '">
<dest><list size="5">
<ref id="9" />
<literal>XYZ</literal>
<number>0</number>
<number>792</number>
<keyword>b'null'</keyword>
</list></dest>
<pageno>1</pageno>
</outline>
<outline level="2" title="b'This is the second heading 2'">
<dest><list size="5">
<ref id="9" />
<literal>XYZ</literal>
<number>0</number>
<number>792</number>
<keyword>b'null'</keyword>
</list></dest>
<pageno>1</pageno>
</outline>
</outlines>

@igavronski I have been working on a library (pdfstructure) that adds dynamic structure detection on top of pdfminer.six.
Pdfstructure is not relying on the bookmarks structure, but does a pre-analysis on most common fonts, style or character size. It categories then each paragraph into header or content and groups them into a nested tree resembling the original hierarchy. The resulting document tree keeps the pdf structure and can be easily traversed using utility methods from the library (more info on the readme).
The following snippet could solve your task (test case):
from pathlib import Path

from pdfstructure.hierarchy.parser import HierarchyParser
from pdfstructure.hierarchy.traversal import traverse_inorder_sections_with_content
from pdfstructure.source import FileSource

def test_count_paragraph_words(self):
    parser = HierarchyParser()
    test_file = str(Path("resources/lorem.pdf"))
    document =parser.parse_pdf(FileSource(file_path=test_file))

    for level, title, content in traverse_inorder_sections_with_content(document):
      prefix = "".join(["\t" for i in range(level)])  # visualize nested relation
      print("{}{};\twords: {}".format(prefix, title, len(content.split())))

And it produces the output:
This is the first heading 1;	words: 50
	This is the first heading 2;	words: 100
	This is the second heading 2;	words: 150

Note: The library is not released yet, but it is able to achieve useful results already.

Hi @ChrizH,
I believe your library will work. Thanks for the code.
My PDF files are mostly academic papers with a 2-column layout, as you mention in your disclaimer... But let's give it a try.
Thanks in advance!
Iuri.

Hi @ChrizH,
I believe your library will work. Thanks for the code.
My PDF files are mostly academic papers with a 2-column layout, as you mention in your disclaimer... But let's give it a try.
Thanks in advance!
Iuri.

Hi @igavronski, how was your experience using pdfstructure?
I have pushed a new version that should work better with academic papers.
Best

I haven't had the opportunity to test it. The academic year, as you might guess, is harder than usual.
Let me try that out and get back to you.

@ChrizH ,
Your module works for the mock file I created (lorem.pdf), but not for a real paper. If you need a real test file, one example would be:
https://scholar.google.com.br/scholar?q=Goodstein+2016+Moral+Repair&hl=en&as_sdt=0&as_vis=1&oi=scholart
Let me know if your module can handle it in the future.
Best regards,
Iuri.


Added Book Icon for CodeView component

Added the book icon on CodeView component, and took the Reference from the figma layout Style.
and also added the feather-icons-react dependencies in package.json file for using the Book icon.
#31

We already have the react-icons library so you can import the book icon like:
import { FiBook } from 'react-icons/fi`;

So we do not need the react-feather library.

@diego3g i have made the changes.


chore: release 2024.11.34

🚀 Features

fragmented configs by @jdx in #3273
hooks by @jdx in #3256
added MISE_TASK_DISABLE_PATHS setting by @jdx in 9c2e6e4
gpg verification for node by @jdx in #3277

🐛 Bug Fixes

make _.file and _.source optional if the file is missing by @jdx in #3275
prevent deadlock when resetting by @jdx in 8e6d093
prevent deadlock when resetting by @jdx in 201ba90
prevent deadlock when resetting by @jdx in 169338a

🚜 Refactor

clean up arcs by @jdx in f49d330

📚 Documentation

added hooks to sidebar by @jdx in 4bbc340
added swift to sidebar by @jdx in bc06cbf

🔍 Other Changes

skip checkov test by @jdx in 2ae18a3
added timeout for release-plz by @jdx in dae4bc3
remove coverage by @jdx in #3278

This is the second time this week that I've gone to bed thinking, "Hmmm... maybe mise isn't ready for my workflow yet due to lack of x feature." Only to wake up with the exact thing I was wishing for being merged in. I am SO pumped about this project!


sub spec issue - duplicate symbols

Hi
I have an app that use Mixpanel for both the mobile app and the share extension.
I found that if the app contains both pods:
  pod 'Mixpanel', '2.9.0'
  pod 'Mixpanel/AppExtension', '2.9.0'

This caused from a local pod with shared code for the App and the Share Extension

The project build fails with the following error:
duplicate symbol _MP_NewBase64Decode in:
    /Users/ido.mizrachi/Library/Developer/Xcode/DerivedData/TestMixpanel-eskzlbuzaelvagbnfkeppnxborde/Build/Products/Debug-iphonesimulator/libPods-TestMixpanel-Mixpanel.a(NSData+MPBase64-8960067CD7E31586.o)
duplicate symbol _MP_NewBase64Encode in:
    /Users/ido.mizrachi/Library/Developer/Xcode/DerivedData/TestMixpanel-eskzlbuzaelvagbnfkeppnxborde/Build/Products/Debug-iphonesimulator/libPods-TestMixpanel-Mixpanel.a(NSData+MPBase64-8960067CD7E31586.o)
ld: 2 duplicate symbols for architecture x86_64

I found an issue with the podspec and pushed the fix to my repository:
https://github.com/idomizrachi/Specs/blob/master/Mixpanel/2.9.0/Mixpanel.podspec.json
You can see the issue in this sample project: https://www.dropbox.com/s/86s8po04ea1o82q/TestMixpanel.zip?dl=0

Uncomment source 'https://github.com/idomizrachi/Specs.git' and run 'pod update Mixpanel'

![screen shot 2015-11-15 at 10 25 38 pm](https://cloud.githubusercontent.com/assets/2949351/11170813/3d677daa-8be8-11e5-9557-8a2950e9e8c8.png)

Seems like you could just add the AppExtension to the ShareExtension target. Not sure why you would need both in any given target.


Level 2 Shop Class

Summary
Hi i am struggling with creating the Shop class that takes in a list of server.
Description
I am trying to put the List of server into a private final ImList. but i keep receiving the error shown below? anyone else faced this problem as well?
I do not understand why the implementation works in jshell but not in the class Shop....
Screenshots (if any):
Compile Error from javac Shop.java

Tested my idea in jshell and works...?

Perhaps check your class attribute "serverImList" make sure it's a correct type

Hi, my TA helped me resolved the issue!
the problem was because I was using Pair.java and ImList.java from prevous labs and their static methods were not made public, unlike the ones provided in codecrunch!
so the solution is to just download the Pair.java and  ImList.java by clicking on them in codecrunch:


Updated incorrect command line - REPORTSERVERURL

As per the earlier documentation, REPORTSERVERURL was used to set the default Report Server URL during the installation. But recently this is changed to RBSERVERURL instead of REPORTSERVERURL.

@kanecoMSFT : Thanks for your contribution! The author(s) have been notified to review your proposed change.

#sign-off


[BUG]: Driver repos reference CSI Operator

Bug Description
Offline bundle instructions in driver repos reference CSI Operator instead of CSM Operator:
https://github.com/dell/csi-powerstore/blob/main/dell-csi-helm-installer/csi-offline-bundle.md
https://github.com/dell/csi-powerflex/blob/main/dell-csi-helm-installer/csi-offline-bundle.md
https://github.com/dell/csi-unity/blob/main/dell-csi-helm-installer/csi-offline-bundle.md
https://github.com/dell/csi-powermax/blob/main/dell-csi-helm-installer/csi-offline-bundle.md
https://github.com/dell/csi-powerscale/blob/main/dell-csi-helm-installer/csi-offline-bundle.md
Logs
N/A
Screenshots
No response
Additional Environment Information
No response
Steps to Reproduce
Check provided links for incorrect references.
Expected Behavior
All references should be to CSM Operator.
CSM Driver(s)
All driver repos reference CSI Operator currently.
Installation Type
No response
Container Storage Modules Enabled
No response
Container Orchestrator
N/A
Operating System
N/A

link: 19587


Interceptors for Python, Node and other languages

Hello, I have been extensively using the GO-gRPC interceptor to trace few microservices written in go and using gRPC but I have a need to create a py and node service and was wondering if we have any interceptors for python and Javascript so that my polyglot environment is fully traced.
If not I would like to know how can I write my own. Any reference or documentation which can help me write the interceptors for py and js similar to the ones we have fro go and java

@Malayks we would very much value the contributions. Last time I checked, the GRPC-python API did not support interceptors natively, and that was the blocker there. I did not check Javascript.
Could you take a look at the GRPC APIs and report back here? I can apply some gentle pressure to the GRPC-team if the APIs are not sufficient to do the actual interception... they really should be! Thanks.

@bensigelman  I took and quick look and could not find native support for interceptors in Node GRPC APIs, did not investigate Python as Node is a priority for me.

@Malayks I added something to the tail of https://github.com/grpc/grpc/issues/8767#issuecomment-273027261 ... feel free to weigh in if you feel like it :)

Thanks @bensigelman. Looks like for the time being, writing a wrapper is the only option.


Modified team list component to view/create teams

Changes proposed in this pull request:

Modified the UI to look similar to the current EvalAI application.
Changes made in logic to create and select the host team to create challenge.
Changes made in loader UI to show status of the application processing.
Changes made in logic to create/ select team for participation in challenge.

Link to live demo: http://pr-149-evalai.surge.sh

Codecov Report

Merging #149 into master will increase coverage by 1.05%.
The diff coverage is 64.81%.

@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
+ Coverage   53.38%   54.44%   +1.05%
==========================================
  Files          55       58       +3
  Lines        2347     2463     +116
  Branches      253      257       +4
==========================================
+ Hits         1253     1341      +88
- Misses       1020     1047      +27
- Partials       74       75       +1

Impacted Files
Coverage Δ

...onents/home/twitter-feed/twitter-feed.component.ts
100% <ø> (ø)
:arrow_up:

...pp/components/utility/loading/loading.component.ts
100% <100%> (ø)
:arrow_up:

.../components/utility/side-bar/side-bar.component.ts
100% <100%> (ø)

src/app/components/nav/footer/footer.component.ts
62.5% <100%> (+1.2%)
:arrow_up:

...omponents/nav/dash-footer/dash-footer.component.ts
100% <100%> (ø)

src/app/app.component.ts
36.06% <100%> (ø)
:arrow_up:

...pp/components/publiclists/publiclists.component.ts
100% <100%> (+38.09%)
:arrow_up:

...ponents/publiclists/teamlist/teamlist.component.ts
35.95% <31.42%> (+0.73%)
:arrow_up:

...ubliclists/teamlist/teamcard/teamcard.component.ts
63.33% <33.33%> (+0.83%)
:arrow_up:

src/app/services/auth.service.ts
36.75% <57.14%> (+13.46%)
:arrow_up:

... and 5 more

Impacted Files
Coverage Δ

...onents/home/twitter-feed/twitter-feed.component.ts
100% <ø> (ø)
:arrow_up:

...pp/components/utility/loading/loading.component.ts
100% <100%> (ø)
:arrow_up:

.../components/utility/side-bar/side-bar.component.ts
100% <100%> (ø)

src/app/components/nav/footer/footer.component.ts
62.5% <100%> (+1.2%)
:arrow_up:

...omponents/nav/dash-footer/dash-footer.component.ts
100% <100%> (ø)

src/app/app.component.ts
36.06% <100%> (ø)
:arrow_up:

...pp/components/publiclists/publiclists.component.ts
100% <100%> (+38.09%)
:arrow_up:

...ponents/publiclists/teamlist/teamlist.component.ts
35.95% <31.42%> (+0.73%)
:arrow_up:

...ubliclists/teamlist/teamcard/teamcard.component.ts
63.33% <33.33%> (+0.83%)
:arrow_up:

src/app/services/auth.service.ts
36.75% <57.14%> (+13.46%)
:arrow_up:

... and 5 more

Continue to review full report at Codecov.

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

@lunayach @Shekharrajak please review pr

I didn't understand why there are 162 file changes. Is there any irrelevant commits (not part of this PR) as well ?

Before checking the new commits. First I look into my previous comment and I don't see reply for it.

I didn't understand why there are 162 file changes. Is there any irrelevant commits (not part of this PR) as well ?
I have created the PR to reduce file changes as there is dependency among PRs.

Two more things:

I am not seeing the T&C's modal before registering from a team like in the current version.
The label on the Add button seems misaligned.

Two more things:

I am not seeing the T&C's modal before registering from a team like in the current version.
The label on the Add button seems misaligned.

Done


Eliminate Unique naming convention issue. This change will help in getting VM name as 'Deployment + DeploymentID'

Description
This change will help in resolving Unique naming convention issues
Issues Resolved
Now the VM Naming convention will be unique as this change gets VM name as "deployment + deploymnetID"
Type of Change
Check List

@Rupesh0688 thanks for creating the PR. A suggestion, can we make the parameter optional? i.e. it is part of the request payload if non-nil 'name' is supplied and omitted otherwise? This will help folks specify deploymentName when they need to do so via kitchen-vra plugin or another consumer of this gem.
cc @ashiqueps

I am working on getting the requirement as accordingly


Event Score Database

Even though on the backend of the site we have database for the event scores.

Sure


Adding multiple Druid clusters with same names for the data sources only shows one set of data sources

Superset version
0.6.10
Expected results
We configured two superset clusters, one for staging and one for prod. They both have data sources named messages, enrollment, status. We would expect to see data sources for both the staging and production clusters come up for messages, enrollment, and status, so a total of 6.
Actual results
We are only seeing data sources coming up for our production cluster, not staging. So, only a total of 3 data sources.
Steps to reproduce

Login to Superset
Add two data clusters with the same data source names
Refresh Druid metadata
Only able to see data source names for production cluster.

Also, we added a data source called "test" on staging, and it did show up.
How do we get around this issue?

Are you sure it is superset 0.6.10?

Apologies, it's 0.15.1.

:+1: Is it even possible to have datasource with same name but different hosts on the same superset instance?


go plugin error, worker-events: event callback failed; source=plugin_server, event=reset_instance

Is there an existing issue for this?

[X] I have searched the existing issues

Kong version ($ kong version)
kong:3.5
Current Behavior

I enable a go plugin which is used for calling the http api to check token in the request Authorization header. If time is more than 60s (call http api in the go plugin), it will return the below json and also print the above log
{
    "message": "An unexpected error occurred",
    "request_id": "320b181960fbd31f8bf35f1217c86b6d"
}

I would like to ask if Kong has any restrictions on the go plugin. It can only be executed for 60 seconds.
I tested it and as long as the time (go plugin excutes) does not exceed 60 seconds, there is no problem
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response

@StarlightIbuki Could you please take a look?

This looks like a fixed bug. Please upgrade to the latest version to see if the issue persists.


Web/Desktop Press Enter key to go next

Details

Convert the functional component Button to a class component.
Create a new prop pressOnEnter for Button.
If it's true, onPress() is called when Enter key is pressed.
This is done by adding Enter as a keyboard shortcut for onPress() using libs/KeyboardShortcut
componentDidMount() {
    return if pressOnEnter is false

      KeyboardShortcut.subscribe('Enter', () => {
          if (button not disabled or button not disabled)
              props.onPress()
      })

}

Unsubscribe on unmount.
For all the pages like request payment, add workspace etc.
Pass the prop pressOnEnter to their buttons, so that onPress() is called when Enter key is pressed.
Remove redundant event listeners for Enter from BaseModal.
And add pressOnEnter to replicate previous behaviour of ConfirmModal
Fixed Issues

$ #3785
Tests

Request payment

Request payment to any user
Enter amount and press Enter to go next.
Verify that pressing Enter makes the payment request.

Add PayPal.me

Settings -> Payments
Add PayPal.me
Enter user name
Verify that pressing Enter adds PayPal account.

Add workspace

Click on + icon.
Add Workspace
Enter workspace name
Verify that pressing Enter adds workspace.

Split bill in group chat

Go to a group chat
Split bill.
Enter amount, press Enter to go next.
Verify that pressing Enter confirms split.

Workspace Invite Page

Go to any workspace
Navigate to People tab
Click Invite
Add the email or phone
Verify that pressing Enter invites the user.

QA
Verify that mobile apps don't crash by navigating to the above mentioned pages.
Tested On

[x] Web
[x] Desktop

Screenshots

Web
https://user-images.githubusercontent.com/29673073/125567862-5ef7e410-c903-42fc-9637-03aa06af9873.mp4
https://user-images.githubusercontent.com/29673073/125568641-bb6f599d-e014-486f-9f35-421225c633f8.mp4
Desktop

Looks mostly ok. The displayed amount seems to have some style issues in both iOS and android versions.

@luacmartins I branced to the commit just before I made any changes 57f557cd31198a631305b617c374f2418eb5e9fa
And the styling issue is still there.
This branch (enter-go-next) doesn't modify any styling for IOUAmountPage.
This makes me believe it's a regression from previous commits, and it's fixed in the newer commits.
I think we're safe to merge with main and not see this issue happening.

Thanks for the fixes! One last comment that I have: pressing enter selects/deselects the first recent contact on Split Bills, is that intended behavior? Should we make it so enter moves the user to the next step if they have other users selected?
https://user-images.githubusercontent.com/22219519/125842536-8cc115b4-7449-4da3-9706-fb1e91e32a26.mov

Thanks for the fixes! One last comment that I have: pressing enter selects/deselects the first recent contact on Split Bills, is that intended behavior? Should we make it so enter moves the user to the next step if they have other users selected?
Screen.Recording.2021-07-15.at.12.53.51.PM.mov

Yes, that's the intended behaviour.
The page for selecting split participants doesn't really work well with keyboard. Needs to be fixed in a seperate issue.

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

🚀 Deployed to staging         in version: 1.0.78-3🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production         in version: 1.0.79-4🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


edk: upgrade to 20240524; hvloader: upgrade ekd2 version

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

[X] The toolchain has been rebuilt successfully (or no changes were made to it)
[X] The toolchain/worker package manifests are up-to-date
[X] Any updated packages successfully build (or no packages were changed)
[X] Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
[X] Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
[X] All package sources are available
[X] cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
[X] LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
[X] All source files have up-to-date hashes in the *.signatures.json files
[X] sudo make go-tidy-all and sudo make go-test-coverage pass
[X] Documentation has been updated to match any changes to the build system
[X] Ready to merge

Summary

What does the PR accomplish, why was it needed?
Upgrade edk2 to 20240524
Upgrade edk2 version in hvloader
Change Log

Upgrade edk2 to 20240524
Upgrade edk2 version in hvloader
Fix CVEs: CVE-2022-36763, CVE-2022-36764, CVE-2022-36765, CVE-2023-45230, CVE-2023-45232,
CVE-2023-45233, CVE-2023-45234, CVE-2023-45235, CVE-2023-45236, CVE-2023-45237

Does this affect the toolchain?

NO
Links to CVEs

https://nvd.nist.gov/vuln/detail/CVE-2022-36763
https://nvd.nist.gov/vuln/detail/CVE-2022-36764
https://nvd.nist.gov/vuln/detail/CVE-2022-36765
https://nvd.nist.gov/vuln/detail/CVE-2023-45230
https://nvd.nist.gov/vuln/detail/CVE-2023-45232
https://nvd.nist.gov/vuln/detail/CVE-2023-45233
https://nvd.nist.gov/vuln/detail/CVE-2023-45234
https://nvd.nist.gov/vuln/detail/CVE-2023-45235
https://nvd.nist.gov/vuln/detail/CVE-2023-45236
https://nvd.nist.gov/vuln/detail/CVE-2023-45237

Test Methodology

Local build
Buddy build pipeline build id: 618035

Testing Kata scenario here: https://dev.azure.com/mariner-org/mariner/_build/results?buildId=618363&view=results

Adding some clarifications to not lose the track of thought later:

I removed -p1 in hvloader.spec because I removed both patches in spec file, since the new version of edk2 has these CVEs solved in it. To check it I checked lines of the patch and lines of the code in the new version of edk2, verified that they were added in the new version and don't need to be added by the patches. Or verified that these files don't exist anymore. Depends on the situation. Also, the patches weren't applicable and were giving an error.
Patch 17 in edk2.spec suppresses the warnings that we would get from r/w/e permissions on files. And we don't want to add azl in this "if" line, because we don't want to suppress the warnings in azl. Also we don't want to remove it because it will be harder to make changes next time. But I'll raise a PR to add %if NOT azl macro that will disable that area of code for azl, to keep track of it and show that we turn it off intentionally.


Run Summary for Quick Play could provide more information

I'd like to propose that the Run Summary include the End Article and a link to play the same articles for Quick Play rounds. This would be more fun to share with friends who want to compete with a run idea.
Example:
Wiki Speedruns
Jaguar Cars to Ford Motor Company
2 🖱
18.451999999999998 ⏱
https://wikispeedruns.com/play/quick_play?prompt_start=Jaguar%20Cars&prompt_end=Ford%20Motor%20Company

@danielliu04 Wanna take a look at this?

This could be a lot nicer with a custom url shortlinker (also a fun side project)
e.g.
wiki.speed/5nf12n or something like that


Allow registering Function classes as services in the container

While converting my durable function to isolated in .NET7, I ran into a scenario that I'm pretty sure is caused by the fact that function class instances are constructed using something like ActivatorUtilities.CreateInstance instead of resolving the type from the container.
I have a simple activity that performs a DELETE Http call to one of my APIs:
[DurableTask]
public sealed class DeleteReservationTask : TaskActivityBase<Guid, HttpResponseMessage>
{
    private readonly HttpClient httpClient;

    public DeleteReservationTask(HttpClient httpClient)
        => this.httpClient = httpClient;

    protected override async Task<HttpResponseMessage?> OnRunAsync(TaskActivityContext context, Guid input)
        => await this.httpClient.DeleteAsync($"Reservations/{input}");
}

To configure this client, I'm using the AddHttpClient method like this:
        services
            .AddHttpClient<DeleteReservationTask>()
            .ConfigureHttpClient((provider, client) =>
            {
                var settings = provider.GetRequiredService<IOptions<MyApiSettings>>();
                client.BaseAddress = settings.Value.BaseAddress;
            })

When running the integration however, I get a service activation exception:

[2022-11-25T14:53:24.673Z] System.Private.CoreLib: Exception while executing function: Functions.DeleteReservationTask. System.Private.CoreLib: Result: Failure
Exception: System.AggregateException: One or more errors occurred. (Unable to resolve service for type 'System.Net.Http.HttpClient' while attempting to activate 'MyNamespace.DeleteReservationTask'.)

This is happening because AddHttpClient registers a named HttpClient instance that is resolved only when requesting the service it was registered with. Since the functions runtime is not taking the type from the container, and instead is building it up using ActivatorUtilities, it will ignore that registration and attempt to resolve a "nameless" HttpClient from the container when building the type, which will obviously never work.
This makes sense as a default, but I'd like to propose an alternative like the one used by MVC controllers that provide you with a AddControllersAsServices() extension that registers all controllers in the container directly, causing the controller activation logic to request the controller type from the container instead of building the type up manually with ActivatorUtilities.CreateInstance/CreateFactory. You could call it AddFuncitonsAsServices() or similar, for consistency. Once registered, function classes should then be resolved from the container instead of built-up on the fly, which would then respect whatever registrations are tied to it.
This of course affects other types of patterns other than the typed HttpClient registrations. Things such as decorators would also be impossible to register and use today if they target the function class type directly.
Another benefit of something like AddControllersAsServices is that it allows the DI container's built-in self-checking mechanism (enabled in debugging by default) to be able to detect missing dependencies before having to run each controller: when they are not registered as services, the container is oblivious to them and cannot perform this check for controller classes. The same benefit would exist for function classes as well.
As for workarounds if anyone is interested, I'll probably just inject the IHttpClientFactory and manually fetch the HttpClient from it using the class name (which is what happens automatically when the mechanism works as intended). Another workaround of course would be to create an indirection to a second WhateverService, that then relies on HttpClient and is injected into the function class.

@julealgon we now use ActivatorUtilities.GetServiceOrCreateInstance when constructing activities, so this should be addressed I believe. Can you see if your scenario now works with v1.0.0-rc.1 package?

@julealgon we now use ActivatorUtilities.GetServiceOrCreateInstance when constructing activities, so this should be addressed I believe. Can you see if your scenario now works with v1.0.0-rc.1 package?

@jviau I didn't know this GetServiceOrCreateInstance method was introduced, insteresting... since AddHttpClient does register the underlying service, it should indeed work.
I'll test and report back.

After updating to v1.0.0-rc.1, making the necessary changes (including adding the now separate .Generators package), I'm observing the exact same error as before @jviau :

System.AggregateException: 'One or more errors occurred. (Task 'DeleteReservationTask' (#1) failed with an unhandled exception: One or more errors occurred. (Unable to resolve service for type 'System.Net.Http.HttpClient' while attempting to activate 'MyCompany.Project.Functions.DeleteReservationTask'.))'

Attempting to explicitly register the function manually also had zero effect.
Are you positive the framework was changed to rely on GetServiceOrCreateInstance? If I try to manually call it during startup, it is working just fine for me:
var app = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults()
    .ConfigureServices(
        services => services
            .AddOptions<MyApiSettings>().BindConfiguration(nameof(MyApiSettings)).Services
            .AddHttpClient<DeleteReservationTask>((provider, client) =>
            {
                var settings = provider.GetRequiredService<IOptions<MyApiSettings>>();
                client.BaseAddress = settings.Value.BaseAddress;
            }))
    .Build();

var x = ActivatorUtilities.GetServiceOrCreateInstance<DeleteReservationTask>(app.Services);

@julealgon I found and fixed the issue for our GA release.

@julealgon I found and fixed the issue for our GA release.

@jviau while that's pretty cool, I'd not recommend closing this issue quite yet.
One of the main advantages of registering the classes explicitly is that you can leverage the DI container self-checking functionality on those classes too. See my comment from the OP:

Another benefit of something like AddControllersAsServices is that it allows the DI container's built-in self-checking mechanism (enabled in debugging by default) to be able to detect missing dependencies before having to run each controller: when they are not registered as services, the container is oblivious to them and cannot perform this check for controller classes. The same benefit would exist for function classes as well.

Note that one would want this regardless of specific dependencies being injected (so it's not tied to the HttpClient scenario I described).
This alone should warrant consideration for a "AddFunctionsAsServices" method that people can opt into using (like AddControllersAsServices).

@julealgon, the DI validation will be done if you register the tasks to the service container yourself. I am hesitant to add helpers like this as it is extra API surface to maintain which can already be achieved without it. However, if you want to open a new issue specific to that enhancement request ("Add helper to register all tasks in DurableTaskRegistry to IServiceCollection" or something like that), then we can leave it open while we discuss it internally or wait for feedback from others if they also need that functionality. But I would like to elave this issue closed as the original ask is complete - tasks will be resolved from the DI container if they are present.


[Bug]: Accessing http will intercept https

Minimal, reproducible example
const puppeteer = require("puppeteer");

(async () => {
  const browser = await puppeteer.launch({
    headless: false,
    devtools: true,
    timeout: 60000,
    protocolTimeout: 0,
    ignoreHTTPSErrors: true,
    args: [
      "--no-first-run",
      "--max-old-space-size=512",
      "--disable-gpu",
      "--disable-dev-shm-usage",
      "--disable-web-security",
      "--disable-xss-auditor",
      "--no-zygote",
      "--no-sandbox",
      "--disable-setuid-sandbox",
      "--allow-running-insecure-content",
      "--disable-webgl",
      "--disable-popup-blocking",
      "--disable-features=site-per-process"
    ],
  });
  const url = "http://testphp.vulnweb.com/";
  const page = await browser.newPage();

  await page.setRequestInterception(true);
  page.on("request", (req) => {
    console.log(" ----------------->  request: ", req.url(), page.url(), req.method());
    req.continue();
  });

  await Promise.all([
    page.goto(url, {
      waitUntil: [
        "load",
        "domcontentloaded",
        "networkidle0",
        "networkidle2",
      ],
      timeout: 30000,
    }),
    page.waitForNavigation({ waitUntil: ["load", "networkidle2"], timeout: 30000}),
  ]);

})();

Background
There is no https request on the site itself, but https will be intercepted
Expectation
Do not block addresses that do not exist. For example, https://testphp.vulnweb.com/
Reality
Blocked address: https://testphp.vulnweb.com/

Puppeteer configuration file (if used)
No response
Puppeteer version
23.1.0
Node version
v20.13.1
Package manager
npm
Package manager version
10.5.2
Operating system
Windows

It seems that this request is the automatic upgrade Chrome tries to perform from HTTP to HTTPS, https://chromestatus.com/feature/6056181032812544
You can try and use "--disable-features=HttpsUpgrades", to disable this feature.

It seems that this request is the automatic upgrade Chrome tries to perform from HTTP to HTTPS, https://chromestatus.com/feature/6056181032812544 You can try and use "--disable-features=HttpsUpgrades", to disable this feature.

<EMAIL_ADDRESS>Is this normal without this problem?

You can see on the supported browser page
That that version of Chrome for Testing is 114.0.5735.90,
where the feature did not exist yet.


Removing republishing dids warning

From chatting back and forth with Gabe and Frank, they advise that we remove this warning about DID DHT because this is currently not the case. At the moment, people don't need to republish DIDs weekly. However, they plan to implement a way to make storing and managing DIDs more sustainable for our company...so that old, unused DIDs aren't just sitting in our system.  Gabe is currently working on implementing new plan. Share the exact and correct guidance with us and we can update our docs to reflect his new guidance.
New plan was agreed on:
person gets a did dht
on our side we're checking to see if the did is active for the last 7 days
if it becomes inactive..they have to republish..if it's not inactive and meets minimal requirements for use..they dont have to republish.
the activity/inactivity is what they refer to as proof of work

It sounds like they're still trying to determine what is "activity"
This pull request includes a change in the how-to-create-did.mdx file under the site/docs/web5/build/decentralized-identifiers directory. The change involves the removal of an important note about the weekly republishing requirement for did:dht DIDs. The note stated that DIDs created using the did:dht method must be republished weekly to prevent them from becoming unresolvable and that an automatic republishing feature would be integrated into the SDK in the coming weeks.

To see the specific tasks where the Asana app for GitHub is being used, see below:

https://app.asana.com/0/0/1207249235942948

we also need to remove it in KT

okay removed @EbonyLouis ! Thanks!


feat: Allow multiple domains in a single certificate

This is a follow up of https://github.com/terraform-aws-modules/terraform-aws-acm/pull/137
Credits to @amontalban for the work, I made requested changes and tested the feature.
Description
This PR allows creating one ACM certificate for multiple domains, which, is useful when using the certificate for CloudFront that only allows one certificate per distribution.
Motivation and Context
CloudFront does not support multiple ACM certificates, like ALB. Therefore, if you need to support multiple domains in a single CloudFront distribution you would have to create the certificate manually because this module does not support it.
Breaking Changes
This change should be backward compatible as I added a zones var containing a map with domains and their Route53 zone ID so the validation records are created in the correct Route53 zone.
Additionally, I have updated the tests in examples/complete-dns-validation to allow variables so it was easier for me (and others) to test with my test domains.
How Has This Been Tested?

[x] I have updated at least one of the examples/* to demonstrate and validate my change(s)
[x] I have tested and validated these changes using one or more of the provided examples/* projects
[x] I have executed pre-commit run -a on my pull request

Fixes https://github.com/terraform-aws-modules/terraform-aws-acm/issues/136

Hi @antonbabenko, is there a chance of resuming the review that you left on https://github.com/terraform-aws-modules/terraform-aws-acm/pull/137 here?
Thanks.

Thank you @alemarmed for doing this, I totally dropped the ball on the #137 but glad you created this because now I'm needing this again 🤣.

@bryantbiggs any chance you can check this out? Thanks!

This would be amazing to have, commenting to keep it alive

It would be great to have this feature!

Waiting for this. It has been open since March, can a maintainer please review?

@bryantbiggs @antonbabenko any chance you can review/merge this 🙏? Thanks!

Another bump to prevent this PR from being stale. Really wish the maintainer would provide feedback here :(

This PR is included in version 5.1.0 :tada:


PY3 Compat AISMarking serialization

Bindings fail to serialize AISMarkingStructure correctly. Present in stix <IP_ADDRESS> while working in Python 3.X

closed by 850c5f8


Map Sources don't sync with Obsidian Sync

Many settings will sync across devices, but Map Sources doesn't.
Sync Method: Obisidian Sync
OS: IOS / Mac OS

Can you attach the Map View settings file VAULT_DIR/.obsidian/plugins/obsidian-map-view/data.json?
What version of Map View are you using?


Canvas doesn't receive onDraw from props

Canvas doesn't receive onDraw from props

Problem: As we know the Canvas component is a wrapper upon the SkiaView component and as the following source code:
export interface CanvasProps extends ComponentProps<typeof SkiaView> {
  ref?: RefObject<SkiaView>;
  children: ReactNode;
  onTouch?: TouchHandler;
  fontMgr?: FontMgr;
}

export const Canvas = forwardRef<SkiaView, CanvasProps>(
 ({ children, style, debug, mode, onTouch, fontMgr }, forwardedRef) => {

It explains the Canvas props look like SkiaView but it's obvious the onDraw isn't received from props.

Issue: In my case, I need to pass my onDraw to the Canvas component and I cannot use SkiaView, I need Canvas. I think it's a common need for all developers too.

Solution:  So I will send a PR to fix this lack of props.

We will document the Drawing component, which is intended to solve this use case (see example: https://github.com/software-mansion-labs/drawings-and-animations-workshop/blob/main/src/SkiaLogo/PathGradient.tsx#L94).