Unable to use existing bucket object from aws_s3.Bucket.from_bucket_name

fails to create stack
Reproduction Steps
    exiting_bucket = s3.Bucket.from_bucket_name(self, 'existing_bucket', bucket_name="existing_bucket")

    s3tolambda = S3ToLambda(self, 'test_s3_lambda',
                        lambda_function_props=_lambda.FunctionProps(
                            code=_lambda.Code.from_asset('_lambda'),
                            runtime=_lambda.Runtime.PYTHON_3_9,
                            handler='index.handler'
                            ),
                        existing_bucket_obj=existing_bucket)

Error Log

TypeError: type of argument existing_bucket_obj must be one of (aws_cdk.aws_s3.Bucket, NoneType); got aws_cdk.aws_s3._BucketBaseProxy instead
Environment

**CDK CLI Version      : 2.73.0 (build 43e681e)
**CDK Framework Version:   aws-cdk-lb 2.76.0
**AWS Solutions Constructs Version     : 2.39.0
**OS                   :Windows
**Language             :python

Other

I think this is a documentation error, and error message is misleading.  exsting_bucket_object appears to want the L1 construct.
existing_bucket_obj=raw_bucket.node.default_child   resolves issue
More elegantly would be for the CDK to accept an IBucket in the constructor.
I can make the first change if desired, the second is beyond my abilities.

This is :bug: Bug Report

Even with the modification, the stack still creates a new bucket, and triggers events off the new bucket. Existing bucket object not used.

The existing_bucket_obj prop is a Bucket Class, s3.Bucket.from_bucket_name returns an interface, IBucket. The external bucket is outside the stack, so CDK has much less ability to modify it - the IBucket interface reflects these lesser capabilities.
We set up the event source using the CDK S3EventSource class, which requires a Bucket as input (not an IBucket). So this construct cannot work with an IBucket obtained from from_bucket_name().

Is there a different way to get the bucket from an existing bucket?

There's 2 static methods on Bucket that can get a bucket - by arn and by bucket name - but both return an IBucket. I believe the constraint is that CloudFormation cannot alter a bucket outside of the current stack, and not a CDK limitation, although I can't locate documentation explicitly stating this.

If you drop that, it will create a new S3 bucket - which will be functional if it still supports your use case. Constructs will by default create the bucket encrypted, access logging enabled, versioning enabled and with a lifecycle policy that moves objects to Glacier after 30(I think) days. Those are all best practices, but you can override then with the bucketProperties prop.

I meant remove from the pattern, not my instance of it.  Since the
functionality does not work.
Mike
On Sat, May 20, 2023 at 2:59 PM biffgaut @.***> wrote:

If you drop that, it will create a new S3 bucket - which will be
functional if it still supports your use case. Constructs will by default
create the bucket encrypted, access logging enabled, versioning enabled and
with a lifecycle policy that moves objects to Glacier after 30(I think)
days. Those are all best practices, but you can override then with the
bucketProperties prop.
—
Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-solutions-constructs/issues/958#issuecomment-1555972493,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABMSCSUL3R4FU3DVKTONB2LXHEH7ZANCNFSM6AAAAAAXM5VLDA
.
You are receiving this because you authored the thread.Message ID:
@.***>

It works if you provide a Bucket object created elsewhere in the same stack. For instance, the following code sets up a Lambda Function that is triggered by events in a bucket created in a separate Construct:
const dataIntake = new LambdaToS3(this, 'LambdaToS3Pattern', {
    lambdaFunctionProps: {
        runtime: lambda.Runtime.NODEJS_14_X,
        handler: 'index.handler',
        code: lambda.Code.fromAsset(`lambda`)
    }
});

new S3ToLambda(this, 'test-s3-lambda', {
  lambdaFunctionProps: {
    code: lambda.Code.fromAsset(`lambda`),
    runtime: lambda.Runtime.NODEJS_14_X,
    handler: 'index.handler'
  },
  existingBucket = dataIntake. s3Bucket
});

Linking together multiple constructs is the primary purpose of the existingObject prop values.

Got it, thanks.
On Mon, May 22, 2023, 12:53 PM biffgaut @.***> wrote:

It works if you provide a Bucket object created elsewhere in the same
stack. For instance, the following code sets up a Lambda Function that is
triggered by events in a bucket created in a separate Construct:
const dataIntake = new LambdaToS3(this, 'LambdaToS3Pattern', {
lambdaFunctionProps: {
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(lambda)
}
});
new S3ToLambda(this, 'test-s3-lambda', {
lambdaFunctionProps: {
code: lambda.Code.fromAsset(lambda),
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler'
},
existingBucket = dataIntake. s3Bucket
});
Linking together multiple constructs is the primary purpose of the existing
Object prop values.
—
Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-solutions-constructs/issues/958#issuecomment-1557569437,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABMSCSRJHQBFWTG7WUY6LUDXHOKZRANCNFSM6AAAAAAXM5VLDA
.
You are receiving this because you authored the thread.Message ID:
@.***>

@biffgaut Do you want me to submit a PR to clarify that in the documentation?

What clarification would you add? There are many constructs that accept an object rather than an interface for existing resources.

If this is S3 specific that  an existing_bucket_object has to be defined in
this stack. Then there should be words to that effect here.  If in general
existing _X_object cannot access an object already deployed in an account I
don't know where that should be documented.  But if I lost a couple days,
I'd like to find some words to keep the next person from having the same
problem.  But maybe this is just general Mke not reading docs closely
enough.
On Tue, Jul 11, 2023 at 4:44 PM biffgaut @.***> wrote:

What clarification would you add? There are many constructs that accept an
object rather than an interface for existing resources.
—
Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-solutions-constructs/issues/958#issuecomment-1631484609,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABMSCSQ6HG4UOOKBXQ2GFHTXPW3LFANCNFSM6AAAAAAXM5VLDA
.
You are receiving this because you authored the thread.Message ID:
@.***>

It's a general CDK/CloudFormation trait - CloudFormation can't update resources outside it's stack. Because of this, CDK getExistingResourceByAttribute calls all return an Interface rather than an Object. At one point we started more clearly delineating one from the other by accepting existingObj or existingInterface props - but constructs created before we adopted this naming pattern aren't consistent.


fix: Incorrect receipt on confirmation page when expenses have different receipt

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/47774
PROPOSAL: https://github.com/Expensify/App/issues/47774#issuecomment-2301623334
Tests

Go to workspace chat.
Submit two same expenses (same amount and merchant) but with different receipts.
Go to transaction thread of the second expense.
Click Review duplicates.
Click Keep this one on the first expense.
Proceed to confirmation page.
Verify that: The confirmation page will show the receipt of the first expense because the first expense is selected in Step 5

[x] Verify that no errors appear in the JS console

Offline tests

QA Steps

Go to workspace chat.
Submit two same expenses (same amount and merchant) but with different receipts.
Go to transaction thread of the second expense.
Click Review duplicates.
Click Keep this one on the first expense.
Proceed to confirmation page.
Verify that: The confirmation page will show the receipt of the first expense because the first expense is selected in Step 5

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[x] I verified that all the inputs inside a form are aligned with each other.
[x] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
https://github.com/user-attachments/assets/750722ab-026c-4cff-934c-7f0a8961f334

Android: mWeb Chrome
https://github.com/user-attachments/assets/996e5070-fd94-4213-8cfd-e767908c3123

iOS: Native
https://github.com/user-attachments/assets/3d3f9809-8e37-4c04-947e-ec94f52aef01

iOS: mWeb Safari
https://github.com/user-attachments/assets/f9e62554-70ad-45a0-876e-b11ffe10baff

MacOS: Chrome / Safari

https://github.com/user-attachments/assets/b9bcdebb-9cc1-4f76-b774-ccaa273be090

MacOS: Desktop

https://github.com/user-attachments/assets/e771e107-9e8e-488b-a6bf-2b2e1c93f035

@shubham1206agra friendly bump

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


