Add rate limiting to the login and password change processes

Fixes #5677

@gnprice would you be up for reviewing this one?

Hi @umairwaheed! Thanks for building this.
In this version there looks to be a lot of functions that we start having three very similar versions of -- like max_api_calls, max_api_window, block_user, rate_limit_user, etc. That's a problem because it means every change we make to this code in the future, we're likely to have to make in 3 places, and also when we fix a bug in one path we'd have a high risk of missing the others.
Looking at this code in master, most of it takes a UserProfile object but doesn't really look inside it -- it just passes it down to other functions. I think in fact there may be just two places we actually look inside the user object:

_rules_for_user
redis_key
So I think we should be able to do this without making three separate versions of anything except those two functions, and some of the logic in decorator that calls into the rate-limiting system.

Here's an outline of how I think this could look. Almost all the stuff in rate_limiter.py that takes a UserProfile, I'd switch to taking a new type RateLimitDomain. (For functions that take both user and domain, this replaces both of those.) Then the RateLimitDomain class would look like
class RateLimitDomain(object):
  def __init__(self):
    # type: () -> None
    raise NotImplemented
  def key_text(self):
    # type: () -> Text
    raise NotImplemented
  def rules(self):
    # type: () -> List[Tuple[int, int]]
    raise NotImplemented

class UserDomain(RateLimitDomain):
  def __init__(self, user, domain='all'):
    # type: (UserProfile, Text) -> None
    # ...
  def key_text(self):
    return "%s:%s:%s" % (type(self.user), self.user.id, self.domain)
  def rules(self):
    # ... follow _rules_for_user

Then redis_key calls domain.get_text(), and the call sites of _rules_for_user() switch to using domain.rules(). The call sites of this subsystem in decorator.py construct a UserDomain and pass that in.
After that refactor, I think the only change needed in rate_limiter.py to add email and IP rate-limiting will be adding more subclasses of RateLimitDomain. Those are pretty small, so that'll be a nice self-contained change.
Want to take a crack at implementing that?

@gnprice, thanks for this interesting feedback. I get your concern about making multiple versions. I think the only reason I went down this road was that this would ensure that the changes would not not introduce any bugs in the current implementation of the rate limiter since the core logic would already be covered through tests of user based rate limiter. However, I like the idea of using a class for abstraction as it would make adding new types of rate limitation very easy. Let me see if I can incorporate your idea without changing the tests.

These are the publicly used functions currently. I think it would be safer if we don't change the meaning of these functions and the arguments that they take in this iteration. So if we ensure that these functions continue to point to user based rate limitation, we can be confident that we have not introduced any bug. Once we are sure that the new class based rate limiter is good, we can make the switch. I'll go ahead with class based rate limiter.

add_ratelimit_rule
clear_user_history
remove_ratelimit_rule
incr_ratelimit
is_ratelimited
api_calls_left
bounce_redis_key_prefix_for_testing
max_api_calls
max_api_window

if we don't change the meaning of these functions and the arguments that they take in this iteration

I'll change the logic of these functions internally to use class based version of user rate limiter.

@gnprice, @showell, this now contains the initial code for the updated architecture.

Thanks for this revision! One general strategy thought first:

Let me see if I can incorporate your idea without changing the tests.

We should never be afraid to change the tests when we're refactoring the code. We should understand how we're changing the tests, and know why those are changes we want to happen. And to help make that clear, it's often useful to separate out a set of changes so that some commits are "pure refactorings", which don't change behavior or interfaces and consequently don't change the tests. But the tests test the code as it is today, and when we can make the code work better tomorrow, we'll do that and change the tests accordingly.
Then, on this design: I'm not a fan of this paradigm of taking all the complex logic in the subsystem (like the insides of incr_ratelimit and is_ratelimited) and moving them into methods on a class. As a reader coming to look at this code, when I see them as methods I have to wonder what state hanging off of the class they might depend on, and what other methods they call might be overriden in subclasses, and all the combinations of those -- it becomes much harder to understand the method than it would be as a stand-alone function, where the only state is what's passed in explicitly as arguments (and, rarely and conspicuously, some module-toplevel global state.) We generally don't have code in this style in the Zulip codebase, for this reason.
The Any types in the signatures of all these methods are also bad for understanding the code. There are cases where we need to pay the cost of having Any types, but this subsystem isn't one of them. In this case, I think these Any types are showing up basically as a symptom of the design wrapping up all this logic in a base class where everything gets entangled with everything.
Can you try doing it the way I suggested above instead? I think that should result in a much smaller diff, as well as code that's easier to understand at the end.

We should never be afraid to change the tests when we're refactoring the code.

Yeah, I do have a knack of becoming a bit conservative while doing refactoring :).

Then, on this design: I'm not a fan of this paradigm of taking all the complex logic in the subsystem (like the insides of incr_ratelimit and is_ratelimited) and moving them into methods on a class.

I was thinking of keeping it as a transitory step to make sure that the code was working. In the final state I would have deleted these functions altogether and use the rate limiter instance directly.

Can you try doing it the way I suggested above instead? I think that should result in a much smaller diff, as well as code that's easier to understand at the end.

Yep, doing it now.

And to help make that clear, it's often useful to separate out a set of changes so that some commits are "pure refactorings", which don't change behavior or interfaces and consequently don't change the tests.

👍

@gnprice, updated. The first commit is the transitory commit. The actual change happens in the second commit, for only is_ratelimited() though. Eventually I'll upgrade all functions using this strategy. Let me know if this works.

Thanks @umairwaheed -- this looks great! I appreciate how much smaller the diff is. :-)
I have some small comments, which I'll make in a review shortly.

@gnprice, I have migrated the user based rate limiter to the new architecture.

@gnprice, added IP based rate limiter.

@gnprice, added both IP and email rate limiters.

Thanks @umairwaheed! Those initial commits now look great -- I just rebased and pushed. I have to run for the evening now, but I'll review the rest in detail tomorrow.
@timabbott, one question for you on the interface: how do you think we'll want to configure these rate limits? I'm thinking probably separate rules for user, email, and IP; they don't really need to be the same, and there are likely good reasons for the optimum values to be different between them.

Thanks @gnprice.

@gnprice, added code to protect login and password reset pages.

@umairwaheed the rate-limiting checks you're adding are in the wrong place.  We want to limit an attacker's ability to check a large number of passwords in Zulip.  So I think there are two valid strategies.

Add a rate_limit call at the entrypoint to all routes that eventually check a password
Instead add a check on the line before we do an actual authentication check of a password (e.g. calls to user_profile.check_password() or authenticate().

I'm not sure which is best, but we should consistently do one or the other.
Probably the decision will depend on which is more annoying to integrate with the existing Django code paths; this should at least include these:

Login button (not the login form, which is I think what you're checking).
fetch_api_key views.

@timabbott As I study this code, one thing that strikes me is that it's kind of hard to tell where the existing authed, user-based rate-limiting is already applied. There are four different places we currently apply rate_limit, for example, which feel rather haphazard:
add_logging_data
authenticated_api_view
authenticated_rest_api_view
authenticate_log_and_execute_json

Plus a call to rate_limit_user directly, in
api_key_only_webhook_view

So e.g. zulip_login_required gets it via add_logging_data. But it'd take some study to convince myself that there aren't some routes that accidentally don't get it, or maybe even some that get it twice as those aren't all obviously located at the same layer.
Hmm, and there are also a bunch of different places there where we do a very similar set of authorization checks: is_active, realm.deactivated, check_subdomain. So this is perhaps just another side of that problem.
I think we should put the IP/email rate-limit check at the point where we're about to actually attempt an authentication. That seems like the only sustainable way to consistently actually call it before we try to authenticate. Those would all be in zproject/backends.py, then, I think.
Similarly, we should consolidate the diverse auth codepaths in zerver/decorators.py that are all doing very similar things so that they go much more through a single codepath -- the haphazardly duplicated situation worries me that there may be bugs lurking there. That's outside of this PR, though.

Instead add a check on the line before we do an actual authentication check of a password (e.g. calls to user_profile.check_password() or authenticate()

@timabbott, adding this code in authenticate() would have been ideal. The only issue was that zproject.backends.EmailAuthBackend.authenticate doesn't have access to request, so we will  have to pass request object to that method to make this work. If not then we can also add this code in OurAuthenticationForm; I think that form is used by all code paths that eventually check password.

@timabbott and @gnprice, updated the code and added the comments where they applied.

The only issue was that zproject.backends.EmailAuthBackend.authenticate doesn't have access to request, so we will have to pass request object to that method to make this work.

That sounds fine to me. The Django docs on custom auth backends say you'll get a request object provided (as non-None) just if you pass one to the django.contrib.auth.authenticate function. We call that function in several spots in zerver/views/auth.py and one each in zerver/views/registration.py and zerver/views/user_settings.py, and we can modify each of those (where appropriate) to pass in the request object.
It makes me a little bit sad to pass the request object in a place we didn't previously need it -- it's sort of a the-whole-world-in-a-ball object, and leaving it off in favor of a few much more specific pieces of data made it easier to understand with confidence what the code being invoked might be about to do. But it seems worth it here.

It makes me a little bit sad to pass the request object in a place we didn't previously need it -- it's sort of a the-whole-world-in-a-ball object, and leaving it off in favor of a few much more specific pieces of data made it easier to understand with confidence what the code being invoked might be about to do. But it seems worth it here.

OK.

Updated the exception handling code. Still need to add request parameter to authenticate.

@gnprice, done.

(rebased)

(rebased)

Fixed the tests.

(rebased)

(rebased)

(rebased)

Closing in favor of #12044.


Buildkite CI: Solve non-core member CI running security issue

We want Buildkite jobs to appear on PRs in the same way that circle jobs appear on PRs automatically.
For security reasons, we don't want to run arbitrary code in a PR from someone who is not on the core team. We need to make sure to detect this.
See a comment below for the latest proposal.
Historical proposals:
Proposals:

Hit GitHub API, if PR is from a fork; deploy a small github bot that listens to a special comment from a core team member (example "!start-test") then allow the test to run.
Hit GitHub API to pull core team from org, if PR author is not in core team; use a https://buildkite.com/docs/pipelines/block-step until a core team member unblocks.

(1) This is out-in-the-open and mirrors other popular open source projects -- like Rust and Swift. But it requires us to maintain a GitHub bot -- though we can do this with a lambda/cloud-function that listens to webhook events on comments.
(2) feels like it's more holistic in the buildkite world, but it's a little more behind-the-scenes and may be opaque to external contributors. Additionally, Brandon's jsonschema-to-dhall library chokes on the block-step schema, so we'd need to update that.
Of these two choices, (1) seems better to me. Feel free to add more ideas in the comments below also.
Changelog:

Add historical proposals and note the newest is at the bottom
Change (1) to if PR is from a fork

@nholland94 is telling me we can use the github-lambda service instead (since we're open-source it should be free)

Dug into a few options for last handful of minutes; rough plan:

By default tests do not run on a PR
If you add the label, ci-build-me, every push of one or more commits will trigger a new build on the tip of the branch (via GitHub Actions)

Rationale
Tests not only not run on external contributors PRs by default (solving the security issue), but they also don't run for anyone. Why? In progress PRs do not burn CI dollars, and you can turn off CI if you're in the middle of making lots of updates. Since CI spend is a large portion of our infrastructure costs, this is a good way to mitigate some of that.
GitHub Actions: This can be achieved easily, and we don't need to host anything ourselves to do it.
Not in scope
Cancelling older builds in progress: This is worth doing, but I don't think this existing blocks us in the short term. We can always cull useless jobs by manually cancelling on buildkite's UI.

With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.

Grr.. this breaks the flow for external contributors. I'll figure out a workaround

This approach is vulnerable to the following attack:
An adversarial contributor first submits a patch, we add the label, then they push code to steal secrets -- since the label is already added CI runs.
I will also include a mechanism for triggering via comment -- it looks like the direct actions approach doesn't quite work since there is no way to expose Buildkite's API token safely.

Commenting each time to allow an external contributor to run CI seems rather unscalable and unacceptable, but so does the vulnerability this pattern entails. How do other organizations deal with this issue? Could we do something like the following?
Bootstrap the buildkite pipelines with a single, truly secure container. This container is will never run if anything involved in running it is touched by an external contributor and has not been explicitly approved by a trusted contributor. When this pipeline runs, it has access to the "true" secrets. From here, we generate temporary secrets with specific access scopes, and forward those to all the future pipelines.
It sounds a little painful to setup, but might fix the problem. But we can literally just generate temp creds with specific API permission scoping. If someone does snoop that secret in one of the future jobs in CI, they will only have snooped a temporary, limited access key that they can't do much with and expires shortly.

Commenting each time to allow an external contributor to run CI seems rather unscalable and unacceptable, but so does the vulnerability this pattern entails. How do other organizations deal with this issue?

Afaik other projects do have comments trigger builds -- at least Swift lang and Rust lang both do this.
Your approach sounds nice, but I don't think it's worth the pain of setting up. For now, would it be acceptable to just have the convention that we only toggle the label on external contributors' PRs rather than leave it on. This way we can manually trigger builds just once.

Your approach sounds nice, but I don't think it's worth the pain of setting up. For now, would it be acceptable to just have the convention that we only toggle the label on external contributors' PRs rather than leave it on. This way we can manually trigger builds just once.

Toggle sounds easy to mess up. Comment would be better. If we have it as a toggle, it's possible that someone forgets to toggle it, and then you have a serious open vuln.


[WIP][TESTS][test-maven][2.4] Investigate OOM at BarrierTaskContextSuite

What changes were proposed in this pull request?
This PR aims to investigate OOM issue in Jenkins Maven (branch-2.4).
Why are the changes needed?
OOM at Jenkins Maven (branch-2.4)
throw exception on barrier() call timeout *** FAILED ***
  "[SPARK-24819]: Barrier execution mode does not allow run a barrier stage that requires more slots than the total number of slots in the cluster currently. Please init a new cluster with more CPU cores or repartition the input RDD(s) to reduce the number of slots required to run this barrier stage." did not contain "The coordinator didn't get all barrier sync requests" (BarrierTaskContextSuite.scala:97)
Exception in thread "ExecutorRunner for app-20191215080059-0000/29" java.lang.OutOfMemoryError: Java heap space
Exception in thread "dispatcher-event-loop-12" java.lang.OutOfMemoryError: Java heap space
Exception in thread "ExecutorRunner for app-20191215080059-0000/30" java.lang.OutOfMemoryError: Java heap space
Exception in thread "dispatcher-event-loop-24" Exception in thread "dispatcher-event-loop-5" java.lang.OutOfMemoryError: Java heap space
Exception in thread "dispatcher-event-loop-30" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "dispatcher-event-loop-25" Exception in thread "dispatcher-event-loop-9" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
*** RUN ABORTED ***
  java.lang.OutOfMemoryError: Java heap space

Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass the Jenkins

Test build #115365 has started for PR 26900 at commit 223c0aa.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20172/
Test PASSed.

cc @vanzin since the Jenkins failure started from https://github.com/apache/spark/pull/26900/commits/37da74acfee85a3f63b6d544f39d26e7c7aafbaf . Since SBT PR Builder is using separate JVM for testings, we may need to revert and recommit with Maven tests.

Test build #115366 has started for PR 26900 at commit 37da74a.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20173/
Test PASSed.

Test build #115367 has started for PR 26900 at commit 3206af7.

The first run is the dummy commit with branch-2.4.
The second and third one are the same reverting one.

Test build #115365 has finished for PR 26900 at commit 223c0aa.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115365/
Test FAILed.

The first run failed again in this PR with Maven with the same reason.
BarrierTaskContextSuite:
- global sync by barrier() call
- support multiple barrier() call within a single task *** FAILED ***
  org.apache.spark.SparkException: Job aborted due to stage failure: Could not recover from a failed barrier ResultStage. Most recent failure reason: Stage failed because barrier task ResultTask(0, 0) finished unsuccessfully.
java.io.IOException: org.apache.spark.SparkException: Failed to get broadcast_0_piece0 of broadcast_0

Test build #115366 has finished for PR 26900 at commit 37da74a.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115366/
Test PASSed.

#26841 is reverted according to this result.

Test build #115367 has finished for PR 26900 at commit 3206af7.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115367/
Test PASSed.


Have LWJGL 3 be the default in Ant templates

Have LWJGL 3 be the default in Ant templates. The basic game and maybe even the tests template? For Gradle we have the selection and that is fine. With Ant you can't select it. One option is to create a wizard or a second template. I wouldn't do it, given Ant is not even the recommended one. No need to have additional things to maintain.
What comes to the LWJGL versions... in jME LWJGL 3 still has some issues. Very minor ones though. LWJGL 2 is old, really old. I assume no one really wants to release a game with it. Given how badly it works in the SDK itself even. I see people migrating from 2 to 3 once they realize the situation. Why not offer it as the default?
Any opinions?

+1

LWJGL3 is a disaster for the SDK (straight not useable) and we even had some problems with key input at some point (confusion between keycode and keychar). But then, LWJGL2 starts to break on some linux versions if not using the SDK bundled JDK (which at some point when they bump libc, will also have problems).
I tried to release a modern build of the old lwjgl2 code base (as that's all that is required to get rid of that error) in https://github.com/MeFisto94/lwjgl but I couldn't get the build to run properly yet.

LWJGL 3 doesn't of course at the moment work for the SDK. That is beyond this issue. The Canvas rendering needs to be implemented in jME first for even the SDK to try running with LWJGL 3.
The test template however... Maybe should be kept at LWJGL 2 since LWJGL 3 doesn't work with Macs (and sometimes even Linux) since the tests have the Swing launcher.

LWJGL3 is a disaster for the SDK (straight not useable) and we even had some problems with key input at some point (confusion between keycode and keychar). But then, LWJGL2 starts to break on some linux versions if not using the SDK bundled JDK (which at some point when they bump libc, will also have problems).
I tried to release a modern build of the old lwjgl2 code base (as that's all that is required to get rid of that error) in https://github.com/MeFisto94/lwjgl but I couldn't get the build to run properly yet.

Also https://github.com/babric/lwjgl but I think there was a more popular fork somewhere that had also all the PRs merged from the official repo. Kinda like a continuation, semi-maintained version. Mentioned once in the jME forums but just now can't find it...


Line chart coloring should be able to scale to visible range of data

The line chart should be able to scale the axes to the range of visible (plotted) data and not to the entire range of data in the table, in order to be able to look at the data in it's full size.

This one is not reproducible on other data, could you provide the dataset or list of actions that lead to such behavior?

Bug was present in case no aggregations were applied to data.
There are still cases to get similar behavior

when x is null, y number is largest and row is not filtered
eg:
col1, col2, col3
a1, 10, 20
a1, 20, 40
a1, , 100

we see table with 100 as max, though max visible value is 40
2)
when some categories have only one point, row is still included in data (though dot might be not displayed in case of large datasets)
eg:
col1, col2, col3
a1, 10, 20
a1, 20, 40
a2, 10, 100
split by col1

@dionissqq  Could you please move the corner cases to a separate ticket with a lower priority and proceed with the current fix (covering the main case) in 1.13? Thanks!

#1561


[CSL-494] Re-implement time broadcasting

@georgeee
Recently headers support from TW was removed.
Need to implement different model of broadcasting
@georgeee has model in mind and is to update this description later

@georgeee
Done withing CSL-447


Fix World::{query_one, query_one_mut} violating unique borrow.

Fixes #300

Had to force push to fix lint.

Released in 0.10.


Add codecoverage for tests

This project should have code coverage for it's tests implemented before 1.0.0 release. We can probably get by with codecov.

pytest-cov can be used to generate reports, it's supported by codecov.
https://pypi.python.org/pypi/pytest-cov


Slayer staff doesn't have all possible spells

The slayer staff is missing some spells, which can be autocast. Notably, all spells from the arceuus spellbook. Possible also spells from other spellbooks.

Humorously, I actually went through and updated the autocast lists recently in ee0f47a26de1b45cd8de43e4d356a1882ee5266b and still got it wrong!
I'll try to update these soon, but it'll be restricted for deployment until at least next Wednesday's game update.

Added in 66407a2, released tonight to plugin hub.


Cannot find symbol org.webrtc.SurfaceViewRenderer in android

Hi,
I am trying to create video calling android application. But getting the error ' Cannot find symbol org.webrtc.SurfaceViewRenderer in android'
Thanks in advance

I had issues with the VideoRenderer and the solution was just to use a specific version of the webrtc library instead of org.webrtc:google-webrtc:1.0.+ in the app build.gradle file. Hopefully that helps you.
implementation 'org.webrtc:google-webrtc:1.0.22672'


Duplicate names for storage accounts

Is this a request for help?:
NO
Is this an ISSUE or FEATURE REQUEST? (choose one):
ISSUE
What version of acs-engine?:
master at commit 65d2ed3ad076256a2dc33e3d4f067e3470d21d15
Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm)
KUBERNETES
What happened:
validation / deployments fails due to storage account names being already taken
msrest.http_logger : b'{"error":{"code":"InvalidTemplateDeployment","message":"The template deployment \'deployment_dry_run\' is not valid according to the validation procedure. The tracking id is \'c1d8c42e-abfa-433b-a40a-9d1e31ad621e\'. See inner errors for details. Please see https://aka.ms/arm-deploy for usage details.","details":[{"code":"PreflightValidationCheckFailed","message":"Preflight validation failed. Please refer to the details for the specific errors.","details":[{"code":"StorageAccountAlreadyTaken","target":"00xrc2zephck2y2agnt0","message":"The storage account named 00xrc2zephck2y2agnt0 is already taken."},{"code":"StorageAccountAlreadyTaken","target":"u0xrc2zephck2y2agnt1","message":"The storage account named u0xrc2zephck2y2agnt1 is already taken."}]}]}}'
Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x7f3ea9688ea0>, <function _x509_from_base64_to_hex_transform at 0x7f3ea9688f28>]
Event: CommandInvoker.OnFilterResult []

What you expected to happen:
deployment validates
How to reproduce it (as minimally and precisely as possible):
create a cluster with common master fqdn prefix - like k8s-prod, kubernetes-test, etc, use StorageAccount for nodes' PersistentVolumeClaims, try to deploy second cluster with the same name and region within another unrelated subscription
Anything else we need to know:
The faulty part is this template line:
"storageAccountBaseName": "[uniqueString(concat(variables('masterFqdnPrefix'),variables('location')))]",
this generates non-unique string. Adding some random string:
 "storageAccountBaseName": "[uniqueString(concat(variables('masterFqdnPrefix'),variables('location'),'fds43'))]",
resolves the problem

Checked the uniqueString reference here: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-string#uniquestring . It seems making sense that we should not allow two different deployments which use the same masterFqdnPrefix + location since master FQDN is in the form of masterFqdnPrefix.location.cloudapp.azure.com (as the entry point for your master nodes).
I do agree we probably should fail at an earlier point.

yeah, quick fail would be cool, as large cluster tends to deploy very long time and still you can end with storage name someone else in Azure uses (as they're unique worldwide)


Infer :name from :model_class in case its missing

follow up for https://github.com/ManageIQ/manageiq/pull/15117
I think in 99% of the cases the :name derived from the Classname or the association name.
TBH, I'm not even sure why the :name is needed in the InventoryCollection when its a concern of the Persister....
@miq-bot assign @Ladas
@miq-bot add_labels refactoring

@durandom Persistor should use this :name to identify the IC. For me, i just like that all of them have some name (even when association and model class are not there)

looks 👍
@miq-bot assign @agrare

Persistor should use this :name to identify the IC. For me, i just like that all of them have some name (even when association and model class are not there)

But why should the IC care about the name, that the Persister references it?


Support client-go-credential-plugins (kubernetes 1.10)

Support client integration
See https://kubernetes.io/docs/admin/authentication/#client-go-credential-plugins for details

separate repository for kube-ldap client-go credential plugin: https://github.com/gyselroth/kube-ldap-client-go-exec-plugin


Test Issue 2

Lets see if it is useable

@siena this is a test.
Issue related to Issue #2
Commit number 0af4d69

Related to commit nr 6524e1ed2

[x] Completed task
[ ] Unfinished task

[x] Nested task


[php84] Fix some deprecations and lower requirements

~I send the PR to the php84 branch, or should it go directly to 11.x branch?~
Is there a StyleCI Rule to enforce explicit nullable types?
A Quick Look / search on https://docs.styleci.io/fixers resulted in nothing.
PHP-CS-Fixer has a rule for this (which is also enforced in Laravel Pint)
https://cs.symfony.com/doc/rules/function_notation/nullable_type_declaration_for_default_null_value.html
Lower Requirements for PHP 8.4:

guzzle/promises should be ^2.0.3
mockery/mockery should be ^1.6.10
symfony/* should be ^7.1.3 or ^7.0.10
sebastian/cli-parser should be ^2.0.1 for PHPUnit 10 and ^3.0.1 for PHPunit 11
nesbot/carbon should be ^3.4.0
sebastian/exporter should be ^6.0.1

I also adjusted the PHPunit requirements in Github Workflows accordingly for nullable types.

Starting Point:
PHPUnit 11 - lowest: Errors: 10, Failures: 8, Deprecations: 735
After this PR:
PHPUnit 11 - stable: Errors: 9, Failures: 8, Deprecations: 68
(Not completely a fair comparison due to using lowest vs stable, but that is okay for me)

Btw, we can also bump these dependencies inside our own composer.json

Yeah I know, I just wanted to find out the lower bounds for now, without needing to update all composer.json files.


AKS Dashboard SSO using AD

do you have a guide SSO authentication for the Dashboard UI as well? (No token)
Thanks

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

ID: 2ba1dad2-9792-2a7b-cdb6-68da0524cff3
Version Independent ID: 42736112-f6db-d241-e89b-48fd2c35ceb7
Content: Manage an Azure Kubernetes Service cluster with the web dashboard
Content Source: articles/aks/kubernetes-dashboard.md
Service: container-service
GitHub Login: @mlearned
Microsoft Alias: mlearned

@GuitaristForEver Thank you for your query. We will investigate and update the thread .

@GuitaristForEver I am not aware of any documentation or if this is supported.
@mlearned @sauryadas any input on this one?

@GuitaristForEver the author has created some additional content around this that will be going live in the new few weeks. ETA is sometime around 8/12
CC @zr-msft

Are there any updates on this? I don't want our users to run a command, I'd like the SSO page to appear and authenticate.


feat: updated final version to devrel repo

Hey @paulparkinson could you take a look at this PR when you get a chance?

@WSPluta


Consider changing "Close" panel button to be "Hide"

Currently all panels feature a x button which when hovered say "Close". This is ambiguous for the terminal as to weather it will destroy the processes and potentially will be for other/future panels. I suggest changing this to a minimize/hide icon - with a tooltip that reads "Hide".

/cc @bgashler1 @bpasero @stevencl

Assigning to @bgashler1 since this is a overall UI issue

After discussing this with others and thinking about it, I feel it's best we use a downward chevron arrow (collapse arrow).
This implies a non-destructive removal of a view and disambiguates the expected behavior some users have of an "X" in a terminal (terminating a process, removing history and closing the terminal).

I'll leave the "Close" tooltip as is to keep it consistent with the command name


Hardhat reports inconsistent gas usages when running in the fork mode

Version of Hardhat
2.22.15
What happened?
What Goes Wrong
Hardhat reports inconsistent gas usage when running in fork mode. Different runs may result in different gas usages on the same set of transactions in the same order, in the state forked from the same block.
A potentially related issue has been reported before.
My Setup
Hardhat Server Process
I use Hardhat as a local JSON_RPC. Here is my hardhat.config.js:
module.exports = {
    solidity: "0.8.25",
    networks:{
      hardhat:{
        throwOnTransactionFailures: false,
        throwOnCallFailures: false,
        chainId: 1,
        mining: {
          mempool: {
            order: "fifo"
          }
        },
        accounts: {
          count: 2
        }
      }
    }
  };

Payloads
I have a paylods.json file containing a set of queries. The detailed description of the queries structure is deferred to the further details section. The payloads.json is hosted here or find attached payloads.json
Payloads Execution
The payloads are submitted via POST request using python sctipt submit_payloads.py, which does the following;
For iteration 1 to MAX_RUNS

forks the blockchain using FORK_PAYLOAD payload

Submit each payload from the payloads.json file and logs the responses. The return status is ensured to be 200

logs the responses to the output_{run}.json file

prints the hashes of the logs upon exit to the screen

The full code is as below. Note that in order to run, you need to replace JSON_RPC_TOKEN with a token, I use infura api:
import json
import requests
import time
import os
import hashlib

JSON_RPC_TOKEN = "YOUR REMOTE RPC TOKEN"

# Tunable parameters
HARDHAT_PORT = 1234
MAX_RUNS = 200
COOLDOWN_SECONDS = 1
PAYLOADS = "payloads.json"
LOG_DIR = "logs"

HEADERS = {
    'Content-Type': 'application/json'
}
FORK_PAYLOAD = {
    "jsonrpc": "2.0",
    "method": "hardhat_reset",
    "params": [
        {
            "forking": {
                "jsonRpcUrl": JSON_RPC_TOKEN,
                "blockNumber": 20845407
            }
        }
    ],
    "id": 1
}
REQUEST_BLOCK_INFO_PAYLOAD = {
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": ["latest", False],
    "id": 1
}

def submit_payload(payload):
    response = requests.request("POST", f"http://<IP_ADDRESS>:{HARDHAT_PORT}", headers=HEADERS, data=json.dumps(payload))
    assert response.status_code == 200
    return json.loads(response.text)

def main(run):
    # first fork the mainnet
    submit_payload(FORK_PAYLOAD)

    # then read payloads from a file
    with open(PAYLOADS, 'r') as f:
        payloads = json.load(f)

    # submit each payload and log the response
    with open(f"{LOG_DIR}/output_{str(run).zfill(3)}.json", 'w') as f:
        for i, payload in enumerate(payloads):
            response = submit_payload(payload)

            # log the response
            f.write(json.dumps(response).replace("\n", ""))
            f.write("\n")

    # request block info
    response = submit_payload(REQUEST_BLOCK_INFO_PAYLOAD)

    # return the hash of the block
    return response

if __name__ == "__main__":
    if not os.path.exists(LOG_DIR):
        os.makedirs(LOG_DIR)

    for i in range(MAX_RUNS):
        main(i)
        time.sleep(1)

    log_files = os.listdir(LOG_DIR)
    log_files = [fname for fname in log_files if fname.endswith(".json")]
    log_files.sort()

    # display the hash of the last block
    for log_file in log_files:
        with open(f"{LOG_DIR}/{log_file}", 'r') as f:
            file_content = f.read()
        print(f"{log_file}: {hashlib.sha256(file_content.encode()).hexdigest()}")

Logs Comparation
The logs show that the gas consumption may wary from run to run. Usually the first divergence happen for the line line 1360 of the logs:
{"jsonrpc": "2.0", "id": 1, "result": {"cumulativeGasUsed": "0x9264d6", ...
{"jsonrpc": "2.0", "id": 1, "result": {"cumulativeGasUsed": "0x925ebe", ...
Further Details
The bug was discovered while my colleagues and I tried to emulate the block mining process. We collected a set of real transactions (smart contracts and externaly owned accounts) and tried to get the gas usege of the block when mined.
The payload.json file contains the payload data to call the hardhat RPC. The payloads description:

hardhat reset and fork call, done from the script

{
    "jsonrpc": "2.0",
    "method": "hardhat_reset",
    "params": [
        {
            "forking": {
                "jsonRpcUrl": JSON_RPC_TOKEN,
                "blockNumber": 20845407
            }
        }
    ],
    "id": 1
}

Turn off automine and get automine mode

[{"jsonrpc":"2.0","method":"evm_setAutomine","params":[false],"id":1},
{"jsonrpc":"2.0","method":"hardhat_getAutomine","params":[],"id":1}]

Set the block gas limit to the sum of all maxGasUsage

{"jsonrpc":"2.0","method":"evm_setBlockGasLimit","params":[205322942],"id":1}

Impersonate all accounts which are sent to the block

...
{"jsonrpc":"2.0","method":"hardhat_impersonateAccount","params":["0x894ff15a502f55943e488a6e035bff78c828b573"],"id":1},
{"jsonrpc":"2.0","method":"hardhat_impersonateAccount","params":["0xf89d7b9c864f589bbf53a82105107622b35eaa40"],"id":1},
...

This is quite non-standard scenario, the cause of the bag could be here. For our scenario we need to make sure that each transaction got to the pool as we are interested in the situation when, say, an account B does not have enough balance to send a transaction TxB, but if there is a transaction TxA which tops up the balance B making the block [TxA, TxB] a valid block. To bypass hardhat's automatic balance check (which prevents sending the tx TxB otherwise), for each transaction we do:

get the balance of the caller
set the balance of the caller to $2^{256} - 1$
submit the transaction to the pool
set the balance to the value we get from the first step

...
{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x894fF15a502f55943E488a6E035bFF78c828B573","latest"],"id":1},
{"jsonrpc":"2.0","method":"hardhat_setBalance","params":["0x894fF15a502f55943E488a6E035bFF78c828B573","0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"],"id":1},
{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"data":"0x095ea7b300000000000000000000000080a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","from":"0x894fF15a502f55943E488a6E035bFF78c828B573","gas":57087,"nonce":683,"to":"0x65591F115286A284870e1677B1ad52DB4A762B54","value":0,"maxFeePerGas":12497504523,"maxPriorityFeePerGas":3000000000}],"id":1},
{"jsonrpc":"2.0","method":"hardhat_setBalance","params":["0x894fF15a502f55943E488a6E035bFF78c828B573","0x765f80d4ff56ca0"],"id":1},
...

mine the block

{"jsonrpc":"2.0","method":"evm_mine","params":[],"id":1}

for each transaction get the receipt and the new balance

...
{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["810962865bf8a0aef20a7653aa6be334860f9f83b82110a674888665d95c6886"],"id":1},
{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xc5ed543899bd2cf38be5ae098c4987e5c900dc7c","0x13e1360"],"id":1},
...

Minimal reproduction steps
Reproducing the Bug
I managed to reproduce the bug in a container. You can find the PoC and instructions here. The reproduction instructions are:

git clone https://github.com/polka125/hardhat-bug-artifacts.git
put your remote api key to the file RPC_TOKEN
docker build -t hardhat_bug .
docker run -v ./host_logs:/app/logs -it hardhat_bug At this point you might get feeling that the docker stuck, but check host_logs/hardhat.log, it accumulates the hardhat output, i.e. the process is running
find ./host_logs -type f -print0 | sort -z | xargs -0 shasum -a 1

The last step will print hashes of the log files, the log files with different logs will be easy to locate visually as their hashes will diverge
Search terms
Gas usage, Fork mode

Hey @polka125, sorry for not responding this before, this issue fell through the cracks and we didn't prioritize it sooner. I'll take a look as soon as I can.

Hi @polka125. I haven't tried to reproduce this locally yet, but one thing I noticed is that you are not setting an initial timestamp. Since this changes between executions, it's possible that that's the reason for the difference in gas usage.
From what I can tell, you are executing the transactions of block 20845408. The timestamp of that block is<PHONE_NUMBER>. So you can send evm_setNextBlockTimestamp with that value after hardhat_reset and before evm_mine to get a consistent timetsamp in the mined block.
Could you try that and tell me if the inconsistency persists?

Hi @fvictorio,
Oh, seems it was indeed the reason. I added the evm_setNextBlockTimestamp call, and now all blocks are identical.
Thank you!

Glad to hear that!


Adds dataset to inMemory cache key patterns

Solves https://github.com/honeycombio/refinery/issues/269
The issue has more details on the use case and the problems i've encountered.
Not sure if this follows best practices in go, so feel free to review it harshly =)
I've tested this on our stack, open to discuss specifics, reach out here or on pollinators 😄
Did some thinking on how to add tests for this specific use case, but was not happy with any of the solutions as it transposes collect and rules "domains", open to inputs on how/if those are required.

Discussing in the associated issue:
https://github.com/honeycombio/refinery/issues/269#issuecomment-884501551

https://github.com/honeycombio/refinery/issues/269#issuecomment-888653478


Revert "Fix environment passed to ansible-lint (#649)"

This reverts commit c7ffdf877daea2785cd409706201d25b4770d591.
This commit broke functional tests.  Reverting until submitter corrects it to work with tox.

I'm not sure how passing a standard variable PYTHONPATH to a program which requires this very variable to run (ansible-lint) to access Ansible modules breaks something in an unrelated part.
It rather looks like someone has that variable set to an improper value and should correct their real problem.
It sounds surreal to me that code must take into account incorrect environment settings, not the other way.

Running the tests broke.  I simply reverted it so I could put out a new release.


EI game animation frame selection

Research and choose animation frames to learn about trusting games: https://ncase.me/trust/

申请开发 deadline: 2021-05-17 size: 1 @fushang318


Formatting tweaks, tabs->spaces

Just reading through the rendered spec on GitHub and found a couple of indents that are being treated as

quoted text

where I don't think it was intentional.
Please check the rich diff to confirm this (the button is at the top right of the files changed window)

I think this is happening because we have some mixed tabs/spaces in the specification...

The diff also looks wrong now for code/JSON example sections.

Yep, trying to fix this properly with expandtab now
On Fri, 11 Jun 2021, 09:43 Casper Welzel Andersen, @.***>
wrote:

The diff also looks wrong now for code/JSON example sections.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Materials-Consortia/OPTIMADE/pull/363#issuecomment-859394145,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB4MTYBGBHUJPJZS4YZJE3DTSHEBPANCNFSM46QHD4DA
.

So I ended up going a bit overboard here, and have a script that can strip the JSON blocks out of the spec and validate them as JSON (a separate problem to the whitespace). This turned up lots of extra commas and missing quotes. I'm not sure if it's something that is worth adding to the CI itself as it is slightly manual (e.g. it skips our //comments so there are some false positives), but it has at least turned up some errors.


Add description about websocket in Swagger

Time to do: 30 minutes

How to connect
How to sent message
How to recive

(Nikita) I need to know about all possible errors format

Updated the web-sockets branch:

The connection is made with the request “ws://localhost:8000/ws/chats/1/”, in headers we specify “access”
Sending a message to a websocket has the following fields:
{
"chat_id": 1,
"prompt": "Hello",
"owner_id": 1,
"method": "request"
}
In the response in the websocket we will receive response:
{
"id": 34,
"message_text": "Hello",
"created_at": "2023-08-24 18:12:20.378780+00:00",
"chat_id": 1,
"owner_id": 1,
"method": "response"
}
Next comes the first message from the model with fields:
{
"chat_id": 1,
"created_at": "2023-08-24 18:12:20.393336+00:00",
"id": 35,
"message_chunk": "",
"owner_id": 100,
"status": "start"
}
Generation arrives with fields:
{
"id": 35,
"message_chunk": "!",
"status": "progress"
}
The answer ends:
{
"id": 35,
"message_chunk": "",
"status": "done"
}


Windows close doesn't work in electron

I'm running the lyra2019 branch in an electron window and it works great. But if I click on the close button of the electron window, nothing happens, in particular, the window doesn't close.
Does lyra somehow hook into some close event and prevents closing from happening?

here's the problem line -- i recommend commenting it out for now to get your things working, and i think there can be a separate conversation later about whether this is useful for lyra
https://github.com/vega/lyra/blob/58b2029c684649ba26e4bbb2801da893044ace41/src/js/ctrl/listeners.ts#L41


chore(deps): upgrade dependencies

Upgrades project dependencies. See details in workflow run.

Automatically created by projen via the "upgrade-main" workflow

Codecov Report

Merging #301 (d9cd779) into main (2974dfe) will increase coverage by 12.10%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main     #301       +/-   ##
===========================================
+ Coverage   83.33%   95.44%   +12.10%
===========================================
  Files           2        1        -1
  Lines         126      395      +269
  Branches       31       46       +15
===========================================
+ Hits          105      377      +272
+ Misses         21       18        -3

Impacted Files
Coverage Δ

src/index.ts
95.44% <100.00%> (+13.44%)
:arrow_up:

example/src/main.ts

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 20372eb...d9cd779. Read the comment docs.


[BUG] ./automated-tests/integration/vsphere/tests.sh are always failing

As per title, all the commits are marked as failed due to this failing test

the vSphere E2E was failing in the ansible roles download from the private repo step with a 404 error. The problem was an expired token.
Updating the token solved the issue.


Separate parser and nom dependency into feature

This pull request separates the parser component and nom dependency into a feature flag. This feature flag is enabled by default and is therefore a backwards compatible change.
Rationale
I don't use the included parser in my compiler as I have a separate parser component for that (and I imagine that most people would as well). It was also surprising to me that the parser function was leaking. I think that nom can be considered an unnecessary dependency most of the time.

Codecov Report

Merging #17 into master will decrease coverage by 0.19%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master      #17     +/-   ##
=========================================
- Coverage   93.26%   93.06%   -0.2%
=========================================
  Files           5        5
  Lines         505      505
=========================================
- Hits          471      470      -1
- Misses         34       35      +1

Impacted Files
Coverage Δ

tests/tests.rs
98.5% <ø> (ø)
:arrow_up:

src/types.rs
95.72% <ø> (-0.11%)
:arrow_down:

src/lib.rs
43.75% <ø> (ø)
:arrow_up:

src/parser.rs
85% <100%> (-3.24%)
:arrow_down:

Continue to review full report at Codecov.

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


[💄UI] Need a good landing page for XProfile

Repository Link
We have been continuously working on Version 2 of XProfile, where we have added a lot of features, new designs. We are looking for someone who can design a good landing page for us.
TODO:

Design a modern design landing page for XProfile
Join Discord. The community will give  suggestions and feedbacks
Design should be minimal and catchy

I can work on this. But need designs and stuff.
I can also create myself with minimalistic design. Got this from LinksHub :)

Oo great @Anmol-Baranwal Thank you for your precious time. We are creating a linktree clone with a lot of more features. Now we need a landing page for it. Design inspiration could be taken from the landing page of https://bento.me/en/home
Join our Discord to discuss more about it

I think i Can give it a try

It's just the design. We can code on our own. We need a design for landing page

Hi @hellofaizan , I would be interested in contributing to this issue.

It's just the design. You can start code after we finalise the design. We need a design for Landing page first @symaticvisuals • If you are okay with it, you can start

Hey there! I have design skills and would be interested in working together on a landing page. Could you share some ideas for sections you think should be on the page? Once I have some direction, I can start creating a design in Figma.

Seeing you a theme on your Discord DM


[BUG] Expressibility

Describe the bug
Maybe a also a feature...
Check the expressibility calculation regarding

[ ] redundant calculation over input samples
[x] usage of rng
[ ] scaling of sample size / n_bins with number of qubits in the model
[x] input domain should be optional

n_samples exp scaling + flag for disable
n_bins lin scaling + flag for disable


Added original image dimensions to CropResult.

With this PR, we should be able to get the whole image dimensions in a rect in CropResult. I had an issue about this before here: https://github.com/ArthurHub/Android-Image-Cropper/issues/324
I tested this code in my master branch over here with JitPack: https://github.com/gazialankus/Android-Image-Cropper/tree/master and then I cherry picked from there to create this PR. The code is the same, so it should just work.

thx


performance on static etag disabled are worse than with etag enabled

Hi,
I noticed disabling etag on express.static performance are (a little) worse than with the etag enabled, while I would expect the opposite.
run on node 10.22, but same with node 12 and 14
here the code, large.html is ~3MB, medium.html ~15kB, small.html ~50b
https://gist.github.com/simone-sanfratello/dd67f1b2fa24c88984a1ed98e8f5928b
result
benchmarking large.html ON
Running 10s test @ http://localhost:9876/large.html
  8 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   210.86ms   28.50ms 377.90ms   86.36%
    Req/Sec    57.33     25.88   121.00     60.60%
  4502 requests in 10.03s, 16.02GB read
Requests/sec:    448.95
Transfer/sec:      1.60GB

----------------------------
benchmarking large.html off
Running 10s test @ http://localhost:9876/large.html
  8 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   226.77ms   27.01ms 361.56ms   76.54%
    Req/Sec    53.29     24.15   111.00     66.85%
  4195 requests in 10.04s, 14.89GB read
Requests/sec:    417.98
Transfer/sec:      1.48GB

----------------------------
benchmarking medium.html ON
Running 10s test @ http://localhost:9876/medium.html
  8 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    13.67ms   16.02ms 142.15ms   79.93%
    Req/Sec     1.62k   391.82     8.13k    88.94%
  128306 requests in 10.10s, 2.24GB read
Requests/sec:  12702.92
Transfer/sec:    226.70MB

----------------------------
benchmarking medium.html off
Running 10s test @ http://localhost:9876/medium.html
  8 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    13.43ms   15.50ms 114.69ms   79.55%
    Req/Sec     1.64k   304.99     2.30k    85.09%
  129980 requests in 10.02s, 2.26GB read
Requests/sec:  12969.41
Transfer/sec:    231.11MB

----------------------------
benchmarking small.html ON
Running 10s test @ http://localhost:9876/small.html
  8 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     6.60ms    3.30ms  77.75ms   96.68%
    Req/Sec     1.89k   316.37     2.50k    93.38%
  150661 requests in 10.04s, 47.85MB read
Requests/sec:  15001.94
Transfer/sec:      4.76MB

----------------------------
benchmarking small.html off
Running 10s test @ http://localhost:9876/small.html
  8 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     6.68ms    5.19ms 115.99ms   97.61%
    Req/Sec     1.92k   311.41     2.85k    93.35%
  152776 requests in 10.06s, 44.73MB read
Requests/sec:  15193.44
Transfer/sec:      4.45MB

----------------------------

Have you tried each test several times or were they singular? Unless there is more data, this 2% difference doesn't seem significant and could be attributed to, say, your computer's thermals

I tried in different envs and result is the same, from my laptop to staging application env.
Did you tried the same and you have different results? Can you share?


🎨 Update sponsorship section

Add a link that can be used as a button on the website
Clean up language

@gavinking .. this is for you. ;)

Thanks!


feature: automated updates

Whatever work gets done on this should be replicated to other clients

The autogen functionality should be moved into https://github.com/devflowinc/trieve/issues/1137. Much easier to manage


Seed phrase not revealing on Google Pixel 7 Pro

Hello, I just installed the wallet on my brand new G Pixel 7 Pro with the latest android version and whenever I tap to reveal seed phrase, it does nothing (literally does not show seed phrase). Please assist, thank you very much.

Hello! Could you please share more information:

Exact Android version
Is there any error you see when you tap reveal?
Do you have biometrics enabled for unlocking your wallet?

Many thanks in advance

Hello, my android version is:
-AP1A.240305.019.A1
-No error, the loading screen animation appears very shortly/quickly/briefly --> no seed phrase to display.
-Yes I do have biometrics enabled for unlocking.

More information, the wallet was newly created with 0 funds.


docker pull repository pulls the whole repository instead of just repository:latest and its parents

The lopter/docker-ut repository has a few images in it, but the one tagged latest has no parents.
When you do docker pull lopter/docker-ut all the images in the repository are pulled instead of just the one tagged latest.
We looked in the S3 bucket with @samalba and everything is correct here. It looks like the registry code doesn't correctly resolve the latest tag (and then download its parents) but blindly download all the images in the repository instead.

So if the docker pull repository feature has been overwritten by defaulting to latest. Was the older functionality replaced? I need a command to pull or search the entire registry for all images


[FLINK-35348][table] Introduce refresh materialized table rest api

What is the purpose of the change
Introduce refresh materialized table rest api
Brief change log

test-filesystem support partition.fields option
Introduce refresh materialized table rest api

Verifying this change

Add test case in MaterializedTableITCase to verify refresh materialzied table.
Add test class SqlGatewayRestEndpointMaterializedTableITCase to verify refresh materialized table rest api.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): (no)
The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
The serializers: (no)
The runtime per-record code paths (performance sensitive): (no)
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
The S3 file system connector: (no)

Documentation

Does this pull request introduce a new feature? (yes)
If yes, how is the feature documented? (Will be added in a separated pr.)

@flinkbot run azure


Emulator vs. Service: Partition Key Character Difference

Currently, the Cosmos DB Table API Emulator does not support querying partition keys that have a slash in them ("/"), but the service does. The SDK will throw an exception that the request uri is invalid.
Please update the documentation to reflect that difference, and if possible, update the emulator to support slashes in the partition key.

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

ID: 109ed3f8-faf1-92b9-bf50-4be52e9099d4
Version Independent ID: ebc5326a-46da-6bc1-1f47-01a8e16d11fb
Content: Install and develop locally with Azure Cosmos DB Emulator
Content Source: articles/cosmos-db/local-emulator.md
Service: cosmos-db
GitHub Login: @markjbrown
Microsoft Alias: mjbrown

@xinyi-joffre  Thank you for your feedback! We will review and update as appropriate.

Please assign to @StefArroyo
Thanks.

The document mentions that not all of the APIs are fully supported (only SQL API). Will update the doc w/ this example on Table API.

#please-close


Fix curl error handling when self updating

Sometimes, curl fails some reason.
like this
$ phpbrew self-update

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

But the fail ignored, and overwrite phpbrew binary with failed file.

the manual says the system function

Returns the last line of the command output on success, and FALSE on failure.
so it's why the origin script fails on $code == 0

However, you modified the script and set $code to return_var, and keep the sentences which throw an exception if $code equals 0. return_var equals 0 should means everything is ok, and NO exception should be thrown.

return_var equals 0 should means everything is ok, and NO exception should be thrown.

if(! $code == 0) has !.
If return_var is 0, !(0 == 0) === false. No exception thrown.
And system function returns empty string if curl fails.
<?php
$tempFile = tempnam(sys_get_temp_dir(), 'phpbrew_');
$code = system("curl -# -L https://raw.githubusercontent_.com/phpbrew/phpbrew/master/phpbrew > $tempFile", $retValue);
var_dump($code, $retValue);

if(! $code == 0) { // false
	throw new RuntimeException("Update Failed 1", 1);
}

if(! $retValue == 0) { // true
	throw new RuntimeException("Update Failed 2", 1);
}

Output:
curl: (6) Could not resolve host: raw.githubusercontent_.com
string(0) ""
int(6)
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Update Failed 2' in /path/to/test.php:11
Stack trace:
#0 {main}
  thrown in /path/to/test.php on line 11

Fatal error: Uncaught exception 'RuntimeException' with message 'Update Failed 2' in /path/to/test.php on line 11

orz I ignored !...

Added check for return value of system function


Capitalize Raft in beta-20170105 release notes

Capitalize Raft in beta-20170105 release notes.

This change is

http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/4e7b18fab64827a241223366e136550a604d7deb/


Data Store

9b6e50c These files were just annoyingly nested for no real reason after the move to primitive types was complete
a8d59f6 The diffs for these tests was really hard to grok, deleting these here so the new ones don't show up as diffs
a1458a3 and after are the more critical changes

This readme might help navigating the tests https://github.com/tinacms/tinacms/pull/2241/commits/ab5390c904c4b868ed271f9b576b40a1152579da

cc @logan-anderson I noticed a bug in the fragment generation. It only manifests with the more comprehensive tests I've written here so I wanted to just include the fix with this. Can you take a look at https://github.com/tinacms/tinacms/pull/2241/commits/e1243c5993a05cb6335503ecaff0fc7d59f9b191 and make sure it makes sense to you? Without it, collections with templates were generating fragments without the fragment keyword:
Post {
  ... on PostPost {
    title
    body
    author {
      ... on Document {
        id
      }
    }
  }
}

And now:
fragment PostParts on Post {
  ... on PostPost {
    title
    body
    author {
      ... on Document {
        id
      }
    }
  }
}

I noticed a few new test cases and a bug that actually would have broken for non-experimental sites.

@jeffsee55 Makes sense to me.


Initial work on 0.5

Added simple_manual example for both GTK and libadwaita.
Updated the introduction and first_app documents.

Sections 1 and 2 are complete, please review.

If you change the target to next, we could try to merge this already. "next" is in development anyway, so it doesn't need to be complete and makes it easier for others to read through.

Doesn't really matter. Rebase is probably cleaner. Also, you can try to merge it yourself, you should have the permission.


add --vcr-mode=refresh pseudo mode

--vcr-record=all doesn't actually re-record the cassette but keeps or update (if there is a match) any previous episode and append the new ones.(see an example).
That's the reason why we generally recommend to delete the yaml file in advance and recreate it from scratch, but it's tedious. (and this is particularly important if the test match on the request's body)
--vcr-record=refresh delete and start recording from scratch.

@ktosiek may you consider merging this?

@mgaitan As this plugin looks abandoned, may I suggest you try out pytest-recording instead? It has a fully compatible API with this plugin. We have the rewrite record mode, which could be exactly what you're looking for :)


[solidjs][typescript] Getting typing right in the LoginForm example

Hi, I'm just trying to get typing working but somehow even the LoginForm typescript example leads to errors.
My main issue is getting typing for the FormStore<FieldValues> right. One of the issues Intellij gives me is that it always requires the second argument (Generic type 'FormStore' requires '2' type argument(s) ) which seems to be easy to fix. But even when this is fixed the fields "of" parameter always complains with Type FormStore<LoginForm> is not assignable to type FormStore<TFieldValues, TResponseData>  as well as the children render method Type (field: any, props: any) => JSX.Element is not assignable to type <TFieldValues, TFieldName>(store: FieldStore<TFieldValues, TFieldName>, props: FieldElementProps<TFieldValues, TFieldName>) => JSX.Element .

Let me know if I can add any more information to reproduce this.

Can you send me a StackBlitz link? You can use this as a template: https://stackblitz.com/edit/modular-forms-solid?file=src/routes/login.tsx

Please make sure that the libraries you are using are up to date.

Thanks for the fast reply. I copied the content from the guide (https://modularforms.dev/solid/guides/typescript) into stackblitz and it shows the same typescript errors (it is running though): https://stackblitz.com/edit/modular-forms-solid-dkgdkw?file=src%2Fapp.tsx,src%2FLoginPage.tsx

Thank you very much! I will look into this issue. For now, here is a workaround: https://stackblitz.com/edit/modular-forms-solid-owzxu8?file=src%2Fapp.tsx,src%2FLoginPage.tsx

Nice, thanks a lot so far!

This is fixed now. Thanks!


BeaconState deep copy

Description
The first step of the state transition is to copy the previous state
The copy constructor is stubbed out in BeaconState.java:
  public BeaconState(BeaconState state){
    // deep copy
    this.slot = state.slot;
  }

we need all the properties from the state object passed in to be copied to the current instance.  You can see we are doing it with slot.  Implement this for all the member vars in the class.
Acceptance Criteria

implemented in a copy constructor
needs to be a deeps copy

Resolved by #141


Use Bazel to version kubectl & kind images in e2e tests

What this PR does / why we need it:
Version kubectl during e2e tests using Bazel.
This makes it easy for us to upgrade to new versions of kind and the kind base images in future 😄
This should also make the pull-cert-manager-e2e-v1-13 job pass.
Release note:
NONE

/area testing

/test e2e v1.13

/retest
/test e2e v1.13

/retest

/lgtm

/override pull-cert-manager-bazel
/override pull-cert-manager-e2e-v1-11


[BUG] Bite (Drake Companion)

Bite Attack on Drake Companion gets additional +@prof, because it added in Attack Modifier.
Example on 3rd level ranger.

I don't think he does these that way.  His equation is actually uniquely different because typically the strategy in these styles of converting Actor A's prof into Actor B's attack is you have to clear actor B's prof out.  So it makes the attack look ugly as you will see -Bmod -Bprof +Amod +Aprof
What he does with these instead is he looks at the difference between the ranger and the drake wardens attack mods and instead of minusing both and adding in the new ones, he takes the difference and applies it as a third modifier to the drake wardens attack.  So it may look like a second prof, but what it should be is 2 is the mod, 3 is the prof, and 2 is the difference, so the ranger probably has a proficiency of 5.  Or I might be mixing up the numbers and its 2 prof, 3 mod, and that 2 is the difference of a ranger with 4 prof and the drake only having 2 prof.

I couldn't find any other summon with attack defined like that. And in attack roll cleary seen +7 instead of +5 (that should be on 3rd level)

is this summon draconic spirit or drake warden companion?

drake warden

If you need an immediate fix, unlock the cpr compendium "CPR Summon Features" and find the folder for Drake Companion and edit out the @prof in the attack roll bonus field:

I have already submitted a bug report to Chris about this.

I fixed it in my games, just wanted to report so other won't be confused.
Thank you.

I misidentified this as the other drake summons, the spell at first


Warning: Mapping new ns (...) to old ns (...)

Anyone know what this means?
Console output when starting app:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
Warning: Mapping new ns [http://schemas.android.com/repository/android/common/02]() to old ns [http://schemas.android.com/repository/android/common/01]()
Warning: Mapping new ns [http://schemas.android.com/repository/android/generic/02]() to old ns [http://schemas.android.com/repository/android/generic/01]()
Warning: Mapping new ns [http://schemas.android.com/sdk/android/repo/addon2/02]() to old ns [http://schemas.android.com/sdk/android/repo/addon2/01]()
Warning: Mapping new ns [http://schemas.android.com/sdk/android/repo/repository2/02]() to old ns [http://schemas.android.com/sdk/android/repo/repository2/01]()
Warning: Mapping new ns [http://schemas.android.com/sdk/android/repo/sys-img2/02]() to old ns [http://schemas.android.com/sdk/android/repo/sys-img2/01]()

This could look like a Gradle issue according to https://github.com/flutter/flutter/issues/87464 and Warning: Mapping new ns to old ns and emulator stopping abruptly.
Solution should be up update an align Gradle versions in gradle-wrapper.properties and /android/build.gradle


[HUDI-2987] Fix payload event time extraction

Make eventTime passed in via constructor for DefaultHoodiePayload and OverwriteWithLatestAvroPayload
Remove extraction logic out of getInsertValue() and combineAndGetUpdateValue()

Committer checklist

[ ] Has a corresponding JIRA in PR title & commit

[ ] Commit message is descriptive of the change

[ ] CI is green

[ ] Necessary doc changes done or have another open PR

[ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@xushiyan : Since we are moving event time logic to base payload class, would like to understand the use-case for eventTime. whether it necessitates for all payload implementations. we already have preCombine field or payload ordering field and so trying to understand the use-case for event time.

Can we close this one out. I have put up a draft PR based on consensus on how to go about this.


SqlServer: INCLUDE index column are shown as they were index column

System information:

Operating system (distribution) and version: Windows 10
DBeaver version: <IP_ADDRESS>105300349
Additional extensions: n/a

Connection specification:

Database name and version: Sql Server 2016
Driver name: Microsoft
Do you use tunnels or proxies (SSH, SOCKS, etc)?  n/a

Describe the problem you're observing:
Sql Server supports creating indexes with some column composing the index plus some "INCLUDE" columns, which are stored within the index for fast retrieval but are not, in fact, indexed.
The following index:
CREATE NONCLUSTERED INDEX [test_idx]
    ON dbo.[test] ([x1],[x2])
    INCLUDE ([x3])

is shown as if it was created with this (very different) instruction:
CREATE NONCLUSTERED INDEX [test_idx]
    ON dbo.[test] ([x3],[x1],[x2])

This is how SMSS displays this index instead, with a clear distinction between key columns and include columns (of course DBeaver interface is much different so you cannot take ideas from this):

Steps to reproduce, if exist:
create table dbo.test (
    x1 integer,
    x2 integer,
    x3 integer
)
go

CREATE NONCLUSTERED INDEX [test_idx]
    ON dbo.[test] ([x1],[x2])
    INCLUDE ([x3])
go

Include any warning/errors/backtraces from the logs

thank you for the report

Done:

verified


SocketIO Tutorial Issue #449

Hi Tien, I've made some changes according to your review. I added a drawn diagram of the messaging app and I changed the png file to jpg to add background. Hope this is better!


handleSaveResults

Nice work but I have error message when I save:
Method does not exist or incorrect signature: handleSaveResults(MetadataService.SaveResult)
And here the class:
public class MyTestingUpdatePicklist {
public static void updatePicklistField()
{
MetadataService.MetadataPort service = MetadataServiceExamples.createService();
MetadataService.CustomField customField = new MetadataService.CustomField();
customField.fullName = 'Opportunity.test__c';
customField.label = 'test';
customField.type_x = 'Picklist';
metadataservice.Picklist pt = new metadataservice.Picklist();
pt.sorted= false;
metadataservice.PicklistValue eyecare = new metadataservice.PicklistValue();
eyecare.fullName= 'eye';
eyecare.default_x=false ;
metadataservice.PicklistValue eyeone = new metadataservice.PicklistValue();
eyeone.fullName= 'hand';
eyeone.default_x=false ;
pt.picklistValues = new list<metadataservice.PicklistValue>{eyecare,eyeone};
customField.picklist = pt ;
List<MetadataService.SaveResult> results = service.updateMetadata(
new MetadataService.Metadata[] { customField });
handleSaveResults(results[0]);
// handleSaveResults( service.updateMetadata(
//   new MetadataService.Metadata[] { customField })[0]);
//  SaveResult[]  results = metadataConnection.updateMetadata(Metadata[] customField);
}
}
Help needed please.

I'm guessing you've based the provided code on the examples in MetadataServiceExamples? The handleSaveResults method is defined in that class. Your code fails to compile because no such method 'handleSaveResults(MetadataService.SaveResult)' defined in your class.

Thank you frup42, I was able to fix the issue but still the picklist values have not been added to the custom field. Any help?

Looks like there's a few more problems in the code you provided.
pt.picklistValues = new list{eyecare,eyeone};
should be: pt.picklistValues = new List<MetadataService.PicklistValue>{eyecare,eyeone};
List results = service.updateMetadata(
should be: List<MetadataService.SaveResult> results = service.updateMetadata(
And you're calling updateMetadata - from the OP I got the impression you were trying to CREATE, not UPDATE a picklist field. Do you get the required result when you call createMetadata instead?

Thank you David. The picklist field exists already as a custom field. I'm trying to add values to the picklist.

In fact, here is the bigger picture of what I'm trying to accomplish. I have a custom object A and I want every time a record X is added to the custom object A, X get added as a value of the picklist field b of the custom object C.
Thank you again.

With the slight modifications to the List declarations, I'm able to add and update the Opportunity.Incumbent__c picklist field with your code. So I'm not too sure where you're going wrong.
Are you getting any error messages? Are you able to update other field types or other metadata types?
Also, your use case says you want to add a picklist value for every new CustomObjectA record. The field definition you apply using the metadata API will overwrite the allowed values, so you should probably read in the existing picklist values first so they aren't lost every time a new CustomObjectA record is created. You should also consider duplicate values, and (if your use case requires it) removing picklist values when CustomObjectA records are deleted.

Hello David,
Can we connect by email? Here is my email<EMAIL_ADDRESS>Thank you.

Hi, I'd prefer to keep discussions relating to these repos in public. That way, other wise people can weigh in with advice, and the discussion remains as a resource for other people who have similar problems.
Using the Metadata API seems a good fit for your use case, so I'd start by making sure the examples in MetadataServiceExamples all work for you. This will rule out any issues about whether or you've deployed the code successfully, whether you have the right permissions in your org and whether you've set up remote site settings correctly.

You are right David. This discussion may help people having the same kind of issue. Here is my code
**_public class MyTestingUpdatePicklist {
public class MetadataServiceExamplesException extends Exception { }
public static MetadataService.MetadataPort createService()
{
    MetadataService.MetadataPort service = new MetadataService.MetadataPort();
    service.SessionHeader = new MetadataService.SessionHeader_element();
    service.SessionHeader.sessionId = UserInfo.getSessionId();
    return service;
}

public static void handleSaveResults(MetadataService.SaveResult saveResult)
{
    // Nothing to see?
    if(saveResult==null || saveResult.success)
        return;
    // Construct error message and throw an exception
    if(saveResult.errors!=null)
    {
        List<String> messages = new List<String>();
        messages.add(
            (saveResult.errors.size()==1 ? 'Error ' : 'Errors ') +
                'occured processing component ' + saveResult.fullName + '.');
        for(MetadataService.Error error : saveResult.errors)
            messages.add(
                error.message + ' (' + error.statusCode + ').' +
                ( error.fields!=null && error.fields.size()>0 ?
                    ' Fields ' + String.join(error.fields, ',') + '.' : '' ) );
        if(messages.size()>0)
            throw new MetadataServiceExamplesException(String.join(messages, ' '));
    }
    if(!saveResult.success)
        throw new MetadataServiceExamplesException('Request failed with no specified error.');
}

 public static void updatePicklistField()
{
    MetadataService.MetadataPort service = MetadataServiceExamples.createService();
    MetadataService.CustomField cs = new MetadataService.CustomField();
    cs.fullName = 'Opportunity.test__c';
    cs.label = 'test';
    cs.type_x = 'Picklist';
    metadataservice.Picklist pt = new metadataservice.Picklist();
    pt.sorted= false;
    metadataservice.PicklistValue abc = new metadataservice.PicklistValue();
    abc.fullName= 'abc';
    abc.default_x=false ;
    metadataservice.PicklistValue xyz = new metadataservice.PicklistValue();
    xyz.fullName= 'xyz';
    eyeone.default_x=false ;
    pt.picklistValues = new list<metadataservice.PicklistValue>{abc,xyz};
    cs.picklist = pt ;
  List<MetadataService.SaveResult> results = service.updateMetadata( new MetadataService.Metadata[] { cs });
  handleSaveResults(results[0]);
  // handleSaveResults( service.updateMetadata(
 //   new MetadataService.Metadata[] { customField })[0]);
//SaveResult[]  results = metadataConnection.updateMetadata(Metadata[] customField);

//  SaveResult[] results = metadataConnection.updateMetadata(newMetadata[] {cs});
}
_**}
Thank you for your help.

Hi again,
The code looks fine, apart from that stray reference to eyeone.default_x=false ; - I changed eyeone to xyz and updated the field successfully in my org through Execute Anonymous.
You'll need to give me a bit more to go on. What's actually going wrong when you run the code?
Are you getting System.CalloutException: IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://eu6.salesforce.com/services/Soap/m/35.0?
If so, then you need to add the remote site setting.
Are you getting Error occured processing component Opportunity.test__c. In field: fullName - no CustomField named Opportunity.test__c found (INVALID_CROSS_REFERENCE_KEY).?
If so, then the field you're trying to update doesn't exist. You may need to qualify the field or object with namespace prefix if appropriate. Perhaps it is case sensitive - try matching the field name exactly.
Are you getting something else entirely? If so, what is the behaviour?

Thank you David.
I don't get any error but the values have not been added to the picklist.
Can you share the part of the code you are executing in Execute Anonymous? Or did you create a trigger that run the class? If that's the case, can you share your trigger?
Again, thank you so much for your time and help.

Sure. My class looks like this:
public class MyClass
{
    public static void doStuff()
    {
        MetadataService.MetadataPort service = MetadataServiceExamples.createService();

        MetadataService.CustomField cs = new MetadataService.CustomField();
        cs.fullName = 'Opportunity.test__c';
        cs.label = 'test';
        cs.type_x = 'Picklist';

        Metadataservice.Picklist pt = new Metadataservice.Picklist();
        pt.sorted= false;

        Metadataservice.PicklistValue abc = new Metadataservice.PicklistValue();
        abc.fullName= 'abc';
        abc.default_x=false ;

        Metadataservice.PicklistValue xyz = new Metadataservice.PicklistValue();
        xyz.fullName= 'xyz';
        xyz.default_x=false ;

        pt.picklistValues = new list<Metadataservice.PicklistValue>{abc,xyz};
        cs.picklist = pt ;

        //For brevity, don't bother checking results
        service.updateMetadata( new MetadataService.Metadata[] { cs });
    }
}

And I call MyClass.doStuff() in execute anonymous.

Thank you David for your support. You can close the case.

Sorry guys to post again when it's already closed but I have an urgent question.
I was able to add values but they overwrite the existing values of the picklist. I just noticed that David was referencing this in a previous comment: " Also, your use case says you want to add a picklist value for every new CustomObjectA record. The field definition you apply using the metadata API will overwrite the allowed values, so you should probably read in the existing picklist values first so they aren't lost every time a new CustomObjectA record is created. You should also consider duplicate values, and (if your use case requires it) removing picklist values when CustomObjectA records are deleted.".
David, can you please provide a piece of code to read the existing values and avoid their deletion when a new value is added?
Thank you again for the good work.

I finally fixed the issue and I decided to share the solutions for people to see how to add values to picklist field. Thank you David and Andy for the work.
`
public class MyNewTestClass {
public static MetadataService.MetadataPort createService()
{
MetadataService.MetadataPort service = new MetadataService.MetadataPort();
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();
return service;
}
public class MetadataServiceExamplesException extends Exception { }
public static void handleSaveResults(MetadataService.SaveResult saveResult)
{
// Nothing to see?
if(saveResult==null || saveResult.success)
return;
// Construct error message and throw an exception
if(saveResult.errors!=null)
{
List messages = new List();
messages.add(
(saveResult.errors.size()==1 ? 'Error ' : 'Errors ') +
'occured processing component ' + saveResult.fullName + '.');
for(MetadataService.Error error : saveResult.errors)
messages.add(
error.message + ' (' + error.statusCode + ').' +
( error.fields!=null && error.fields.size()>0 ?
' Fields ' + String.join(error.fields, ',') + '.' : '' ) );
if(messages.size()>0)
throw new MetadataServiceExamplesException(String.join(messages, ' '));
}
if(!saveResult.success)
throw new MetadataServiceExamplesException('Request failed with no specified error.');
}
 public static void updatePicklist()
{
    MetadataService.MetadataPort service = createService();

    // Read Custom Field
    MetadataService.CustomField customField =
        (MetadataService.CustomField) service.readMetadata('CustomField',
            new String[] { 'Opportunity.test__c' }).getRecords()[0];

    // Add pick list values
    metadataservice.PicklistValue two = new metadataservice.PicklistValue();
    two.fullName= 'second';
    two.default_x=false;
    metadataservice.PicklistValue three = new metadataservice.PicklistValue();
    three.fullName= 'third';
    three.default_x=false;
    customField.picklist.picklistValues.add(two);
    customField.picklist.picklistValues.add(three);

    // Update Custom Field
    handleSaveResults(
        service.updateMetadata(
            new MetadataService.Metadata[] { customField })[0]);
}

}
`

Thanks for this contribution, are we ok to close this issue now?

Sorry the trigger is not working b cause the an error. I will put the code later.
Thank you.

Any help on this issue?

What context are you running the UpdateTestPicklist method in? Are you in Batch / Async Apex? Lighting Experience? Or some other?

I'm in standard salesforce environment Async Apex. Not Lightning.

In Async Apex, UserInfo.getSessionId(); returns null, you need to call this from the calling code and pass it in as an argument to your method.

Thank you Andrew for your help. I will try it and let you know.
Thanks again.

Hello Andrew and David. Thank you for your help.
Finally I abandoned this solution and create a custom object with custom lookup fields to the opportunity. After that, I run a report to the opportunity and the custom fields. From there, I used Vlookup to match the custom fields to their corresponding picklist records in the opportunity. The next step was to use Dataloader to update the opportunities with the new custom lookup fields IDs. Now I used Eclipse the Force IDE to search and replace the old picklist name with the new lookup fields names. I applied that in the reports and workflows. The last step was to update manually the validation rules and replace the old picklist fields by the new lookup fields in the opportunity page layouts.
THANK YOU SO MUCH FOR YOUR HELP.

@md6759 thanks for the follow up, the key thing is you found a solution and thats the main thing! 👍

Hi @harshad22dani, please can you raise this as a new issue rather than a comment on a closed issue?

As a quick note, the following code compiles for me (although obviously results in a Null Pointer Exception).
MetadataService.MetadataPort service = null;
MetadataService.CustomObject customObject = new MetadataService.CustomObject();
service.createMetadata(new MetadataService.Metadata[] { customObject });

Hello David/Andrew
I am trying to create new Picklist field value with the same code above but it's not updating.
I tried with new value, valueSet , ValueDefination process as we are using latest 42 API version where Picklist is deprecated.
public class MetadataServiceDemoPicklist {
public static String SOAP_M_URI = 'http://soap.sforce.com/2006/04/metadata';

public static MetadataService.MetadataPort createService()
{
    MetadataService.MetadataPort service = new MetadataService.MetadataPort();
    service.SessionHeader = new MetadataService.SessionHeader_element();
    service.SessionHeader.sessionId = UserInfo.getSessionId();
    return service;
}

public static void createPicklistField()
{

    MetadataService.MetadataPort service = createService();
    MetadataService.CustomField customField = new MetadataService.CustomField();
    List<MetadataService.CustomField> customfields = new List<MetadataService.CustomField>();

    //newly added
    customField = new MetadataService.CustomField();
    customField.fullName = 'Account.Test_Picklist__c';
    customField.label = 'Segment';
    customField.type_x = 'Picklist';
    customField.description = '';

    //Create the valueSet for picklist type
    MetadataService.ValueSet picklistValueSet = new MetadataService.ValueSet();  //ValueSet

    //For each ValueSet, we have either ValueSetValuesDefinition or ValueSettings and some other
    attributes
    MetadataService.ValueSetValuesDefinition valueDefinition = new
    MetadataService.ValueSetValuesDefinition();  //ValueSetDefination

    List<MetadataService.CustomValue> values = new List<MetadataService.CustomValue>();

    //Value 1
    MetadataService.CustomValue customValue1 = new MetadataService.CustomValue();
    customValue1.fullName = 'Testing Metadata value 1'; //API name of picklist value
    // customValue1.default = false;
    customValue1.description = '';
    customValue1.isActive = true;
    customValue1.label = 'Testing Metadata value 1';
    system.debug('customValue1' + customValue1);
    values.add(customValue1);
    //Value 2
    MetadataService.CustomValue customValue2 = new MetadataService.CustomValue();
    customValue2.fullName = 'Testing Metadata value 2'; //API name of picklist value
    // customValue1.default = false;
    customValue2.description = '';
    customValue2.isActive = true;
    customValue2.label = 'Testing Metadata value 2';
    system.debug('customValue2' + customValue2);
    values.add(customValue2);

    system.debug('values' + values);

    //It will be list of CustomValue
    valueDefinition.value = values;
    valueDefinition.sorted = true;

    //set the valueSetDefinition
    picklistValueSet.valueSetDefinition = valueDefinition;

    //Set the valueSet for picklist type
    customField.valueSet = picklistValueSet;
    system.debug('customField' + customField);
    customFields.add(customField);

    List<MetadataService.SaveResult> results =
        service.createMetadata( new MetadataService.Metadata[] { customField });
    System.debug('results' + results);
    handleSaveResults(results[0]);

}

    public MetadataService.SaveResult[] createMetadata(MetadataService.Metadata[] metadata) {
        MetadataService.createMetadata_element request_x = new
        MetadataService.createMetadata_element();
        request_x.metadata = metadata;
        MetadataService.createMetadataResponse_element response_x;
        Map<String, MetadataService.createMetadataResponse_element> response_map_x = new
        Map<String, MetadataService.createMetadataResponse_element>();
        response_map_x.put('response_x', response_x);
        system.debug('response_map_x' + response_map_x);
        WebServiceCallout.invoke(
            this,
            request_x,
            response_map_x,
            new String[]{endpoint_x,
                '',
                SOAP_M_URI,
                'createMetadata',
                SOAP_M_URI,
                'createMetadataResponse',
                'MetadataService.createMetadataResponse_element'}
        );
        response_x = response_map_x.get('response_x');
        system.debug('Create MetaData Service Response response_x' + response_x);
        return response_x.result;
    }

   //Exceptions
public class MetadataServiceExamplesException extends Exception { }

public static void handleSaveResults(MetadataService.SaveResult saveResult)
{
    // Nothing to see?
    if(saveResult==null || saveResult.success)
        return;
    // Construct error message and throw an exception
    if(saveResult.errors!=null)
    {
        List<String> messages = new List<String>();
        messages.add(
            (saveResult.errors.size()==1 ? 'Error ' : 'Errors ') +
            'occured processing component ' + saveResult.fullName + '.');
        for(MetadataService.Error error : saveResult.errors)
            messages.add(
                error.message + ' (' + error.statusCode + ').' +
                ( error.fields!=null && error.fields.size()>0 ?
                 ' Fields ' + String.join(error.fields, ',') + '.' : '' ) );
        if(messages.size()>0)
            throw new MetadataServiceExamplesException(String.join(messages, ' '));
    }
    if(!saveResult.success)
        throw new MetadataServiceExamplesException('Request failed with no specified error.');
}

}
below is my code can anyone help me where I am wrong or what I am doing wrong ??

I am having the same issue. I need to add new values to picklist field in apex. I am getting issues like variable doesn't exist: Service and Method does not exist or incorrect signature: handleSaveResults(MetadataService.SaveResult). Can anyone help me regarding this? I am even not getting the updated MetadataService.cls somewhere.


MM-31740 Gif picker empty when no results are displayed

Summary
Fixed the problem that caused no result indicator to not be displayed.
Ticket Link
Fixes https://github.com/mattermost/mattermost-server/issues/16682
Screenshots
Used to look like this:

Now it looks like this:

Hello @berkeka,
Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Thanks for the PR @berkeka. Heads up that there are some linter errors:
/root/mattermost/mattermost-webapp/components/gif_picker/components/SearchGrid/SearchGrid.jsx
  162:13  error  'onCategories' is assigned a value but never used         no-unused-vars
  224:1   error  Expected indentation of 16 spaces but found 20            indent
  224:21  error  Expected indentation of 16 space characters but found 20  react/jsx-indent-props
  225:1   error  Expected indentation of 16 spaces but found 20            indent
  225:21  error  Expected indentation of 16 space characters but found 20  react/jsx-indent-props

Thanks for the PR @berkeka. Heads up that there are some linter errors:
/root/mattermost/mattermost-webapp/components/gif_picker/components/SearchGrid/SearchGrid.jsx
  162:13  error  'onCategories' is assigned a value but never used         no-unused-vars
  224:1   error  Expected indentation of 16 spaces but found 20            indent
  224:21  error  Expected indentation of 16 space characters but found 20  react/jsx-indent-props
  225:1   error  Expected indentation of 16 spaces but found 20            indent
  225:21  error  Expected indentation of 16 space characters but found 20  react/jsx-indent-props

Yeah, forgot about running checks on local. Will push the changes now if it wont cause problems for the test server?

@berkeka Just push your changes. The test server will update itself then.

/update-branch

Will try to auto merge this PR once all tests and checks are passing. This might take up to an hour.

Trying to auto merge this PR.

Pull Request successfully merged
SHA: a5b2f799aba060d88c9458c7b03ecbe127898fb5


bump hoon root to %k.138

Not sure if there was a particular reason this hadn't been updated, or if nobody had gotten around to doing it yet.
I've confirmed that Nockchain runs fine with this. However, test_sivb_en fails. It currently passes on the status branch.
test jets::lock::aes::tests::test_siva_de ... ok
test jets::lock::aes::tests::test_siva_en ... ok
test jets::lock::aes::tests::test_sivb_de ... ok
memory allocation of test jets::lock::aes::tests::test_sivb_en ... 24ok bytes failed

I spent a few minutes looking into this but nothing popped out at me.

Hmmm, the test passed on CI. I wonder what's causing it to fail on my machine?

Rather than mutating, this should be copied, or perhaps we should write a const function that takes the kelvin root.


SpringContainer.getContext() 在服务刚暴露时，服务内部获取到的可能是null值

SpringContainer.getContext() 在服务刚暴露时，服务内部获取到的可能是null值

Please resolve the UT failure first. Generally we do not recommend sending pull request to 2.5.x branch, because I think it is close to End of life unless critical bug are found. (The community will discuss this.)

Thanks. But I think this one is more reasonable https://github.com/apache/incubator-dubbo/pull/3600


Consolidate continue files into one directory

Validations

[X] I believe this is a way to improve. I'll try to join the Continue Discord for questions
[X] I'm not able to find an open issue that requests the same enhancement

Problem
All continue files should be consolidated into ./.continue
Previously prompts were held in ./.prompts but now prompt files are in ./.continue/prompts for prompts v2
https://docs.continue.dev/customize/deep-dives/prompt-files
This is fine, however the .continuerules file needs to be in root
https://docs.continue.dev/customize/deep-dives/rules
Which is now spreading continue files throughout the project in an illogical scheme.
Solution
I propose all continue files such as .prompts and .continuerules files exist in ./.continue

@joewinke I appreciate the feedback on this
We believe that above all else it is necessary to make using .continueignore and .continuerules easy to use, and nesting them inside of a folder would harm that. Since these are probably where 90% of users stop, we're optimizing for that
While we could optionally allow them to exist in .continue, this optionality would create potential for confusion
Seeing as we're likely to revisit all of these files in the near future, which will force another pass on their organization, I'm going to close this issue for now


Clarify that LIMIT returns non-deterministic order unless ORDER BY clause is used

Raphael 'kena' Poss (knz) commented:
From https://github.com/cockroachdb/cockroach/issues/21153

We have closed this issue because it is more than 3 years
old. If this issue is still relevant, please add a comment and reopen
the issue. Thank you for your contribution to CockroachDB docs!


Properly handle columns with mixed numeric and categorical values

You might want to handle them as categorical or define parameter to solve the following problem:
  File "/home/user/.local/lib/python3.5/site-packages/pandas_profiling/__init__.py", line 17, in __init__
    description_set = describe(df, **kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/pandas_profiling/base.py", line 308, in describe
    confusion_matrix=pd.crosstab(data1,data2)
  File "/home/user/.local/lib/python3.5/site-packages/pandas-0.20.3-py3.5-linux-x86_64.egg/pandas/core/reshape/pivot.py", line 493, in crosstab
    aggfunc=len, margins=margins, dropna=dropna)
  File "/home/user/.local/lib/python3.5/site-packages/pandas-0.20.3-py3.5-linux-x86_64.egg/pandas/core/reshape/pivot.py", line 160, in pivot_table
    table = table.sort_index(axis=1)
  File "/home/user/.local/lib/python3.5/site-packages/pandas-0.20.3-py3.5-linux-x86_64.egg/pandas/core/frame.py", line 3243, in sort_index
    labels = labels._sort_levels_monotonic()
  File "/home/user/.local/lib/python3.5/site-packages/pandas-0.20.3-py3.5-linux-x86_64.egg/pandas/core/indexes/multi.py", line 1241, in _sort_levels_monotonic
    indexer = lev.argsort()
  File "/home/user/.local/lib/python3.5/site-packages/pandas-0.20.3-py3.5-linux-x86_64.egg/pandas/core/indexes/base.py", line 2091, in argsort
    return result.argsort(*args, **kwargs)
TypeError: unorderable types: str() < int()

Please could you provide an example permitting to reproduce the case?
Note: Since #43, it is possible to call the report with the option check_correlation=False to skip this phase. In your case, it will avoid the error since it appears during the correlation computing.

Example data: ex.txt
More observations - if I reduce the size of the example to ~1000 points, including the problematic records, the problem does not happen.
Another strange thing, enabling check_correlation=False throws an error
>>> pfr = pandas_profiling.ProfileReport(subset,check_correlation=False)
.....
TypeError: _plot_histogram() got an unexpected keyword argument 'check_correlation'