Using @field_validator there is an TypeError: no_info_before_validator_function() got an unexpected keyword argument 'json_schema_input_schema'

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
Hello!
I've updated my pydantic version to 2.10.4, and now, when I use @field_validator within some BaseModel / BaseSettings derived class, the following error is raised upon this class initialization:
Traceback (most recent call last):
  File "/Users/me/Projects/my_project/src/settings.py", line 36, in <module>
    class MyModel(BaseModel):
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 226, in __new__
    complete_model_class(
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 658, in complete_model_class
    schema = cls.__get_pydantic_core_schema__(cls, handler)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/main.py", line 702, in __get_pydantic_core_schema__
    return handler(source)
           ^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in __call__
    schema = self._handler(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 610, in generate_schema
    schema = self._generate_schema_inner(obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 879, in _generate_schema_inner
    return self._model_schema(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 691, in _model_schema
    {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 691, in <dictcomp>
    {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1071, in _generate_md_field_schema
    common_field = self._common_field_schema(name, field_info, decorators)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1263, in _common_field_schema
    schema = self._apply_annotations(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2056, in _apply_annotations
    schema = get_inner_schema(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in __call__
    schema = self._handler(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2131, in new_handler
    schema = metadata_get_schema(source, get_inner_schema)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic/functional_validators.py", line 142, in __get_pydantic_core_schema__
    return core_schema.no_info_before_validator_function(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: no_info_before_validator_function() got an unexpected keyword argument 'json_schema_input_schema'

Example Code
from pydantic import BaseModel, Field, field_validator

class MyModel(BaseModel):
    name: str = Field(default="John")

    @field_validator("name", mode="before")
    @classmethod
    def validate_name(cls, value: str) -> str:
        if not value:
            raise ValueError("name cannot be empty")
        return value

Python, Pydantic & OS Version
pydantic version: 2.10.4
pydantic-core version: 2.27.1
pydantic-core build: profile=release pgo=false
install path: /Users/me/Projects/my_project/.venv/lib/python3.11/site-packages/pydantic
python version: 3.11.8 (main, Mar 18 2024, 20:12:26) [Clang 15.0.0 (clang-15<IP_ADDRESS>.5)]
platform: macOS-14.5-arm64-arm-64bit
related packages: fastapi-0.115.6 pydantic-settings-2.7.0 mypy-1.12.0 typing_extensions-4.12.2
commit: unknown

You need to upgrade pydantic-core as well. Note that you may have to check how you upgraded pydantic, as your installer should have taken the constraint into consideration:
https://github.com/pydantic/pydantic/blob/74857250382126c2e50166d64c1ef1d3af8ca8ef/pyproject.toml#L49

For me this issue was fixed by updating my version of pkginfo to 1.12.0. It looks like with older versions, it wasn't properly resolving Pydantic's dependencies (I'm using Poetry), leaving out pydantic-core

@ARawles Hi! I'm using Poetry too, after applying your suggestion (I've updated internal poetry's pkginfo to 1.12.0), I've re-built my local venv and, after that, I see that there is no pydantic-core installed at all.
Does this mean that, from now, pydantic-core dependency is required to be specified separatelly from the pydantic itself?
(I have poetry version 1.8.5)

Hmm that's odd - looking at the current pyproject.toml for Pydantic, I can see the pydantic-core specification, meaning it looks like it should still be a dependency that Poetry picks up.
One other thing to try would be to delete the Poetry cache with something like rm -r ~/.cache/pypoetry/cache and then running poetry debug resolve pydantic. Hopefully then you should see pydantic-core being listed amonst the dependencies.


The aws-apigateway-iot construct does not work as expected due to SSL error between AWS services

Deploying the aws-apigateway-iot solutions construct pattern doesn't work because the API Gateway cannot communicate with the IoT Data endpoint due to an SSL error.
Reproduction Steps

Deploy the aws-apigateway-iot pattern to AWS (I deployed to eu-central-1 but I've tried a few regions and they all seem to behave the same).
Try calling the API endpoint and post a message to the topic through the API Gateway "test" UI.
Observe the error that occurs and is displayed in the response (see error log below):
Error Log

[...]
Fri Oct 14 13:11:24 UTC 2022 : Sending request to https://************.iot.eu-central-1.amazonaws.com/topics/foo
Fri Oct 14 13:11:24 UTC 2022 : Execution failed due to configuration error: TLS Server certificate issued after 2019-04-16 and anchored by a distrusted legacy Symantec root CA: CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
Fri Oct 14 13:11:24 UTC 2022 : Method completed with status: 500

Environment

CDK CLI Version      : 2.45.0 (build af1fb7c)
CDK Framework Version: 2.45.0
AWS Solutions Constructs Version     : 10.0.0
OS                   : Mac
Language             : Python

Other

I also did some experiments from my dev machine to verify that the certificate used by the IoT Endpoint was strange:
❯ IOT_ENDPOINT=$(aws iot describe-endpoint | jq -r '.endpointAddress') && echo $IOT_ENDPOINT
a21qilfetw3vhh.iot.eu-central-1.amazonaws.com

❯ curl https://$IOT_ENDPOINT/topics/foo -vvI
*   Trying <IP_ADDRESS>:443...
* Connected to a21qilfetw3vhh.iot.eu-central-1.amazonaws.com (<IP_ADDRESS>) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

This, of course, isn't really a bug with the CDK construct but it seems to result in the example provided in this project not working out of the box. If any workaround is possible, I would like to know about that of course.
So I would think that one of two things needs to happen here:

Remove the aws-apigateway-iot construct as it does not behave as advertised.
Document that this is a shortcoming of the construct (not really a solution unless some workaround exists and is documented along with it).

This is :bug: Bug Report

Thanks, we'll take a look

A colleague of mine pointed me towards testssl.sh which I ran against our IoT endpoint.
I'm attaching the results of that run but the short version is that the chain of trust is incomplete in Linux and Mozilla but okay in Microsoft, Java and Apple.
testssl.report.txt
   Chain of trust               NOT ok: Linux (chain incomplete) Mozilla (chain incomplete)
                                OK: Microsoft Java Apple

I'm not quite sure where to report this to AWS, so can you either do that for me or point me in the right direction?

@biffgaut you can disregard this report (although documentation could possibly be improved slightly).
Our TAM team pointed out that the IoT endpoints come in two varieties. The "plain" one is the one that the aws iot describe-endpoint returns to you and has the broken SSL certificate chain. However, there is another one which has -ats appended to the first part of the FQDN of the IoT endpoint.
This lead me to this blog post explaining where the ATS comes from.
So all I needed to do was to make sure that I added the -ats suffix and things started working.
The aws-apigateway-iot solutions construct pattern uses the ATS version of the endpoint but there is no documentation explaining what that is. I just thought that in the example used, -ats was a part of the regular endpoint hostname and didn't give it another thought and just used what aws iot describe-endpoint reported to me. Turns out that you have to append -ats to that hostname for it to have a proper cert chain that works with apigateway.

Reopening to review the docs.

I created a PR if it helps. Maybe you want to fix the wording though.


Add API for manipulating Git hooks

❗ Depends on https://github.com/go-gitea/go-sdk/pull/156 (merged)
❗ Depends on https://github.com/go-gitea/git/pull/151 (merged)
(~Dep~go.mod must be updated when those are merged as I made it point to our fork for this to build)
This adds API for manipulating Git hooks which are only accessible via a web form ATM.

Refreshed the PR with changes from master. The added replace directive in go.mod needs to be removed once the SDK PR is merged and the version of the SDK updated in the require directive.

@segevfiner I've just merged the SDK code. You can now update this PR with appropriate changes :)

This looks great! Thanks for PR 😄 Could you add some tests (ensure that githooks update after change, simple fetch of githooks return expected content, error when user who doesn't have access to githooks tries to access)?

Codecov Report

Merging #6436 into master will decrease coverage by 0.11%.
The diff coverage is 6.17%.

@@            Coverage Diff             @@
##           master    #6436      +/-   ##
==========================================
- Coverage   40.54%   40.42%   -0.12%
==========================================
  Files         406      407       +1
  Lines       54501    54675     +174
==========================================
+ Hits        22095    22101       +6
- Misses      29370    29537     +167
- Partials     3036     3037       +1

Impacted Files
Coverage Δ

routers/api/v1/convert/convert.go
78.02% <0%> (-2.66%)
:arrow_down:

routers/api/v1/repo/git_hook.go
0% <0%> (ø)

modules/context/api.go
50.61% <50%> (ø)
:arrow_up:

routers/api/v1/api.go
72.14% <66.66%> (-0.27%)
:arrow_down:

models/repo_list.go
66.84% <0%> (-1.06%)
: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 8d01b98...e382b50. Read the comment docs.

This looks great! Thanks for PR 😄 Could you add some tests (ensure that githooks update after change, simple fetch of githooks return expected content, error when user who doesn't have access to githooks tries to access)?

I want to add a Git hook to one of the fixture repos to test list/get, but to which one of the fixture repos should I add it too?

Looking at recent PR you can re-use the same repo (or add another similar) introduce in #6479
The test part : https://github.com/go-gitea/gitea/pull/6479/files#diff-b3cdbf4d78c522550fce21298c72c321

I added a bunch of tests.


Use MjSpec on document with plugin & replicate leads to segfault in Mujoco 3.2.4

Intro
Hi!
I am a graduate student at HKU, I use MuJoCo for my research on robotic manipulation.
My setup
Mujoco 3.2.4, C or Python (Mujoco 3.2.3 is not affected)
What's happening? What did you expect?
Use MjSpec on document with plugin & replicate leads to segfault in Mujoco 3.2.4
Backtrace
#0  0x00007ffff6a98572 in mjXWriter::Extension (this=0x7fffffffc610, root=0x55555706e220) at mujoco/src/xml/xml_native_writer.cc:1371
#1  0x00007ffff6a8e3ea in mjXWriter::Write[abi:cxx11](char*, unsigned long) (this=0x7fffffffc610, error=0x0, error_sz=0) at mujoco/src/xml/xml_native_writer.cc:895
#2  0x00007ffff6a5f4a4 in WriteXML[abi:cxx11](mjSpec_ const*, char*, int) (spec=0x555556d20ea8, error=0x0, nerror=0) at mujoco/src/xml/xml.cc:411
#3  0x00007ffff6a5b95d in mj_saveXMLString (s=0x555556d20ea8, xml=0x0, xml_sz=0, error=0x0, error_sz=0) at mujoco/src/xml/xml_api.cc:248

Code
  for (const auto& [plugin, slot] : model->ActivePlugins()) {
    if (seen_plugins.find(plugin) == seen_plugins.end()) {
      plugin_elem = InsertEnd(section, "plugin");
      WriteAttrTxt(plugin_elem, "plugin", plugin->name);
    }
  }

Problem source backtrace
#0  mjCModel::operator+= (this=0x555556d206c0, other=...) at mujoco/src/user/user_model.cc:400
#1  0x00007ffff6a01e0e in mjCBody::operator+= (this=0x555556d47f90, other=...) at mujoco/src/user/user_objects.cc:900
#2  0x00007ffff690d926 in mjs_attachFrame (parent=0x555556d48490, child=0x555556d493b8, prefix=0x7ffff6b770b4 "", suffix=0x7fffffffb7e0 "0") at mujoco/src/user/user_api.cc:157
#3  0x00007ffff6a7776f in mjXReader::Body (this=0x7fffffffc090, section=0x555556d196c0, body=0x555556d48490, frame=0x555556d48928, vfs=0x0) at mujoco/src/xml/xml_native_reader.cc:3614
#4  0x00007ffff6a775d2 in mjXReader::Body (this=0x7fffffffc090, section=0x555556d16e40, body=0x555556d1f120, frame=0x0, vfs=0x0) at mujoco/src/xml/xml_native_reader.cc:3594
#5  0x00007ffff6a62b95 in mjXReader::Parse (this=0x7fffffffc090, root=0x555556d16300, vfs=0x0) at mujoco/src/xml/xml_native_reader.cc:955

Code
  // create new plugins and map them
  CopyPlugin(plugins_, other.plugins_, bodies_);
  CopyPlugin(plugins_, other.plugins_, geoms_);
  CopyPlugin(plugins_, other.plugins_, meshes_);
  CopyPlugin(plugins_, other.plugins_, actuators_);
  CopyPlugin(plugins_, other.plugins_, sensors_);
  for (const auto& active_plugin : other.active_plugins_) {
    active_plugins_.emplace_back(active_plugin);
  }

When this and other points to the same model, copying other.active_plugins_ into this->active_plugins_ makes the active_plugins_ size grow exponentially (in fact, inserting while iterating the same vector is already very close to buggy code, but STL seems to realloc successfully for smaller reallocations, so small replication count does not break code.)
Besides, many other copies in this function might be vulnerable to such cases as well, but I do not fully understand the intention of mjs_attachFrame add-assigning the full model, so no further comment.
Steps for reproduction
Run the snippet below. Process segfaults at spec.to_xml.
Minimal model for reproduction
(Embedded in code)
Code required for reproduction
import mujoco
spec = mujoco.MjSpec.from_string("""
<mujoco>
    <extension>
        <plugin plugin="mujoco.sdf.torus">
            <instance name="torus" />
        </plugin>
    </extension>
    <asset>
        <mesh name="torus">
            <plugin instance="torus" />
        </mesh>
    </asset>
    <worldbody>
        <geom type="sdf" mesh="torus">
            <plugin instance="torus" />
        </geom>
        <replicate count="12">
            <body />
        </replicate>
    </worldbody>
</mujoco>
""")
spec.compile()
spec.to_xml()

Confirmations

[X] I searched the latest documentation thoroughly before posting.
[X] I searched previous Issues and Discussions, I am certain this has not been raised before.

Thanks. I solved the original issue with plugins.
I take note to add a warning for your point 1, which is a behavior I am aware of (it should work if both bodies are inside replicate, right?)
Could you provide minimal examples for 2a, 2b or 2c by opening other issues when you have time?


A minor, harmless issue

Your citation:
@misc{Ye2024,
title = {survey in DESI-LIS},
author = {Renhao Ye},
year = {2024},
url = {https://github.com/yourusername/yourrepository},  # wrong url
note = {survey in DESI, a guideline for understand DESI-LIS data and access},
Perhaps this is the correct one：
url = {https://github.com/Rh-YE/survey_in_desi},

Thanks!


[proposal] Add a new option not to transform decorators if targeting esnext

Search Terms

decorators esnext
Suggestion

// input
const decorator = (target: any) => {}

@decorator
class A {}

// expected output with targeting `esnext`
const decorator = target => {}

@decorator
class A {}

// actual output
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const decorator = (target) => { };
let A = class A {
};
A = __decorate([
    decorator
], A);

https://www.typescriptlang.org/play/index.html?experimentalDecorators=true&target=99&ssl=1&ssc=1&pln=5&pc=1#code/MYewdgzgLgBAJgU1AJwIZRMmBeGAKKVZAcwSgC4ZUwBPAShwD4YBvGAXwFgAoHgAUQp0mHsAA2qCBBgBBVhx5A
Can we add a new option to output plain esnext codes?
Use Cases

Decorator is an ESNext feature, why they are transformed even targeting esnext?
I want to compile .ts to plain .js and use babel to compile esnext features.
Examples

As above
Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

Duplicate of https://github.com/microsoft/TypeScript/issues/29299
My search terms were decorators transform

Duplicate of https://github.com/microsoft/TypeScript/issues/29299
My search terms were decorators transform

Thx for your point.


block extension installation based on the origin

The info to block installation based on the origin is missing. Namely, policy BlockExternalExtensions set to Enabled.

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

ID: cc77d006-bbf3-747e-4d7c-573e57680174
Version Independent ID: b9ed5785-c4a5-19b6-fbd7-1a3d30027f08
Content: Use group policies to manage Microsoft Edge extensions
Content Source: edgeenterprise/microsoft-edge-manage-extensions-policies.md
Product: microsoft-edge
GitHub Login: @AndreaLBarr
Microsoft Alias: aspoddar

@joegoerlich The Extension Team has reviewed your 4 GitHub issues and this should apply to all of them:
The policy "BlockExternalExtensions" applies to extension installations that happen from third party software applications and they do not have any impact on the policies that are defined in extension settings. Any policy definitions from the extension settings will always take precedence over "BlockExternalExtensions".
For further questions, you should be able to reach the Extension Team at https://github.com/microsoft/MicrosoftEdge-Extensions


check license in all new files on every pull request

Describe the bug
We need to make sure that every new file added to the project has the correct statement regarding the license
To Reproduce
Steps to reproduce the behavior:
1.
2.
3.
4.
Expected behavior
A clear and concise description of what you expected to happen.
System (please complete the following information):

OS: [e.g. RHEL8.6]
Hardware [e.g. Intel Xeon Ice Lake, 64GB, NVMe]

Additional context
Add any other context about the problem here.

already done


How to use it with flv.js

Is there a guide or something?

Hi, thanks for watching my work.
The flv.js example is shown in
https://github.com/godka/node-rtsp-live555/blob/6e84a1c310f60a95010377d0482fd97d0139d247/example/html/dist/core.js#L89

First Appreciate U r Work .  Hi Can u provide Detailed Documentation to use the Package ...??

First Appreciate U r Work . Hi Can u provide Detailed Documentation to use the Package ...??

Sorry for the long delay (really long).
We will write the docs later on.


Maybe the better way to figure time

    // some code...
    const reqTime =  process.hrtime()

    function reqFinished() {
      const resTime = process.hrtime();
      const ms = (resTime[0] - reqTime[0]) * 1e3 + (resTime[1] - reqTime[1]) * 1e-6
      // some code...
    }

    onHeaders(res, reqFinished)

Because, onFinished time was not figure, just figure req start and write HTTP headers time, so we don't need to figure time in onFinished function.
with this code, we don't need to req._startAt and res._startAt.

I'm not sure I understand. Can you elaborate? Or perhaps make a pull request to better demonstrate?

He's right.
I'm seeing weird "response" times, because it's not measuring the actual response time in some cases, like when streaming from a db.
What you are doing currently, is measure the time between the request coming in - and the response headers coming out.
But sometimes - generating the response is not an atomic operation that happens between the two.
Sometimes it's a heavy operation that you stream out incrementally. And you want to know how long did it take to finish writing out the response.
If it's a small JSON that you just write out immediately, then this won't affect the timings at all. But if it's a long streaming operation - the change will make sure that it reflects the actual time that the response took.
In my opinion this should be the default mode ("time until response finish"), possibly with an option to set  it to measure "time until response headers".

Hi @danielgindi yes, that is correct, and it's very clearly documented at the meaning of that token in the readme (https://github.com/expressjs/morgan#response-timedigits):

The time between the request coming into morgan and when the response headers are written, in milliseconds.

You're certainly welcome to make a pull request implementing the way you describe as another option as well 👍 @danielgindi

Anyway, coming back and read-reading @struCoder 's post, I understand what the purpose is now: the suggestion is to do the same thing already happening but without using the _-prefixed properties. The reason those properties are used @struCoder is so this module (and any custom token someone makes) can use them. I hope that helps!


Failed to create SampleApplication!

Briefly summarise your issue:
Starting the SampleApp and never making it to the authorisation check repeat. Instead errors, which look like ALSA audio ones, appear.
What is the expected behaviour?
No errors should occur and the terminal should keep checking authorisation until I have successfully done so.
What behaviour are you observing?
pi@raspberrypi:~/sdk-folder/sdk-build $ ./SampleApp/src/SampleApp ./Integration/AlexaClientSDKConfig.json ../third-party/alexa-rpi/models
2019-07-01 14:41:18.324 [  1] I sdkVersion: 1.13.0
configFile ./Integration/AlexaClientSDKConfig.json
#################################################
#       NOTIFICATION INDICATOR STATE: OFF       #
#################################################

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
###################################
#       DoNotDisturb is OFF       #
###################################

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2043
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2714
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
2019-07-01 14:41:19.451 [  1] C PortAudioMicrophoneWrapper:Failed to open PortAudio default stream:errorCode=-9997
2019-07-01 14:41:19.451 [  1] C PortAudioMicrophoneWrapper:Failed to initialize PortAudioMicrophoneWrapper
2019-07-01 14:41:19.452 [  1] C SampleApplication:Failed to create PortAudioMicrophoneWrapper!
2019-07-01 14:41:19.554 [  1] C SampleApplication:Failed to initialize SampleApplication
##################################
#       NOT YET AUTHORIZED       #
##################################

################################################################################################
#       To authorize, browse to: 'https://amazon.com/us/code' and enter the code: JYMSAQ       #
################################################################################################

Failed to create to SampleApplication!

Provide the steps to reproduce the issue, if applicable:
Using this guide at the respectively linked location: https://github.com/alexa/avs-device-sdk/wiki/Raspberry-Pi-Quick-Start-Guide#run-and-authorize
Running this in the console: ./SampleApp/src/SampleApp ./Integration/AlexaClientSDKConfig.json ../third-party/alexa-rpi/models
Tell us about your environment:

What version of the AVS Device SDK are you using?
  1.13.0

Tell us what hardware you're using:

[ ] Desktop / Laptop
[x] Raspberry Pi
[ ] Other - tell us more:

Tell us about your OS (Type & version):

[ ] Linux
[ ] MacOS
[x] Raspbian Stretch
[ ] Raspbian Jessy
[ ] Other - tell us more:

Hello udop1,
This sounds like a duplicate of the issue 1359.
It is not clear yet what exactly is causing the issue, but some folks have had success resolving this use by installing older versions of Raspbian.
Best regards,
-SWH

Alright, I'll attempt using an older version of Raspbian. Ill reply with any updates, or if it still doesn't work afterwards.
Thanks for the suggestion.

I've had success building on buster with the following changes:
Update some versions for buster in pi.sh:
install_dependencies() {
    sudo apt-get -y install git gcc cmake build-essential libsqlite3-dev libcurl4-openssl-dev \
      libssl1.1 libfaad-dev libsoup2.4-dev libgcrypt20 libgstreamer-plugins-bad1.0 \
      gstreamer1.0-plugins-good libasound2 sox gedit vim python3-pip
}

and in avs-device-sdk/SampleApp/src/CMakelists.txt add -latomic:
target_link_libraries(SampleApp
    DefaultClient
    CapabilitiesDelegate
    CBLAuthDelegate
    SQLiteStorage
    ESP
    EqualizerImplementations
    "${PORTAUDIO_LIB_PATH}"
    -latomic
)

I don't think I'll do a pull request with these changes because I haven't got time to do a completely clean install to test, so I encourage someone else to try it out and if it works, make the PR.

@metalivedev I tried doing what you said , but no luck . I am still facing the error . Please help .
dio default stream:errorCode=-9997
2019-07-04 08:38:23.061 [  1] C PortAudioMicrophoneWrapper:Failed to initialize                                                                                PortAudioMicrophoneWrapper
2019-07-04 08:38:23.061 [  6] 9 LibCurlHttpContentFetcher:transferThread:numTran                                                                                sfersLeft=1
2019-07-04 08:38:23.063 [  1] C SampleApplication:Failed to create PortAudioMicr                                                                                ophoneWrapper!
2019-07-04 08:38:23.063 [  1] 5 DefaultClient:DirectiveSequencerShutdown
2019-07-04 08:38:23.063 [  1] 9 DirectiveSequencer:doShutdown
2019-07-04 08:38:23.064 [  1] 9 DirectiveProcessor:queueAllDirectivesForCancella                                                                                tionLocked

@scotthea-amazon
What about buster ? The sample app does not work on buster is it ?

the official stable Debian version (where Raspbian comes from) is still stretch. I don't know why Raspbian is pushing people to buster when it is still in test.
You can still get stretch from raspberrypi.org:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2019-04-09/

Please note that the official avs-device-sdk supported version of Raspbian is Stretch.
That said, the error log seems to point to a problem with PortAudio initialization.
2019-07-01 14:41:19.451 [  1] C PortAudioMicrophoneWrapper:Failed to open PortAudio default stream:errorCode=-9997

I would suggest making sure you have an usb microphone connected to your pie, listing the recording device on your system with arecord -l, and making sure the ~/.asoundrc file is configured according to this.
If you are running the SampleApp in sudo, please make sure to modify the .asoundrc file in /root/.asoundrc.  You should be able to access this by using sudo su -.
Hope this helps.

@kclchan , I have done what you said . And the asoundrc file(in the home directory ) looks as follows
pcm.!default {
type hw
playback.pcm {
type hw
slave.pcm "hw:0,0"
format S16_LE
}
capture.pcm {
type plug
slave.pcm "hw:1,0"
}
}
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
Also the asoundrc file in the root directory is as follows :
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:0,0"
}
capture.pcm {
type plug
slave.pcm "hw:1,0"
}
}
I could not find where the problem lies. Is it because of the buster version.

Hi @Vaishnavikumara, could you also do arecord -l to list out all the recording devices on your pi?

Had this problem after upgrading my rpi to the latest kernel. This seems to be a problem with portaudio. Setting environment variable PA_ALSA_PLUGHW=1 solved this for my setup.

@kclchan  , I have done that and it is listing out the devices connected .

@khassel  , can you please tell me where can I access that environment variable

If you are starting the App with the script startsample.sh you have to edit this file and replace
./SampleApp "$OUTPUT_CONFIG_FILE" "$THIRD_PARTY_PATH/alexa-rpi/models" DEBUG9

with
env PA_ALSA_PLUGHW=1 ./SampleApp "$OUTPUT_CONFIG_FILE" "$THIRD_PARTY_PATH/alexa-rpi/models" DEBUG9

But I don't use this setup, so this is untested ...

@khassel  After vigorous testing, your script worked!
env PA_ALSA_PLUGHW=1 ./SampleApp/src/SampleApp ./Integration/AlexaClientSDKConfig.json /home/pi/sdk-folder/third-party/alexa-rpi/models
``
It now successfully checks for authorization and no error for 'Failed to create SampleApplication!'
It successfully authorizes and Alexa works completely.
Thank you so much for your help.
@Vaishnavikumara May I suggest you try this as well. It may work.

@udop1 I will try this and let you know , Thanks .

###################################################################
UNRECOVERABLE CAPABILITIES API ERROR: UNKNOWN_ERROR
Entering limited interaction mode.
###################################################################
It is getting authorized but I am facing the above error . Please help @udop1

@Vaishnavikumara could you post your full DEBUG9 logs here? It will help us debug the issue further.

@udop1 @mvelegon-amzn  Now it is working fine. I just started doing everything from scratch . Thanks for the help .
Note : I tried it on Stretch not on buster .

i am facing this issue ----
2020-07-06 17:19:51.995 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.996 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.996 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.996 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.997 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.997 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.998 [  1] 5 SQLiteDeviceSettingStorage:close
2020-07-06 17:19:51.998 [  1] 9 SettingEventSender:cancel
2020-07-06 17:19:51.998 [  1] 5 InternetConnectionMonitor:stopMonitoring
2020-07-06 17:19:52.005 [  1] 5 SQLiteCBLAuthDelegateStorage:~SQLiteCBLAuthDelegateStorage
2020-07-06 17:19:52.005 [  1] 5 SQLiteCBLAuthDelegateStorage:close
Failed to create SampleApplication!
can any one help me to solve this?****


Added cleanup of puppet reports

Remove logs after 1 day
Fixes undisciplined logging from 95f86d28a76c7b1b6a7ec8e5b2dc9ef89912e5c4

The tests are failing but it's only lint:
modules/puppet/manifests/master.pp - WARNING: double quoted string containing no variables on line 86

(Puppet interpolates variables in double quoted strings, but not single quoted ones)


Undefined method created? for #<#<Class:

Hi! I am diving into TrailbIazer and I love it so far. I am learning about it by refactoring an existing app and I am having an issue I can not figure out why.
I have this operation:
class Project < ActiveRecord::Base
  class AssignUsers < Trailblazer::Operation
    include Model
    model Project, :update

    include Dispatch
    callback do
      collection :users do
        on_add :add_default_assignment!
      end
    end

    def add_default_assignment!(user, options)
      model.user_assignments.create(user: user.model)
    end

    contract do
      collection :users, populator: :user! do
        property :id, type: Integer

        validates :id, presence: true
      end

      def user!(fragment:, index:, **)
        return skip! if users.find { |u| u.id == fragment[:id] }
        users.append(User.find_or_initialize_by(id: fragment[:id]))
      end
    end

    def process(params)
      validate(params) do |f|
        f.save
        dispatch!
      end
    end
  end
end

In a rails console I execute the following lines:
project.update_attributes(users: [])
Project::AssignUsers.(users: [{ id: 17 }], id: project.id)

The add_default_assignment method is called with the added user and it throws the following error: NoMethodError: undefined method created?' for #<#Class:0x007f954a102c50:0x007f954a020468>`
I guess this has to do with the user param in the add_default_assignment not being a Twin, but I am not completely sure about this. I've been reading your book, specifically the Callbacks chapter and I can't figure out what's wrong with my operation.
Here is my Project class:
class Project < ActiveRecord::Base
  has_and_belongs_to_many :users
  belongs_to :team_manager, class_name: 'User', foreign_key: 'user_id'
  has_many :features
  has_many :sprints
  has_many :user_assignments, as: :subject

  validates :name, :description, presence: true

  accepts_nested_attributes_for :features

  def current_sprint
    sprints.find_by('start_date <= :today AND end_date >= :today', today: Time.zone.today)
  end

  def total_estimated_time
    features.sum(:estimated_hours)
  end
end

I would really appreciate it if you could give me a hint on how to figure this out.
BTW, is this the place to ask these kind of questions?

It turns out I was missing feature Disposable::Twin::Persisted in the contract 😞 . I'm closing this


THRIFT-5755 Docker image build fail

This PR submits fixes to the focal and jammy docker images.

Bionic support was dropped becaused dotnet 8 no longer supports bionic (Ubuntu 18.04). Moved to old/ like other unmaintained images.
Focal/Jammy used the wrong apt location for dotnet, endpoint was 18.04 instead of 20.04/22.04
Jammy cannot build Erlang OPT 23 since it depends on OpenSSL 1.1 which was dropped in favor of 3.0. Using Erlang OPT 25 fixes the problem since it depends on OpenSSL 3.0
Jammy was installing JDK 11 but lib/java requires Java 17

All containers used the root used to volume map the local files into the running container. This creates a hard to maintain working directory on Linux and MacOS since files form the local user and root user are mixed.
To solve this the new docker files can be build using the UID and GID of the host so the files dont mix. The script uses UID and GID 1000 since these are the default ids for most Linux distros.
Change the travis yml to build with 20.04 instead of 18.04. Removed all traces of 18.04 but it cant be tested locally.
Updated the README to reflect the new build/docker/ directory.
Let me know if you prefer to remove the old/ directory completely instead of moving bionic into it.

I think the best solution is to remove "old" directory.

Maybe we can use github actions for build docker images? It will be useful, and we did not miss possible bugs

I've deleted the old docker directory and updated the go version to 1.21.
Let me know if you prefer the old directory to stay I can revert the commit.
As for the travis removal, I think this change is slightly off topic from this PR? Perhaps it can be removed in a different PR if others agree.

I tried to build using the ReleaseManagement.md document, excetp for focal, like so:
$ docker run -v $(pwd):/thrift/src:rw -it thrift/thrift-build:ubuntu-focal /bin/bash
container# ./bootstrap.sh && ./configure && make dist

I get this, which seems non-fatal:
libtoolize:   error: './aclocal/libtool.m4' is newer: use '--force' to overwrite
libtoolize:   error: './aclocal/ltversion.m4' is newer: use '--force' to overwrite

and this, which is definitely fatal:
config.status:1796: executing depfiles commands
config.status:1873: cd compiler/cpp       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmSTNBGe:619: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd compiler/cpp/src       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmgeglFa:526: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd lib/cpp       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmUqictg:711: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd lib/cpp/test       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmQdxGKi:738: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd lib/c_glib       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmBtppXK:611: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd lib/c_glib/test       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmrdHNl9:857: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd lib/lua       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmGn2JNQ:587: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd test/c_glib       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmFg7yb8:478: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd test/cpp       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmKD31lr:518: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd tutorial/c_glib       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/GmcgCIUt:489: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1873: cd tutorial/cpp       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
/tmp/Gm66qrZO:496: *** missing separator.  Stop.
config.status:1878: $? = 2
config.status:1882: error: in `/thrift/src':
config.status:1884: error: Something went wrong bootstrapping makefile fragments
    for automatic dependency tracking.  Try re-running configure with the
    '--disable-dependency-tracking' option to at least be able to build
    the package (albeit without support for automatic dependency tracking).
See `config.log' for more details

@Jens-G thanks for testing this.
I've been unable to re-produce the output you shared, from the message it seems that that autoconf is out of date. Perhaps it's running against an older image?
Can you try to rebuild with name you provided to override it?
docker build --build-arg uid=$(id -u) --build-arg gid=$(id -g) -t thrift/thrift-build:ubuntu-focal thrift build/docker/ubuntu-focal

If that doesnt work could you try adding --no-cache to force a rebuild? Perhaps the apt cache is outdated.
I did find Haxe and Rust were missing so I added a commit for those.

@thomasbruggink can you help with updating php part of container.
Here it is some discussion
https://github.com/apache/thrift/pull/2942/files#r1510420807

@thomasbruggink can you help with updating php part of container.
Here it is some discussion
https://github.com/apache/thrift/pull/2942/files#r1510420807

Sure, you want me to include the change you made as well with regards to xdebug?

@thomasbruggink can you help with updating php part of container.
Here it is some discussion
https://github.com/apache/thrift/pull/2942/files#r1510420807

Sure, you want me to include the change you made as well with regards to xdebug?

Yes, please, include my updates in Dockerfile for php.

build@6a87fe62b977:/thrift/src$ ./bootstrap.sh && ./configure && make dist
make distclean... ok
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
sh: 1: cannot create autom4te.cache/output.0t: Permission denied
autom4te: /usr/bin/m4 failed with exit status: 2
libtoolize:   error: './aclocal/libtool.m4' is newer: use '--force' to overwrite
libtoolize:   error: './aclocal/ltversion.m4' is newer: use '--force' to overwrite
autoheader: cannot rename /tmp/ahgpEtwo/config.hin as config.hin: Permission denied

build@6a87fe62b977:/thrift/src$ ./bootstrap.sh && ./configure && make dist
make distclean... ok
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
sh: 1: cannot create autom4te.cache/output.0t: Permission denied
autom4te: /usr/bin/m4 failed with exit status: 2
libtoolize:   error: './aclocal/libtool.m4' is newer: use '--force' to overwrite
libtoolize:   error: './aclocal/ltversion.m4' is newer: use '--force' to overwrite
autoheader: cannot rename /tmp/ahgpEtwo/config.hin as config.hin: Permission denied

That's it. But its much quicker now, at least :-D

My guess here is that the previous container running as root left some files behind with user and group 1. The current docker file changes the user it runs under to use the same user id and group id as the host system has. This way the repository wont be polluted with files a non root user cannot delete.
Can you try removing the files (autom4te.cache/) manually (probably requires root). Or sudo git clean -xfd outside the container to reset the entire repository :bow:
I still get a build error running make dist but I'm not sure if this is because of me missing files so I'm curious about your input there.
/thrift/src/compiler/cpp/thrift --gen cpp ../../../test/AnnotationTest.thrift
/bin/bash: /thrift/src/compiler/cpp/thrift: No such file or directory

I have the idea make dist is supposed to build the thrift compiler as well but this seems not to happen :thinking:

I have the idea make dist is supposed to build the thrift compiler as well but this seems not to happen 🤔

Apache releases are source code releases.

My guess here is that the previous container running as root left some files behind [...]

That was my first thought too, so I removed the whole folder. Same result. Now I basically cloned from scratch now, cleaned all docker build caches etc. and currently running the third attempt to build it (the two before stopped with "not enough space"). Lets see what that brings ...

My guess here is that the previous container running as root left some files behind [...]

That was my first thought too, so I removed the whole folder. Same result. Now I basically cloned from scratch and currently the the third attempt to build it runs (the two before stopped with "not enough space", so I also cleaned all docker build caches etc. ). Lets see what that brings ...

Hmm I cant reproduce this :thinking: I fixed the setup to allow root builds again, this would at least confirm the image has the correct tools installed.
Build as:
docker build --build-arg uid=0 --build-arg user=root --build-arg gid=0 --build-arg group=root -t thrift/thrift-build:ubuntu-focal build/docker/ubuntu-focal

Can you share a bit about your setup? Are you on a Linux distro or wsl on windows? Running docker rootless? Maybe I can repro this in a VM.
I'm testing under a pretty standard Ubuntu 22.04 installation (not a VM).

@ulidtko maybe you can help to figure the problem?

Ok I figured it out, the difference seems to be in using docker desktop which even on Linux runs another Linux VM inside.
https://docs.docker.com/desktop/faqs/linuxfaqs/#how-do-i-enable-file-sharing
File sharing under virtioFS seems to by default map all file permissions in the directory from the UID on the host to UID 0 (root) in the container.
So instead the container on Linux with docker desktop should be build like:
docker build -t thrift build/docker/ubuntu-jammy

and can then be started as:
docker run -v $(pwd):/thrift/src -it thrift /bin/bash

inside the container all files will be root but on the host they will automatically be set to whatever the host runs.
I still need to confirm if Mac behaves the same.
@Jens-G could you try and see if the above instructions allow you to ./bootstrap.sh && ./configure && make dist correctly?

make  distdir-am
make[6]: Entering directory '/thrift/src/lib/cpp'
 (cd test && make  top_distdir=../../../thrift-0.21.0 distdir=../../../thrift-0.21.0/lib/cpp/test \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[7]: Entering directory '/thrift/src/lib/cpp/test'
/thrift/src/compiler/cpp/thrift --gen cpp ../../../test/AnnotationTest.thrift
/bin/bash: line 1: /thrift/src/compiler/cpp/thrift: No such file or directory
make[7]: *** [Makefile:1880: gen-cpp/AnnotationTest_types.h] Error 127
make[7]: Leaving directory '/thrift/src/lib/cpp/test'
make[6]: *** [Makefile:1685: distdir-am] Error 1
make[6]: Leaving directory '/thrift/src/lib/cpp'
make[5]: *** [Makefile:1681: distdir] Error 2
make[5]: Leaving directory '/thrift/src/lib/cpp'
make[4]: *** [Makefile:672: distdir-am] Error 1
make[4]: Leaving directory '/thrift/src/lib'
make[3]: *** [Makefile:668: distdir] Error 2
make[3]: Leaving directory '/thrift/src/lib'
make[2]: *** [Makefile:791: distdir-am] Error 1
make[2]: Leaving directory '/thrift/src'
make[1]: *** [Makefile:785: distdir] Error 2
make[1]: Leaving directory '/thrift/src'
make: *** [Makefile:894: dist] Error 2

Better, still not perfect. Not sure where this comes from ... mmmh.

make  distdir-am
make[6]: Entering directory '/thrift/src/lib/cpp'
 (cd test && make  top_distdir=../../../thrift-0.21.0 distdir=../../../thrift-0.21.0/lib/cpp/test \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[7]: Entering directory '/thrift/src/lib/cpp/test'
/thrift/src/compiler/cpp/thrift --gen cpp ../../../test/AnnotationTest.thrift
/bin/bash: line 1: /thrift/src/compiler/cpp/thrift: No such file or directory
make[7]: *** [Makefile:1880: gen-cpp/AnnotationTest_types.h] Error 127
make[7]: Leaving directory '/thrift/src/lib/cpp/test'
make[6]: *** [Makefile:1685: distdir-am] Error 1
make[6]: Leaving directory '/thrift/src/lib/cpp'
make[5]: *** [Makefile:1681: distdir] Error 2
make[5]: Leaving directory '/thrift/src/lib/cpp'
make[4]: *** [Makefile:672: distdir-am] Error 1
make[4]: Leaving directory '/thrift/src/lib'
make[3]: *** [Makefile:668: distdir] Error 2
make[3]: Leaving directory '/thrift/src/lib'
make[2]: *** [Makefile:791: distdir-am] Error 1
make[2]: Leaving directory '/thrift/src'
make[1]: *** [Makefile:785: distdir] Error 2
make[1]: Leaving directory '/thrift/src'
make: *** [Makefile:894: dist] Error 2

Better, still not perfect. Not sure where this comes from ... mmmh.

It seems from local testing that the thrift compiler is required to run make dist correctly. Perhaps the original container did not configure all targets correctly so the dist job for all languages was not actually run?
For example the go library requires compiler/cpp/thrift to exist:
 (cd go && make  top_distdir=../../thrift-0.21.0 distdir=../../thrift-0.21.0/test/go \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[5]: Entering directory '/thrift/src/test/go'
Makefile:664: warning: overriding recipe for target 'check'
Makefile:512: warning: ignoring old recipe for target 'check'
grep -v list.*map.*list.*map ../../test/ThriftTest.thrift > ThriftTest.thrift
mkdir -p src/gen
/thrift/src/compiler/cpp/thrift -out src/gen --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/test/go/src/gen/ ThriftTest.thrift
[WARNING:/thrift/src/test/go/ThriftTest.thrift:43] No generator named 'noexist' could be found!
[WARNING:/thrift/src/test/go/ThriftTest.thrift:45] cpp generator does not accept 'noexist' as sub-namespace!
/thrift/src/compiler/cpp/thrift -out src/gen --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/test/go/src/gen/ ../StressTest.thrift
[WARNING:/thrift/src/test/StressTest.thrift:31] Consider using the more efficient "binary" type instead of "list<byte>".
[WARNING:/thrift/src/test/StressTest.thrift:31] Consider using the more efficient "binary" type instead of "list<byte>".
/thrift/src/compiler/cpp/thrift -out src/gen --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/test/go/src/gen/ ../ConstantsDemo.thrift
touch gopath

So once I ran pushd compiler/cpp/ && make -j nproc && popd && make dist it would run until the PHP job which I fixed here: https://github.com/apache/thrift/pull/2937/commits/3b387ed6c5d7786076ad7ce44e982a20280377f2
I think there are 2 options, 1 is to build the thrift compiler first or 2 is to remove the dependencies on running the thrift compiler and 3 is to configure without the projects that depend on it . The latter probably requires a bunch more commits.

To my understanding make dist should be self-sufficient, i.e. not require the compiler being built before in a separate step. That's also the way in which it behaves right now, I just double-checked it.

Perhaps the original container did not configure all targets correctly so the dist job for all languages never actually ran?

Yes and no. It's obviously some automake change. I compared the generated Makefiles and it became rather obvious, because now
'''
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
...
'''
but before simply
'''
distdir: $(DISTFILES)
'''
Note the lack of the $(BUILT_SOURCES) dependency.

Note the lack of the $(BUILT_SOURCES) dependency.
There's a new option no-dist-built-sources that basically reverts the change as an opt-in feature.

Thanks for the hint :+1: I have no experience with automake so I've tried to figure out where to apply your solution. Updating AM_INIT_AUTOMAKE with the no-dist-built-sources has the problem that it wont work on automake under version 1.16.5 which is not installable through a package manager on ubuntu 20.04.
However even on 1.16.5 it seems this option just doesnt work? I could find others that seem to have run into the same problem.
So the latest commit manually overrides the distdir option but removes the dependecy on BUILT_SOURCES. This works on both 20.04 and 22.04 for me.
Please let me know if this also succeeds for you :bow: if you happen to know a better solutions then I can redo the last commit.

There's a new option no-dist-built-sources that basically reverts the change as an opt-in feature.

However even on 1.16.5 it seems this option just doesnt work? I could find others that seem to have run into the same problem.

Interesting. Yes I did notice, indeed. Obviously I am the first one then that brought the issue up at the right place: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69908
I'll try your solution tomorrow, thanks for fixing it.

I'll try your solution tomorrow, thanks for fixing it.

seems to work now

All fine with this?

LGTM


broken npm update reminder

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the
Amplify Console GitHub Issue Tracker

Describe the bug
The versions don't appear in the npm update reminder.
Amplify CLI Version
4.30.0
To Reproduce
type amplify publish in your terminal.
Expected behavior
The versions will appear in the npm update reminder.
Screenshots
$ amplify publish

   ╭──────────────────────────────────────────────────────────╮
   │                                                          │
   │   Update available {currentVersion} → {latestVersion}    │
   │              Run {updateCommand} to update               │
   │                                                          │
   ╰──────────────────────────────────────────────────────────╯

Desktop (please complete the following information):

OS: Mac
Node Version: 12.16.2

@cyrfer I'm unable to repro that issue on v 4.30.0. We had to rollback v 4.31.0 to v 4.30.0 so it's possible that messed up the upgrade notifier.

can you remind me what is the command to run to update amplify? the "updateCommand" broken string

@ericowhadi npm i -g @aws-amplify/cli


fix: added path check

Description
Fixes #8335
Type of change

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

How Has This Been Tested?
Untested. Response that creates this error is not known.
Checklist:

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

Test coverage results :test_tube:
:red_circle: Total coverage has decreased
// Code coverage diff between base branch:release and head branch: fix/8335

Status
File
% Stmts
% Branch
% Funcs
% Lines

:red_circle:
total
54.93 (0)
36.6 (-0.01)
33.9 (0)
55.47 (0)

/ok-to-test sha=0c0ffbc

/ok-to-test sha=e5621ef

closed via https://github.com/appsmithorg/appsmith/pull/8618


Enabling CI for running tests & running build

@sungshik this is ready for merging, the test now run in maven, and so does the typechecker.


No module named 'detectron2'

Despite the fact that I cloned the detectoron2 repository
Traceback (most recent call last):
File "D:\Python\VisionGRIT\GRiT\demo.py", line 9, in
from detectron2.config import get_cfg
ModuleNotFoundError: No module named 'detectron2'

I am also having trouble with the installation. The instructions don't appear to be up to date with the repository contents.
However, your statement

Despite the fact that I cloned the detectoron2 repository

Merely cloning the repository would not be enough.
See: https://github.com/JialianW/GRiT/blob/master/docs/INSTALL.md#installation-example
You clone, navigate to repo directory, then run pip install -e .
However, when I tried that there are issues with compiling binaries using ninja.
I was able to install detectron using prebuilt here: https://github.com/facebookresearch/detectron2/blob/main/INSTALL.md
However, now I am trying to see how to install centernet
A copy of CenterNet2 seems to exist in this repository here however, it's INSTALL instructions mention detectron2 again, and it includes a yet another copy of detectron2 making it seem like the need to clone dectron2 is old instruction
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/home/vscode/miniconda3/envs/grit/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1666, in _run_ninja_build
        subprocess.run(
      File "/home/vscode/miniconda3/envs/grit/lib/python3.8/subprocess.py", line 516, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
...

RuntimeError: Error compiling objects for extension

Maybe there are prebuilts for centernet

I wanted to add some more information.
I think the instructions below are out of date

git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
git checkout cc87e7ec
pip install -e .

The GRiT repo now directly includes a copy of detectron2 with centernet project copied

I think the updated instructions would be something like:
Clone Repo
git clone https://github.com/JialianW/GRiT.git
cd GRiT
pip install -r requirements.txt

Install included version of detectron
cd third_party/CenterNet2
pip install -e .
cd ../..

Also, I previously mistakenly though centernet was its own package; however, center module is explicitly added to the path here: https://github.com/JialianW/GRiT/blob/39b33dbc0900e4be0458af14597fcb1a82d933bb/demo.py#L13-L14
So after installing the copy of detectron within CenterNet2 it should work
Hope this helps


Ginkgo CI: leftover cruft in workspace

After running the Ginkgo build multiple times, I get a ton of copies created of src/github.com/cilium/cilium in the Jenkins workspace:
root@jenkins-slave-4:~/jenkins/workspace/cilium_cilium_PR-1867-YBM7UJNQ3AVKIBNFUOLF2PCHUBI24WUUUTDQOQ7EOQD5KPDRDLEA/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium#

Build failure: https://jenkins.cilium.io/job/cilium/job/cilium/job/PR-1867/21/execution/node/28/log/:
22:36:41 Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2201 -o LogLevel=FATAL  -o ControlMaster=auto -o ControlPath=/tmp/ssh.421 -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/root/jenkins/workspace/cilium_cilium_PR-1867-YBM7UJNQ3AVKIBNFUOLF2PCHUBI24WUUUTDQOQ7EOQD5KPDRDLEA/.vagrant/machines/cilium-master-build-PR-1867-21/virtualbox/private_key'" "--exclude" ".vagrant/" "--exclude" "contrib/packaging/docker/stage" "/root/jenkins/workspace/cilium_cilium_PR-1867-YBM7UJNQ3AVKIBNFUOLF2PCHUBI24WUUUTDQOQ7EOQD5KPDRDLEA/" "vagrant@<IP_ADDRESS>:/home/vagrant/go/src/github.com/cilium/cilium"
22:36:41 Error: rsync: readlink_stat("/root/jenkins/workspace/cilium_cilium_PR-1867-YBM7UJNQ3AVKIBNFUOLF2PCHUBI24WUUUTDQOQ7EOQD5KPDRDLEA/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium") failed: Too many levels of symbolic links (40)
22:36:41 rsync: write failed on "/home/vagrant/go/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/src/github.com/cilium/cilium/vendor/github.com/imdario/mergo/LICENSE": No space left on device (28)
22:36:41 rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]

Isolate the cause of this issue in the Ginkgo tests.

This is due to the fact that a symlink is created within the Cilium repository to itself, which messes with rsync and Vagrant. This will be fixed by #1867

Fixed by #1867


sdgfsdf

sdfsdf

Thanks @selcuksntrk  for the PR, glad to see you've been validated by EasyCLA . Closing.


use icons for service status in dashboard

Consider replacing the text in the State column with icons (plus accessible text through aria/hover) in order to reduce the wall of text on the dashboard and make it quicker and easier to scan for state.
I guess the possible states are Exited, FailedToStart, Paused, Pending, Removed, Running, Unknown
We could do this short term with something like the open source bootstrap icons?

This is fixed in the latest


Turned off formatting for JavaDoc as in some cases/alot of cases formatt...

...ing is intentional

Looks good to me but I don't have permission to mergef


Refactor SystemVerilog unit tests

Most of the contents of these two unit tests are static.
Move things around so the entire test fits on a single page,
for better readability/maintainability.
Name the code part <TEST_NAME>_TEXT,
and the tokens part <TEST_NAME>_TOKENS.
Choosing "text" b/c it's the parameter name to the
lexer.get_tokens(text) method.

Looks good!


what does deepfashion_ref.txt,deepfashion_ref_test.txt,deepfashion_self_pair.txt  mean?

if i want to  use MetFace datasets, how can i get these three txt files?

This problem also bothers me. @xingranzh , how to apply the model to metface, please?

这个问题有得到解决吗


How I can add a new payment gateway?

Expected behavior:
Add new Payment Gateway to my instance
Actual behavior:
I make a new extension but i get error with guzzle, maybe error on version.
Reproduce steps:
Install my own extension and try checkout one order
Version:
3.0.5
Additional Information:
Log attached
SPOILER_message.txt

Can you paste the error here we we can help?

Hard to say what exactly happened but I can guess it's to do with the request your making as Guzzle works fine for me with HTTP requests being made from the same version of TI. The error is stating that the method being called is not defined "chooseHandler()"
Can you provide the exact code being used removing any key's your using?

i found error on guzzle version used. I change to version guzzle6 and now work fine, thanks.


Create poligran.txt as a new university

Create poligran.txt as a new university because the domain was changed from poli to poligran but someone could use the old domain

@danieldrummer I am sorry, the domain poligran.edu.co is removed from our trusted domains list because it was abused in the past. If you are the student of this school, please enroll to GitHub Student Developer Pack at https://education.github.com/discount_requests/application. Then apply for JetBrains educational subscription with your GitHub account (GitHub tab at https://www.jetbrains.com/shop/eform/students).


Image conversion and compression issues

Steps:

run luxonis/rae-ros-robot:humble docker image
run bringup.launch.py w/o LED node
open RViz, add Camera and assign different camera topics there:

Expected: camera output is correctly rendered in RViz
Actual: none of the image topics produce the valuable output; the following errors are spammed in the log:
[component_container-1] [ERROR] [1697753825.488095736] [TheoraPublisher]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'
[component_container-1] [ERROR] [1697753825.500971843] [compressed_depth_image_transport]: Compressed Depth Image Transport - Compression requires single-channel 32bit-floating point or 16bit raw depth images (input format is: bgr8).

Hey, I will try to replicate the issue over the weekend/monday. Are raw images displaying correctly in rviz?

I see the following raw topics in RViz: /rae/left_back/image_raw, /rae/right/image_raw, /rae/stereo_back/image_raw, /rae/stereo_front/image_raw.
And I got the initial stream with a huge delay. But then it immediately stuck forever.
Note that I could successfully stream video via the RobotHub app w/o any delays, so it's not a bandwidth issue.


Add job to run all front end tests.

Add CI job to run all front end tests when a pull request is made and when merging to main.

Now that there are two jobs within this workflow, does it make sense to update the job CI on line 13 to a similar naming convention of your new job like BackEndCI


[WIP] Docs: add build from source section.

:white_check_mark: Build AElf <IP_ADDRESS>91 completed (commit https://github.com/AElfProject/AElf/commit/4624148c54 by @samfrb)


⚠ Bofrost.be has degraded performance

In 88101bc, Bofrost.be (https://www.bofrost.be) experienced degraded performance:

HTTP code: 200
Response time: 830 ms

Resolved: Bofrost.be performance has improved in 7861ce2 after 6 minutes.


changed/removed fields name

changed switch_state to activate

Why is this PR still open? @Nicolasdejean @johanstokking


Find the topic length and confirm how many events have been consumed and how many are remaining.

Find the topic length and confirm how many events have been consumed and how many are remaining.
admin.fetchTopicMetadata()
gives no information

Topic length or "number of messages" isn't a consistently reliable value. As soon as one new producer request is made, that's invalidated. What's your use case?

@OneCricketeer
Kindly if you could guide on this
1-How to make sure kafka event is consumed ?
2-how to see via code that how many events have been consumed and how many are in queue
3-how to view topics via JavaScript code
4-What should be the appropriate settings for consumer
5-Best design pattern to consume events

is it a good practice to run similar multiple consumers in a single application

Not specifically, no. You'd instead use an external supervisor like kubernetes or pm2 to run multiple instances of one consumer application


Added google maven repository for fix gradle build error

Some developers are using Android Studio to build,
but they can encounter error "could not find lint-gradle-api-26.1.2.jar."
The reason for this error is that the flutter grade does not include the
google maven repository, which is why it can not find lint-gradle-api.
Of course developers can add it by self like stackoverflow below,
But.. I think the google maven repository should be included by default.
Please refer to stackoverflow issue.
https://stackoverflow.com/questions/52945041/couldnt-locate-lint-gradle-api-26-1-2-jar-for-flutter-project

Closing as duplicate of #23397


SwiftShader: Segfault

I think this is allowed, but @vili-1 can you confirm that a loop header can be its own continue target? See the CFG below.
Executing amber -t spv1.3 -v 1.1 reduced-segfault.amber leads to a segfault. I think this may be related to #8 as both seem to rely on there being input variable accesses in a selection header followed by a loop header.
I have attached an archive containing the files.

Yes @Jack-Clark , a loop header can be its own continue target (this example is allowed - SHO is Entry). About the segfault I have to dig a bit into this.

@Jack-Clark, I don't get segfault in my Mac
Summary: 1 pass, 0 fail

Great, thanks for confirming this. Regarding the segfault, dId you use SwiftShader or moltenVK?

MoltenVK
$ ./amber -d -V
Amber        : d8acae6
SPIRV-Tools  : 97f1d485
SPIRV-Headers: dc77030
GLSLang      : 07a55839
Shaderc      : 821d564

Physical device properties:
  apiVersion: 1.1.170
  driverVersion: 10102
  vendorID: 32902
  deviceID: 35411
  deviceType: integrated gpu
  deviceName: Intel(R) Iris(TM) Plus Graphics
  driverName: MoltenVK
  driverInfo: 1.1.2
End of physical device properties.

As stated in #8, we get an error when the node in the fleshing path is both a switch case and merge block of the switch. The successful execution that I mentioned above was using a fleshing path other than this. Maybe we have a chat with @afd at some point to clarify this (not clear to me at the moment).

Loading the SwiftShader I get no error!

Hmmm, which commit are you using for SwiftShader?


Implementation of HTML Reports

I know that you mentioned in #90 that you were leaning toward letting people choose their own HTML report generator, but my PR into ReportGenerator was recently merged, and this is a completely optional way of letting people who want to generate both coverage results and HTML reports in one command do so.  If the new, optional, ReportTypes property is not specified, nothing changes.

@coenm - I see where you are going with that.  Really this feature is completely optional.  It does add a separate dependency to coverlet, but there are plenty of code coverage tools that include HTML report generation as a part of the base package.  Istanbul for JavaScript, and Cobertura for Java are good examples of this.
I added this functionality more for simplicity than anything else.  For simple projects that don't utilize a build script or custom MSBuild configuration, it seems overkill to have them add an extra step to add one.  I suppose I could make a separate nuget package that hooks into MSBuild and runs after coverlet's GenerateCoverageResult task.
@tonerdo, if you believe that would be a better approach, let me know.

I tend to agree with @coenm, this feature will be good as an add-on but doesn't really fit into the core library. Here a some reasons behind my reservation:

I imagine a situation where people might have issues with the html generation feature and open them in this repo.
This will take away visibility from the ReportGenerator project. I prefer Coverlet to focus on just the coverage bit and co-exist with supporting projects as opposed to trying to do everything in itself.

That being said, I understand the work that went into this. I'll leave this PR open and if there's considerable interest for this feature from the community then I'll merge it in

@tonerdo - no worries.  Wasn't too hard to implement.  I do really like the simplicity of hooking into dotnet test for both, however.  I'm going to explore creating a separate package that can marry the two and create a separate task that executes after GenerateCoverageResult to handle report generation.

0This is a great feature and I agree that this should not be in the Core
Problem is that we cannot consume Coverlet.Core because there is no package. The only way is to download the code and use that.. or make Private packages.
Please check this issue. https://github.com/tonerdo/coverlet/issues/212

We close this stale PR for the moment, we'll re-open in future if needed.


comment printed twice

i found an issue where the Não tem porra nenhuma na fila, mangolão comment is printed twice on discord

Any clues on how did it happened? How may I recreate the bug?
Sorry by the late reply! I was working on some other projects...


add more new gce image families

add more new gce image families
Description
similar to #1304 we add new image families for centos-8 and debian-10 from https://cloud.google.com/compute/docs/images#unshielded-images to prevent similar errors as in #1303
Status

done, ready for review

Checklist (tick everything that applies)

[x] Code linting (required, can be done after the PR checks)
[ ] Documentation
[ ] Tests
[ ] ICLA (required for bigger changes)

Merged, thanks.


Spring Webjars and Security redirects

Hi
I have a Spring boot application MVC (Thymeleaf) using Spring Security that runs fine with the default login page and inMemory users. But when I set the application to work behind a Zuul reverse-proxy using Eureka registry, it behaves and redirects in a strange way. For example:
http://zuulapp_ip/myapp       redirects to       http://nonproxiedapp_ip/login
As I know I have to use x-forward-headers but they need to be intercepted before Spring Security filters so that when Spring security redirects to /login, it can do the redirect behind the Zuul context.
I am not using server.context-path because it makes myapp no to be found in the Eureka server (the app is registered but when invoking behind Zuul, it is not found).
Some help would be great. Thanks

If security is on the nonproxiedapp_ip and it knows nothing about the proxy, why would it redirect anywhere else?

Hi
Thanks for replying. It has to be through the proxy because we have a K8S orchestrator and the entrypoint is the Zuul app, wich has the Domain Name as well as the TLS certs.
Thanks

Sure but if Spring Security has no idea that it needs to redirect back through the proxy it is going to try to redirect back to the app itself.

Exactly
The question here is how let Spring Security to know it is behing a Zuul filter. I tried using a HandlerInterceptor and changing the filter order but it did not work.

That is a question for the Spring Security team as there is nothing special about Spring Cloud Zuul, the same would be true for any proxy.


ADDON-31368: Adding support for updown logs events

https://jira.splunk.com/browse/ADDON-31368: Adding support for new juniper events from customer samples

:tada: This PR is included in version 1.43.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


[V3-RC4] Freezing movie clips when animationSpeed < 1

Hello,
When using movie clips with an animationSpeed smaller than 1 (for example 0.1), we notice that some (most on our systems) freeze. The onComplete callback is never called when this occure.
You can see the bug in action here : http://jsfiddle.net/jp08zvon/4/
To help you tracking the creation and the end of the animations, we have logged theses event in the console with the number of "living" clips.

All sorted in v3 now. thanks for sharing and providing an example! :+1:


Create Python script to generate bindings

ffig.py should be added and take command line parameters so it can build requested bindings for a given file or set of files.
Ideally ffig.py can be used from within a CMake project to generate files.

What kind of cli flags do you want to add?

Deciding what the script should look like is half the battle here.
I was thinking that getting this:
ffig.py --input header1.h header2.h --output python --name MyModule
working would be a good start.
The command above would create a MyModules directory and build the C-API and shared library in it, add an __init__.py and add bindings to it.
I'm pretty sure I can use this from CMake.
Consolidating several input files into one TU may be a bit tricky, if so we can defer that for now.

I'm going to pick this ticket up now. A simpler script would make a lot of things simpler.

Added PR #61


Updating ADS error codes

It seems that there are new ADS error codes available, such as
0x1D | 29 | 0x9811 001D | ERR_TLSSEND | TLS send error – secure ADS connection failed.
0x1E | 30 | 0x9811 001E | ERR_ACCESSDENIED | Access denied – secure ADS access denied.

The error code list needs to be updated.

Done in 1.13.1