ENABLE_GZIP activated will result in tar.gz & tgz files compressed 2 times in gzip

Description
Had to dig to understand what happened.
It started with retrieving a git repo in Gitea as an archive and having tar failing on it complaining it is not a tar archive.
Thing is, it was a gzip archive. Then after a gunzip, the .tar file was in fact a ... gzip file too.
Here are the shell commands to demonstrate this, but you can also use 7zip in a file browser, it will show an extra level with the archive name and no extension before having the first directory level.
$ wget https://gitea..../repo-master.tar.gz

$ tar xzvf repo-master.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

$ file repo-master.tar.gz
repo-master.tar.gz: gzip compressed data, original size modulo 2^32 1008078

$ gunzip repo-master.tar.gz
$ ls
	repo-master.tar
$ file repo-master.tar
repo-master.tar: gzip compressed data, from Unix, original size modulo 2^32 6912000

$ tar xzvf repo-master.tar
(...)
Data uncompressed correctly

It went under the radar for a while as I rarely use this mechanism with the Gitea instance.
While digging in the configuration I found that I had the parameter ENABLE_GZIP = true
There is no additional parameter related to tar.*.command as stated in #26620 .  Gitea has the default behavior here.
As sometimes there can be a problem due to the reverse proxy nginx in front wich also has gzip=on, I did some tests without it.
It was completely bypassed, connected directly to the gitea instance/port.
Results are :

zip files are correct in all situations
with ENABLE_GZIP = true, the downloaded tgz/tar.gz files are compressed in gzip a second time.
It is worth noting the files generated by Gitea in its cache under repo-archive/*hash*.tar.gz are valid.
with ENABLE_GZIP = false the downloaded tgz/tar.gz files are valid.
Included those who were already generated and still in Gitea local cache.

I also think ENABLE_GZIP does not do what is stated in the documentation : when set to false, without a reverse proxy most of the data was still sent gzipped. What is the real use for ?
Gitea Version
1.21.9 and 1.21.11
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.17.1
Operating System
Ubuntu 18.04
How are you running Gitea?
Binary release from https://github.com/go-gitea/gitea/releases
Launched by systemd
Database
SQLite

Hello,

If it is related to ENABLE_GZIP=true, could you try the 1.21 nightly (https://dl.gitea.com/gitea/1.21/) ? It has a new gzip handler.

Tested with this binary : gitea-1.21-linux-amd64

time: 2024-04-24T00:34:10.000Z
version : 1.21.11+16-gddf64b84e4

Same behavior, no change : With ENABLE_GZIP,=true the .tar.gz files are compressed a second time.

It doesn't seem to be possible. At least, according to the code, the "gzip handler" is only used when ENABLE_GZIP=true.
Could you provide more details about which page is sent as gzip when ENABLE_GZIP=false?

Well, then, the plot thickens ...
Reran some tests, no reverse proxy, http connection, cache disabled in the browser, and "ENABLE_GZIP=false" in app.ini.
The following files are always gziped : webcomponents.js, index.js, index.css, logo.svg (the gitea one).
On the other hand, index.html page and anything .json related are not compressed, as expected.
The http request/response for index.css with ENABLE_GZIP=false
Http request :
GET		http://********:3000/assets/css/index.css?v=1.21.11
Status		200 OK
Version		HTTP/1.1
Transferred	87.40 kB (551.10 kB size)
Referrer Policy	no-referrer

Response headers (raw) :
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, max-age=21600
Content-Encoding: gzip
Content-Type: text/css; charset=utf-8
Last-Modified: Tue, 16 Apr 2024 03:46:00 GMT
Date: Wed, 24 Apr 2024 19:14:32 GMT
Transfer-Encoding: chunked

With ENABLE_GZIP=true, everything is compressed, images aside.
The problem with the .tar.gz files is helpful to validate the setting value.
Also, this might be the source of the problem for the double compression of the .tar.gz files : some mimetype exclusions could be missing in the code.
This aside, static resources or heavy files with an enforced compression do not strike me as a wrong idea. Just, yeah, seems some part of the documentation and code need a pass or 2.

Thank you for the details. I will try to answer the questions by my understanding.
For the ENABLE_GZIP option itself:
Gitea has 2 different web request handlers.

One is for asset files (the static files you mentioned). These files are packed into Gitea's binary with pre-compression by vfsgen package. So they are not controlled by ENABLE_GZIP option, as long as the user's browser supports compress, these files are served as gzip content
Another kind of web request handlers is for "dynamic contents", like home page, repo page, etc, including the archive/attachment downloading, they could be affected by ENABLE_GZIP option

For the "tar.gz" problem itself, I did a quick test by these steps:
Use the docker compose:
version: "3"

services:
  server:
    image: gitea/gitea:1.21
    container_name: gitea
    environment:
      - GITEA__server__ENABLE_GZIP=true
    volumes:
      - ./gitea:/data
    ports:
      - "3002:3000"
      - "3022:22"

Test the gzip is really enabled:
$ curl -H 'Accept-encoding: gzip' -v http://localhost:3002/
...
< Content-Encoding: gzip
...
Warning: Binary output can mess up your terminal. Use "--output -" to tell
...

Create a repo named "test-archive", then download the tar.gz archive:
$ wget http://localhost:3002/root/test-archive/archive/main.tar.gz
.....
$ tar -xvf main.tar.gz
x test-archive/
x test-archive/README.md
$ cat test-archive/README.md
.....
.....

I think it works well.

I can confirm your test for a new repo, with a default readme.md : the tar.gz file is correct.
be it from wget or using a browser.
I can also confirm this behavior is not the norm. The trigger is having the repo to a minimum size.
There's also the fact I was running wget with some environment parameters activating gzip.
With your new repo test and ENABLE_GZIP=true :
$ git clone gitea@***:test/testing.git
$ cd testing

$ du -sh *
4.0K    README.md

$  wget https://raw.githubusercontent.com/go-gitea/gitea/main/README.md
(...)
$ du -sh *
4.0K    README.md
12K     README.md.1
$ git add .
$ git commit -m "test 1" && git push

# --------------------------------------------
$ wget -S http://***/test/testing/archive/master.tar.gz
  (...)
  Content-Disposition: attachment; filename="testing-master.tar.gz"; filename*=UTF-8''testing-master.tar.gz
  Last-Modified: Thu, 25 Apr 2024 21:25:37 GMT
  (...)
Length: 3251 (3.2K) [application/octet-stream]
Saving to: ‘master.tar.gz’

$ tar tvf master.tar.gz
file is ok

# --------------------------------------------
$ wget -S --header="accept-encoding: gzip" http://***/test/testing/archive/master.tar.gz
  (...)
  Content-Disposition: attachment; filename="testing-master.tar.gz"; filename*=UTF-8''testing-master.tar.gz
  Content-Encoding: gzip
  Last-Modified: Thu, 25 Apr 2024 21:25:37 GMT
  (...)
Length: unspecified [application/octet-stream]
Saving to: ‘master.tar.gz.1’

$ tar tvf master.tar.gz.1
tar: This does not look like a tar archive

Please note the response headers are also not the same between gzip encoding activated or not
And using a browser will also return a double gzipped archive, due to the fact it will by default accepted gzip encoded data.
So to summarize :

ENABLE_GZIP=true set in Gitea configuration

the target repo must have a minimal size to trigger Gitea gzip encoder on http connections. The default readme.md from a new repo is clearly not enough.

wget in its default configuration will not support gzip encoded data and will not trigger the double compressed archive.

any client (browser, curl, wget) with a configuration where gzip encoding is explicitly accepted will trigger the double compressed archive

Tested again with my docker compose in https://github.com/go-gitea/gitea/issues/30649#issuecomment-2076125979 .
This time, I uploaded a large avatar.png to the repo (170KB)
$ curl -H 'Accept-encoding: gzip' -v http://localhost:3002/
...
> Accept-encoding: gzip
>
< HTTP/1.1 200 OK
...
< Content-Encoding: gzip
...
Warning: Binary output can mess up your terminal. Use "--output -" to tell

$ wget  -S --header="accept-encoding: gzip"  http://localhost:3002/root/test-archive/archive/main.tar.gz
--2024-04-26 08:07:06--  http://localhost:3002/root/test-archive/archive/main.tar.gz
Resolving localhost (localhost)... ::1, <IP_ADDRESS>
Connecting to localhost (localhost)|::1|:3002... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Accept-Ranges: bytes
  Access-Control-Expose-Headers: Content-Disposition
  Cache-Control: private, max-age=300
  Content-Disposition: attachment; filename="test-archive-main.tar.gz"; filename*=UTF-8''test-archive-main.tar.gz
  Content-Encoding: gzip
  Content-Type: application/octet-stream
  Last-Modified: Fri, 26 Apr 2024 00:07:07 GMT
  (... set cookie ...)
  Vary: Accept-Encoding
  X-Content-Type-Options: nosniff
  X-Frame-Options: SAMEORIGIN
  Date: Fri, 26 Apr 2024 00:07:07 GMT
  Transfer-Encoding: chunked
Length: unspecified [application/octet-stream]
Saving to: ‘main.tar.gz’

$ ls -lh main.tar.gz
-rw-r--r-- 1 xiaoguang staff 167K Apr 26 08:07 main.tar.gz

$ tar -xvf main.tar.gz
x test-archive/
x test-archive/README.md
x test-archive/avatar.png
(still ok?)

Still unable to reproduce ........ strange.

After more testing, I think the problem is clear now. I think the gzip compression is not wrong. There are some cases:

Download by browser, browser will respect the Content-Encoding: gzip header, and decompress the received content automatically, and write the decompressed data into file.

Download "zip": the transferred data is compressed by gzip, and browser decompress the gzip content, write the original zip file
Download "tar.gz": the transferred data is compressed by gzip (again), and browser decompress the transferred gzip content, write the original "tar.gz" file content

Download by wget, since you have set --header="accept-encoding: gzip manually, wget won't decompress the transferred content automatically. It only writes what it received into file.

Download "zip": the transferred data is compressed by gzip, wget writes the received gzip content into file
Download "tar.gz", the transferred data is compressed by gzip (again), wget writes the received double-gzipped content into file

$ file test-repo-main.zip (downloaded by Chrome)
test-repo-main.zip: Zip archive data, ....

$ file main.zip (downloaded by wget --header="accept-encoding: gzip")
main.zip: gzip compressed data, ....

So I think this issue could be closed?

No.
Not for me anyway.
I've said it before, the browser is also not handling the tar.gz properly. As its true I didn't specify the version, here it is : Firefox ESR 115.10 (latest).
Btw, I tend to favor tar.gz files from repos as they will manage correctly symlinks and other *nix special files that zip sometimes cannot, and will not warn about.
This said, with ENABLE_GZIP on, currently, wget and firefox do not save a valid tar.gz file.
One client in error, could be it, 2 different clients ? Might be server side instead.
Never before I had to specify --compress explicitly in either curl or wget to download an archive from a webserver. If the content is wrong, it is then either badly handled by the webserver, or sent without the correct information.
What could be the source of the problem seems to circle around the response header Content-Type  sent by Gitea.
It is Content-Type: application/octet-stream for zip AND tar.gz archives.
Which is wrong for both if they must be managed by the client.
While it is usually used to force the client to save the data in a file as per the RFC 2046, given it is an arbitrary data, it leaves to the client how it will be handled.
Now, combine those 3 headers sent to the client
Content-Disposition: attachment; filename="testing-master.tar.gz"; filename*=UTF-8''testing-master.tar.gz
Content-Encoding: gzip
Content-Type: application/octet-stream

How it will be handled will depend of the client, as the type octet-stream has no real mandatory definition about how to managed it, aside being saved as a file (mind the fact this is also just a recommendation originally in said RFC).
Either the client is blind and applies the content-encoding, stating gzip => uncompress the content.
Or it tries to be smart due to so much bad implementation or configuration since decades, and with an arbitrary data type, will seek the filename information in the content-disposition header.

Filename is zip ? encoding is gzip => uncompress then save
Filename is gz ? encoding is gzip => save as is, because it is an octet stream. Which can also be interpreted as raw data.

This scenario would explain the situation.
It could be validated with a proxy and force-rewriting the content-type header. Not hard, but already too much work for this.

I did much more digging on this than intended, for something that was in the end not correctly implemented since start, from my point of view.
I would like to remind that activating deflate or zip on a webserver is done using mimetype to ensure already compressed data (archive, images, crypted files, ...) is not compressed another time.
It is a waste of cpu cycles, and gzipping everything without regard to the data nor the size tends to give the opposite effect from what was desired.
The parameter ENABLE_GZIP should be either set to false as default (which is the current, so good already) but also masked/removed from the documentation, leaving the "full" compression to a reverse proxy like nginx or traefik.
Or keeping it but after a rewrite to manage exclusions, for properly compressing or leaving untouched the data depending of the real type.

Thank you for more feedbacks. Let's do a quick test:
This test is still based on my provided compose compose, with a large file in it:

 wget -O test-no-gzip.zip http://localhost:3002/root/test-gzip/archive/main.zip

test-no-gzip.zip: Zip archive data, at least v1.0 to extract, compression method=store

wget -O test-with-gzip.zip --header="accept-encoding: gzip" http://localhost:3002/root/test-gzip/archive/main.zip

test-with-gzip.zip: gzip compressed data, original size modulo 2^32 170400

Download by Firefox 125.0.2 (64-bit)

Downloads/test-gzip-main.zip: Zip archive data, at least v1.0 to extract, compression method=store

Conclusion:

wget/Firefox always runs correctly for this case.
Manually setting "accept-encoding: gzip" is not the correct method in daily usage, it prevent the client from transparently handling the transport encoding.

About your question:
Content-Disposition: attachment; filename="testing-master.tar.gz"; filename*=UTF-8''testing-master.tar.gz
Content-Encoding: gzip
Content-Type: application/octet-stream

These header are right. Content-Encoding is for transporting, it should be handled transparently by the clients. After the transport is correctly handled and client gets "processed content (decompressed)", then the client could use Content-Disposition to know to write the processed content into a file, and the content type is application/octet-stream.

I also agree that when transferring some compressed contents, using gzip to compress the data on wire again is not ideal (and unnecessary), while indeed it won't (and shouldn't) cause any real problem at the moment. I think the behavior could be improved if the 3rd gzip handler could be more smarter when it detects if the content is compressed .......... and maybe it could also hard-code something on Gitea side.

and maybe it could also hard-code something on Gitea side.

As a quick fix, it could be like this:  Skip gzip for some well-known compressed file types #30796

#30796 and its backport have been merged. Feel free to try 1.22-nightly

Are there still any problems? Or maybe this issue could be closed?

I didn't test it yet, but I don't see why it wouldn't work given the changes you did.
Btw, I would like to thank you for your work, I didn't expect it would be resolved.

Just tested, working fine with already compressed files while retaining the gzip compression for the other files.
Thanks


Transfer SV2 Documentation from Braiins website to our doc (?)

Braiins expressed interest to transfer over everything from https://braiins.com/stratum-v2 to our independent website. However we won't this for the MVP. This is in ideation phase and we will work on it after the website launch collaborating with their team on making the transition smooth for them and us.

I transferred and rewrote everything from the "Features" section in PR #14 , that's what's currently under the "implementation.md" section.


The "@angular/compiler-cli" package was not properly installed.

[X ] bug report -> please search issues before submitting

**Versions.**
@angular/cli: 1.0.0
node: 7.1.0
os: win32 x64
@angular/common: 2.1.2
@angular/compiler: 2.1.2
@angular/core: 2.1.2
@angular/forms: 2.1.2
@angular/http: 2.1.2
@angular/platform-browser: 2.1.2
@angular/platform-browser-dynamic: 2.1.2
@angular/router: 3.1.2
@angular/cli: 1.0.0

**Repro steps.**

run ng serve

**The log given by the failure.**

$ ng serve --verbose
The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
    at Object.<anonymous> (C:\Users\rball\Documents\Dev\Angular\change-detection\node_modules\@ngtools\webpack\src\index.js:16:11)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\rball\Documents\Dev\Angular\change-detection\node_modules\@angular\cli\tasks\eject.js:10:19)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)

**### Desired functionality.**
Launch ng serve without error

**### Mention any other details that might be useful.**
Have updated project and environment per "https://github.com/angular/angular-cli#updating-angular-cli"

See also http://stackoverflow.com/questions/42925690/angular2-cli-error-angular-compiler-cli-package-was-not-properly-installed/43021209#43021209

Package.json

{
  "name": "change-detection",
  "version": "0.0.0",
  "license": "MIT",
  "@angular/cli": {"version": "1.0.0"},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~2.1.0",
    "@angular/compiler": "~2.1.0",
    "@angular/core": "~2.1.0",
    "@angular/forms": "~2.1.0",
    "@angular/http": "~2.1.0",
    "@angular/platform-browser": "~2.1.0",
    "@angular/platform-browser-dynamic": "~2.1.0",
    "@angular/router": "~3.1.0",
    "core-js": "^2.4.1",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0",
    "@types/jasmine": "^2.2.30",
    "@types/node": "^6.0.42",
    "codelyzer": "1.0.0-beta.1",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.9",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "~2.0.3",
    "webdriver-manager": "10.2.5"
  }
}

I have the same issue, but running node 6.10.1 on the same environment and using angular version 4.

Having a exact same issue.

Seems to be related to #5131. Resolved in the same way (upgrade typescript to latest).

Updated my local typescript to latest and changed my tsconfig.json to tsconfig.app.json and everything worked again.

I am having the same problem, and updating typescript did not help. My app does not start at all now. :(

add @angular/compiler-cli to package.json

@intellix solved the problem for me.

I have the same error with a new empty project that i am trying to deploy on heroku so this isn't an upgrade problem:
@angular/cli: 1.0.0
node: 6.10.1
os: linux x64
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0

remote: The "@angular/compiler-cli" package was not properly installed.
remote: Error: The "@angular/compiler-cli" package was not properly installed.
remote:     at Object.<anonymous> (/app/.config/yarn/global/node_modules/@ngtools/webpack/src/index.js:14:11)
remote:     at Module._compile (module.js:570:32)
remote:     at Object.Module._extensions..js (module.js:579:10)
remote:     at Module.load (module.js:487:32)
remote:     at tryModuleLoad (module.js:446:12)
remote:     at Function.Module._load (module.js:438:3)
remote:     at Module.require (module.js:497:17)
remote:     at require (internal/module.js:20:19)
remote:     at Object.<anonymous> (/app/.config/yarn/global/node_modules/@angular/cli/tasks/eject.js:10:19)
remote:     at Module._compile (module.js:570:32)
remote:     at Object.Module._extensions..js (module.js:579:10)
remote:     at Module.load (module.js:487:32)
remote:     at tryModuleLoad (module.js:446:12)
remote:     at Function.Module._load (module.js:438:3)
remote:     at Module.require (module.js:497:17)
remote:     at require (internal/module.js:20:19)

@codestation if you're building on Heroku, you need to move compiler-cli amongst a few other packages to "dependencies" as Heroku only installs packages in production mode.
Here's an example package.json that works on Heroku with a basic server. I keep seeing this daily, I guess it's time for me to write my first blog post :)
{
  "name": "wildcase",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "serve": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "start": "node server",
    "postinstall": "ng build --target=production -e ${NODE_ENV:-production} --aot"
  },
  "private": true,
  "dependencies": {
    "@angular/cli": "1.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/compiler-cli": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "bootstrap": "4.0.0-alpha.6",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "rxjs": "^5.1.0",
    "typescript": "~2.2.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0"
  }
}

Thanks, that was the problem. Moved cli, compiler-cli and typescript out of devDeps and it worked.

@intellix  where i put that code pleas ???

@elversace
If you're deploying to Heroku, add it to dependencies, otherwise add it to devDependencies inside package.json.
Or go to console and: npm install --save @angular/compiler-cli
Created a blog post about Heroku deployments: https://www.dropbox.com/s/1tvhvfgpztvz09e/Screenshot 2017-03-26 21.52.30.png?dl=0

A long litany of comments. Still, I am not sure what the I need to do with respect to my initial posting???

@rfball npm install --save @angular/compiler-cli

@intellix Thanks for the quick response! Just tried this but this is a long list of "UNMET PEER DEPENDENCIES" . Is there a way to do something like the following, in order to start form scratch.
1 fix the package.json (and/or other files)
2 remove any existing files
3 reinstall from scratch
Thanks for your help!

OK,

I completely removed the node_modules directory (rm -rf node_modules dist),
Changed the package.json to match the "dependencies" and "devDependencies" as shown in comment by @intellix above.
Fixed the angular-cli.json file for changes in the environment configs (as listed in diagnostics from first time I ran ng serve after the install).

I am up and running. Hoping for smooth sailing. Thanks again for the help. Closing this one now.  :)

Same error here after upgrading to angular-cli 1.0, fixed by upgrading typescript to 2.2.0

Moving from from devDeps to dependencies as @intellix said make npm start (ng serve) work, but... Are you sure about to use angular-cli? I moved to angular/cli and it seems that everything is working fine.
Just, but perhaps is my VM, some pages not seems to have the same behavoir - slower and not events are launched -

I forgot to link to the blog post for CLI in Heroku, here it is: https://medium.com/@intellix/production-ready-angular-cli-in-heroku-4bcdc8322550
@jjorbas you need to import BrowserAnimationsModule into AppModule

Here's what worked for me:
1.) Followed the Updating Angular CLI section here
2.) Deleted node_modules folder
3.) Moved these from devDependencies to dependencies:
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",

4.) npm install

This is why I hate npm and all this stuff (yes I know it can be great)
I am following angular mobile toolkit - I only follow the first 2 steps of the tutorial and splat, nothing works,
If Typescript is a dependency and requires a certain version then npm should ruddy well update it instead of us having to google here and there to resolve it - unstructured nonsense.

This error happens from the following chunk of code:
https://github.com/angular/angular-cli/blob/master/packages/%40ngtools/webpack/src/index.ts#L8
This code is not ideal. It assumes that if anything went wrong, it is because the user didn't install the right thing. Preferably it would look at the actual error more and try to give a more helpful error message. A stack overflow answer:
http://stackoverflow.com/questions/42925690/angular2-cli-error-angular-compiler-cli-package-was-not-properly-installed/43021209#43021209
Suggest that the actual underlying problem is that some version of the package might not expose a VERSION symbol; but I have not investigated whether this is actually true.
Still, more defensive and specific error handling would help when things like this happen.

Setting up an Angular working app is still so tedious. I think this should be addressed by core team. If the team is creating an awesome product, then it should be awesome to use it too. Fixing Angular setup problems are like finding a pearl in shell. Although it gives some deeper understanding when we go under the hood, but how much man/hours we are going to spend in setting up an app. And on top of that we never know what will be changed in next release and the app will start giving such irrelevant messages which does not help a developer at all, that let us wandering. Angular QuickStart was a pain at first and now CLI too.. BTW, I have created brand new app just few moments ago after latest install of @angular/cli and it dont works.
I've applied some changes as recommended above this is how my package.json looks: I have moved    "@angular/cli": "1.0.0",   "@angular/compiler-cli": "^4.0.0" from devDependencies to Dependencies
{
"name": "shopper",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4",
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0"
},
"devDependencies": {
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
Please do something to give us time to be more creative in creating an Angular App, rather than getting frustrated setting up a working app.
With above said, I love Angular.. Suggest me some solution for my problem. Cheers !

@mutanttech I don't believe you ever really said what problem you're having. You're getting the @angular/compiler-cli package was not properly installed error?
A fresh install out of the box using CLI 1.0.0 should work.

@intellix I guess you missed out that I have mentioned in my comment "BTW, I have created brand new app just few moments ago after latest install of @angular/cli and it dont works.". And yes, I am getting the same @angular/compiler-cli package was not properly installed error?
I am using Windows 8.1 Enterprise, Node Version 6.9.5, NPM version. 3.10.1. Let me know if you require any other details. I tried to make it work today by getting latest typescript v 2.2.2. But still the same error.

Cloud 9
Ubuntu 14.04
Node 7.8.0
NPM 4.2.0
Trying to get through the Thinkster.io training and first had a lot of Peer Dependency errors.  Now,
freeredpill:~/workspace/angular2-realworld-example-app (master) $ npm uninstall --save-dev angular-cli && npm install --save-dev @angular/cli@latest
<EMAIL_ADDRESS>/home/ubuntu/workspace/angular2-realworld-example-app
└──<EMAIL_ADDRESS>npm WARN optional SKIPPING OPTIONAL DEPENDENCY<EMAIL_ADDRESS>(node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for<EMAIL_ADDRESS>wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
freeredpill:~/workspace/angular2-realworld-example-app (master) $ ng serve --host <IP_ADDRESS> --port 8080 --live-reload-port 8081
The option '--live-reload-port' is not registered with the serve command. Run ng serve --help for a list of supported options.
The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
at Object. (/home/ubuntu/workspace/angular2-realworld-example-app/node_modules/@ngtools/webpack/src/index.js:14:11)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/ubuntu/workspace/angular2-realworld-example-app/node_modules/@angular/cli/tasks/eject.js:10:19)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)

The option '--mobile' is not registered with the new command.

I had the same error. The issue was that I forgot that the project was ejected so I had to use npm run server instead of ng serve (you can not launch using ng serve if you've ejected the project). So, just double check if you're ejected or not. If you're working on multiple projects like I was, where some are ejected and some are not, it's easy to forget which ones are which and use ng serve like a reflex

FUCK!!!

Moving @angular/cli to dependencies is wrong, it belongs to devDependencies
make sure all your @angular packageas have the same version (apart from @angular/cli)
delete package-lock.json
delete node_modules
npm install

For those who are still struggling with that error
Follow this guide step-by-step
Updating Angular CLI
Just do it thoroughly and double recheck your package.json dependencies before invoking npm install.

My fix:

delete node_modules
npm cache clean --force
npm install
Up and running! P.s: Moving @angular/cli to dependencies is wrong, it belongs to devDependencies

My fix was to set production to false
sudo npm config set -g production false

{
"name": "orderflow2",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"webpack": "^3.2.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
** THESE TWO ENTRIES RESOLVED THE ERROR

"@angular/cli": "^1.2.0",
"@angular/compiler-cli": "^4.0.0",

**
"@angular/language-service": "^4.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}

I was having the same error after copying source files to a new folder for distribution.
But it was a silly error of not running npm install.
However I was getting different npm error after npm install which was resolved  - by deleting the package-lock.json

remove node_modules
 npm install
npm update
ng serve
Will Work :D

i just use this command and its work
npm install -g @angular/cli

Finally found the solution see the below screenshots and steps to resolve this issue
http://itechiesol.blogspot.com/2017/07/angular-compiler-cli-package-was-not.html

@naru6be 's solution worked for me after trying and failing with uninstall /reinstall

Thanks for your appreciation graycube

Got it fixed by executing "npm install"

This works like magic

npm install --save-dev del

Make sure you cd into the file containing the package.json

I got the same error.... i gave command

npm install

and run the server ng serve

NodeJS installed as root (sudo apt get install nodejs) caused this problem for me. Using nvm tool fixed the problem https://github.com/creationix/nvm.

lready had an existing application I wanted to start using angular-cli in. When trying to implement angular-cli for an existing application, for me, just doing npm install -g @angular/cli and then trying to use the ng commands did not work.
After installing angular-cli I did the following.
In a command line, in windows, I went to my C:\ folder and ran the command
ng new foo. After nicely scaffolding my app, I copied the necessary files from this new folder and started moving them to my existing app folder and started sorting out the issues until I got my app running fine using angular-cli. This is the solution that worked for me when trying to implement angular-cli for an already existing application. Hope it helps

running npm install --save-dev @angular/cli@latest in the project folder fixed my problem

@intellix
Thanks a million. After moving the compiler-cli to my dependencies and re-installing it with npm install --save @angular/compiler-cli my 6 hour struggle ended. Now I can relax and enjoy my gaming night.

no worries bro. In code we believe/trust/live. What's your favorite game?
On Sep 15, 2017 9:04 PM, "Imran Khan"<EMAIL_ADDRESS>wrote:

@intellix https://github.com/intellix
Thanks a million. After moving the compiler-cli to my dependencies and
re-installing it with npm install --save @angular/compiler-cli my 6 hour
struggle ended. Now I can relax and enjoy my gaming night.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/5654#issuecomment-329856369,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AbgUzhPeJ_hSfP0CQccL6Aclk-3bBjxOks5sirxEgaJpZM4MpMsX
.

@rickmutua Heroes of the Storm!

hey all,
I was sick of this kinda error. This whole process had me to install, uninstall, update etc a lot of time. but then I found the solution to this by following a few methods.
First of all, I found out that even after I had installed the @angular/cli globally my local setup wasn't able to identify a few of the dependencies like @angular/cli , @angular/compiler-cli, typescript, @angular/language-service. I found this out by executing the command "ng -v" in which it showed an error right beside these mentioned dependencies. Then I executed the command npm install @angular/cli@latest. That changed all my dependencies to v4.4.3 and all those dependencies were automatically shifted from devDependencies to Dependencies. and then when I execute "ng -v" it shows no error, all the dependencies along with their versions were displayed and finally my "ng serve " works great.
Note: It's just that some of the dependencies of angular/cli installed globally can't be fetched locally by the system and hence by installing them locally may do the trick...

Something to check - I noticed that I got this exact error message too when I forgot to run "npm install" first (whoops).

I had the same issue and I just solved it. It was related to the location of my new project. I can't create 2 angular-cli projects in the same directory.
This wasn't working for me : I tried to remove node_module and to run npm install, to reinstall @angular/compiler-cli, NOTHING WORKED.
My problem was : I was trying to create a new angular-cli project in the same directory as an other angular-cli project (that was working !). I noticed that running 'ng new my_project' this was was unuasually quick.
So I created a new folder somewhere else, and ran

ng new project_name
cd project_name
npm install
ng serve

For some reason it works now.
Is it a bug report ? Have you guys suceeded to create several angular-cli projects in the same directory ?

I experienced this issue as well.
I'm not exactly sure how to reproduce it, but this is what happened:

I got a project A created with Angular CLI, always working
I updated my global cli and created a new project B
Back in project A, I restarted the cli and then got this issue

I got this issue after I installed<EMAIL_ADDRESS>After I ran 'npm install @angular/compiler-cli', the problem is solved.
I assume it because<EMAIL_ADDRESS>need other packages for higher version .

Could you check that your "@angular/compiler" in your dependencies is compatible with angular/cli version :
https://stackoverflow.com/a/47328497/2633707


Reading order of external files (cal and info)

Right now, when a cal file or run info file are put on the command line, a sort is done on the fragment or analysis file (with it's stored cal and info), and then the command line cal and info files are loaded. This is not ideal as the info and cal might change things that affect the sort (such as mnemonic or offset). This means that we should change the order of this to:

Read tree and info stored in tree's file
Read info and cal files on command line
Do the sort

I'm working on the appropriate TGRSIint function now to make this happen.

I'm going to do this by decoupling the reading of the run info/TChannels and the creation of the fragment and analysis trees. We've had some issues with these classes reading/playing back properly in the past, so it's probably time to try to improve the readability and encapsulation of this code.


gcp-metadata unavailable, unable to determine current projectId when attempting to instantiate PubSub client

gcpMetadata.isAvailable() returning false

This issue is related to #406.

This issue is related to #406.


Improve test coverage

Codecov Report

Merging #7 (50d701d) into main (8deeb13) will increase coverage by 2.92%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   61.36%   64.28%   +2.92%
==========================================
  Files           1        1
  Lines          44       42       -2
==========================================
  Hits           27       27
+ Misses         10        9       -1
+ Partials        7        6       -1

Impacted Files
Coverage Δ

deezer/deezer.go
64.28% <ø> (+2.92%)
:arrow_up:

Continue to review full report at Codecov.

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


VS Code adds an extra single quote closing a string...

If I start with string like:
sourcePortRange: *
And then add the opening quote to start a string and then go to the end and add the closing quote, I get an extra quote that I have to delete.... eg.
sourcePortRange: '*''

@bmoore-msft Is this still an issue with latest builds?

I still see this on occasion, but have trouble repro-ing. If anyone has a consistent repro, they should share it here.

@majastrz and I figured out how to repro this consistently on Friday. It happens when you start a string completion in a blank space (without a preceeding '), and type ' plus the beginning of a string before accepting the completion - seems like the calculation on the server side is assuming the typed text does not include the first ', and is off by one.
Repro:

Start with the following (cursor at |): resource myRes |
Request completion specifically with Ctrl+. - do not type anything.
Type 'vm (including the ' at the beginning)
Accept a completion

The same behavior happens in object property completions. If you start the completion dialog after you've already typed the ' then this doesn't repro.

I've looked into this and solution is to check here: https://github.com/Azure/bicep/blob/9e308aa7b2c7317d4213fb6fc07be9938318f0e5/src/Bicep.LangServer/Completions/BicepCompletionProvider.cs#L164 if we have already opened quotation. if so, we need to provide completions without quotes.

I've looked into this and solution is to check here: https://github.com/Azure/bicep/blob/9e308aa7b2c7317d4213fb6fc07be9938318f0e5/src/Bicep.LangServer/Completions/BicepCompletionProvider.cs#L164 if we have already opened quotation. if so, we need to provide completions without quotes.


[FLINK-26371][hive] Support variable substitution for sql statement while using Hive dialect

What is the purpose of the change
To support variable substitution for sql statement while using Hive dialect.
Brief change log
Substitute the variable with actual value in sql statement while using Hive dialect before really parse it.
Verifying this change
Additional test in HiveDialectITCase.java#testStatementVariableSubstitution
Does this pull request potentially affect one of the following parts:

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

Documentation

Does this pull request introduce a new feature? no
If yes, how is the feature documented?  N/A

@flinkbot run azure


Update README

Some suggestions to improve the flow and fix an issue with the first playbook execution.

Changes look good, merged.


US 02.08.01

As a meal planner, I want to sort the list of recipes by title, preparation time, number of servings, or recipe category.
Acceptance criteria

Acceptance criteria added by Fan Zhu


[Bug]: TypeError: reduce() of empty iterable with no initial value

Is there an existing issue for the same bug?

[X] I have checked the existing issues.

Branch name
main
Commit ID
80d703f9c2251f199c3c5eecb75e5f576b8856a8
Other environment information
No response
Actual behavior
当我使用General方式解析一个docx文档时，出现以下错误，从而导致解析文件失败：
When I use the General method to parse a docx document, the following error occurs, causing the file parsing to fail:
/usr/local/lib/python3.10/dist-packages/PIL/Image.py:981: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
  warnings.warn(
Traceback (most recent call last):
  File "/ragflow/rag/svr/task_executor.py", line 147, in build
    cks = chunker.chunk(row["name"], binary=binary, from_page=row["from_page"],
  File "/ragflow/rag/app/naive.py", line 186, in chunk
    sections, tbls = Docx()(filename, binary)
  File "/ragflow/rag/app/naive.py", line 84, in __call__
    new_line = [(line[0], reduce(concat_img, line[1])) for line in lines]
  File "/ragflow/rag/app/naive.py", line 84, in <listcomp>
    new_line = [(line[0], reduce(concat_img, line[1])) for line in lines]
TypeError: reduce() of empty iterable with no initial value

这并非docx文档稳定触发的错误，而是含有特定内容的docx文档，我并没有追查是哪些内容，而是将rag/app/native.py:84
This is not an error that is stably triggered by the docx document, but rather by a docx document containing specific content. I did not investigate what content it is, but instead changed rag/app/native.py:84
new_line = [(line[0], reduce(concat_img, line[1])) for line in lines]

改为：
to:
new_line = [(line[0], reduce(concat_img, line[1], None)) for line in lines if line[1]]

从而规避该问题，请问这样做是否合适？
to avoid this issue. Is this approach appropriate?
Expected behavior
No response
Steps to reproduce
使用General方式解析特定内容的docx文件
Use the General method to parse docx file contains specific content.

Additional information
No response

Can you provide the wrong docx file?


WIP - Analysis refactor gui part7

This is NOT ready for review
I will comment with relevant information about the PR and remove the WIP tag once this is ready for review

@antgonza ready for review. In this PR I've modified the command object so it can be defined in the analysis pipeline only. This PR is also adding some of the missing files that I had locally but not in the branch to be able to execute the analysis as plugins. I've also fixed a couple of small bugs that I found on the job object.


rancher cli ignoring answers file in v0.6.4

Rancher versions:
rancher/server: 1.6.10
Steps to Reproduce:
deploy some generic stack definition using answers file. e.g.:
#docker-compose.yml file
version: "2"
services:
  mud:
    image: ubuntu:16.10
    stdin_open: true
    tty: true
    environment:
      - "MUD_URL=https://${MUD_HOSTNAME}"

#rancher-compose.yml file
.catalog:
  name: SomeApp
  version: 1.2.0-2
  minimum_rancher_version: v1.6.7
  questions:
    - variable: MUD_HOSTNAME
      label: MUD Hostname
      description: "Hostname used to access MUD (e.g.: 'mud.example.com')."
      type: string
      required: false

version: '2'
services:
  mud:
    scale: 1
    start_on_create: true

#answers file
# MUD
MUD_HOSTNAME=mud.example.com

Results:
Works as expected with:
#rancher version v0.4.1
rancher up  --env-file answers -f docker-compose.yml
INFO[0000] [0/1] [mud]: Creating
INFO[0001] [0/1] [mud]: Created
INFO[0001] [0/1] [mud]: Starting
INFO[0001] [1/1] [mud]: Started

Answers file is ignored here:
#rancher version v0.6.4
rancher up  -f docker-compose.yml -e answers
Hostname used to access MUD (e.g.: 'mud.example.com').
MUD Hostname MUD_HOSTNAME[]:
INFO[0004] Creating stack mud
INFO[0005] [mud]: Creating
INFO[0005] Creating service mud
INFO[0006] [mud]: Created
INFO[0006] [mud]: Starting

@deniseschannon need to update CLI reference of rancher-compose-executor, wait for a new release of executor

Tested with rancher v1.6.11-rc5 and CLI version v0.6.5-rc4.
Tested with example files above. The answer file was not ignored
rancher-v0.6.5-rc4 soumya$ ./rancher up -d --env-file ans1.txt -s teststack -f dc.yml --rancher-file rc.yml
INFO[0000] Creating stack teststack
INFO[0000] [mud]: Creating
INFO[0000] Creating service mud
INFO[0001] [mud]: Created
INFO[0001] [mud]: Starting
1s15

Also launched other catalogs with answer files through CLI. The answer files were not ignored.
Ex below:
rancher-v0.6.5-rc4 soumya$ ./rancher catalog install community/wordpress:v0.2-bitnami -a wp.txt
1st11

wp.txt
public_port=80
mariadb_root_password=mariadb_my_root
mariadb_user=wordpress_user
mariadb_user_password=wordpress_password
mariadb_database_name=bitnami_wordpress
wordpress_username=admin
wordpress_password=bitnami
volume_driver=local


SharePoint Framework development with SharePoint Server 2019 & SharePoint Server SE - Correct guidance on compatible Node.js versions

Category

[x] Content fix
[ ] New article

What's in this Pull Request?
SharePoint 2019 supports assets developed using SPFx v1.4.1. The existing document indicates that SPFx v1.4.1 is compatible with Node.js v1.10.x and instructs the reader to install this version on Node.js when setting up a SPFx development environment for SharePoint 2019. This is incorrect - SPFx v1.4.1 is not compatible with Node.js v1.10.x, it is only compatible with Node.js v6.x and v8.x. This updates made in this PR correct the information contained in the document in this regard.

Docs Build status updates of commit 54891c1:
:warning: Validation status: warnings

File
Status
Preview URL
Details

docs/spfx/sharepoint-2019-support.md
:warning:Warning
View
Details

docs/spfx/sharepoint-2019-support.md

Line 2, Column 1: [Warning: ms-prod-missing - See documentation] Missing attribute: 'ms.prod'. If you specify 'ms.technology', you must also specify 'ms.prod'.

For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel


THRIFT-5283: add support for Unix Domain Sockets in lib/rs

Client: rs
The Thrift crate does not support Unix Domain Sockets (UDS). After reviewing and expressing my thoughts on THRIFT-5283, I added support for UDS.
This is not a breaking change. Inspired by how actix_web::HttpServer supports UDS, I added an additional fn to listen to UDS. I reorganized some other existing code to be able to reuse it for UDS. I also had to implement the trait TIoChannel for UnixStream. This went to transport::socket.
As UnixStream is only available on Unix, I tagged the code with #[cfg(unix)]. I also cross compiled lib/rs to Windows with the following cargo targets:
i686-pc-windows-gnu
i686-pc-windows-msvc
x86_64-pc-windows-gnu
x86_64-pc-windows-msvc

Last but not least I ran the rust <-> rust test harnesses as well as the cross test harnesses. This looks good. At least, my contribution didn't introduce new fails.

[x] Did you create an Apache Jira ticket?
-> already existed as THRIFT-5283
[x] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
[x] Did you squash your changes to a single commit?  (not required, but preferred)
[x] Did you do your best to avoid breaking changes?
-> not a breaking change.

I tried to figure out why one of the Travis CI jobs failed. To be honest, I've no clue. I do not see a connection to the PR.

Actually this PR is a blocker for my osquery-rust crate. I appreciate any feedback on how to bring this PR forward.

Looks good! Suggest replacing use of comparison with "" with Option and if let for the UDS usages.
Thank you!

Thanks Allen, will do and update PR.

Looks good! Suggest replacing use of comparison with "" with Option and if let for the UDS usages.
Thank you!

Surprisingly the linter discouraged me to use if let and pointed me to .is_none() just to complain again and proposing a match statement. This didn't happen when I compiled with cargo build but when I used make to run the tests. It looks like additional rules apply depending on which tools are used.
Just for reference, the two messages I received where:
error: redundant pattern matching, consider using `is_none()`

error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.

So I used the match statement.

@tokcum Sorry for the delay, and thank you so much for your contribution!


Prettier

Is there any plan to use https://github.com/prettier/prettier for code formatting in the next version of bootstrap? Could really help for any contributions
Edit :
For anyone that stumbles upon this issue wondering what prettier is. It's an opinionated code formatter that automatically formats your code. Major project like babel and react are using it.
Blog post about it :
http://jlongster.com/A-Prettier-Formatter

In what capacity?
Documentation?
Code syntax highlighting is out of scope for bootstrap.
I'm a fan of prismjs myself

Yeah I think this is outside of the scope of Bootstrap I'd say. We don't do automagic code highlighting, and if authors want it it's easy enough to integrate.

@patrickhlauke I would like you to reconsider this. This is not code highlighting. What it does is automatically  format your code for you. Major project slike react and  babel are using it. This will greatly improved code style cobsisty across all devs that work on Js, scss

ah i see. was lacking context here.

Yes I realized that I didn't add any info.
Thank you for reopening :)

If it helps decide, Popper.js already makes use of Prettier and it works flawlessly

If anyone makes a PR, please CC me.

I made one #24323


compiler: support neo-debugger

Support debug information export.
There is no room in specification to support multiple returns, so Any (Array) type is used.
TODO

[ ] investigate event support
[ ] CLI
[ ] full end-to-end testing

There is no room in specification to support multiple returns, so Any (Array) type is used.

I think it's perfect time then to submit an issue for the spec!

I guess to be compatible with neo-debugger we also need to zip the resulting JSON.

neo-debugger supports both JSON and ZIP formats.
We can make both .zip/.json depending on the provided filename. I don't want to drop JSON because it is easier to look at and debug.

If if works with plain JSON too then we're probably fine, adding zip compression into our code doesn't make me happy either.


Sonos Roam - Hide when offline

Is your feature request related to a problem? Please describe.

When using a Sonos roam (wireless speaker), the battery level can be tracked with the following device sensor.sonos_roam_battery which reports a numeric value.
The roam also has a binary sensor which I'm trying to use with charging_state. But produces some odd results.

When the roam is ON but not playing, the binary_sensor is OFF
When the roam is ON and playing, the binary_sensor is OFF
When the roam is ON and playing/not-playing, AND charging, the binary_sensor is ON

So, the binary_sensor only reports ON when the roam is actually charging.
So if you use the charging_state and the binary_sensor, and value of "ON", it will report charging as you'd expect.
But if the roam is OFF, the binary_sensor reports "unavailable", and the UI reflects that:

Additionally I've tried using the bulk_rename to change "unavailable" to "off-line", but that doesn't work.
entities used: binary_sensor.sonos_roam_power & sensor.sonos_roam_battery.
Describe the solution you'd like

For one, it's be nice if bulk_rename would actually work for renaming the state from "unavailable" to something else.
Additionally, would be nice if there was a way to hide the offline device entirely, until it was on-line again. Kind of like the entity_filter, where it's looking for the entity to be in a certain state, before showing the card. This way you could only show the entry, if the binary_sensor.sonos_roam_power was either ON or OFF, but hide it otherwise.
Additional context

For now, this is what you see for an off-line sonos roam:

For hidding you can actually use filter-exclude so it would be something like
filter:
  exclude:
    - name: state
      value: "Unavailable"

For the different value shown in state you can try to use state_map. The bulk_rename is only for entity name - nothing else.
Try the following:
state_map:
  - from: "Unavailable"
    to: "Off-line"

I hope the above will help solving your issues. If so please close the issue

Thanks man, testing, appreciate all your work, and prompt responses on this!


Setup docs

Goal
Redo the README content to improve understanding for a new user.
Parts

[x] Fix a lot of the formatting problems across the README's: headers, syntax highlighting, indentation, etc.
[x] Add a Dockerfile for environment independent server setup
[ ] Confirm all changes work with @tylermzeller as my Android app wasn't working correctly

Remaining
Once I can talk to Tyler This should be ready to merge. Please feel free to review the changes. The largest set of changes are to the firebase/readme.md so at least look at that one 🌵

We should confirm with @jihunhamm that Docker is a good addition to this project. I have no problems working with it, but I was told that the code base should be as simple as possible.

AHH! I just remembered that Docker and Android don't work well together. That is, the Android emulator cannot run while Docker is also running. I ran into this error while trying to do work after I had installed Docker for our capstone project.

@tylermzeller I added a warning to notate that issue to the reader in server/readme.md see 16047b2

All desired parts passing. @jihunhamm could you comment on if you want the Dockerfile to run the server?
Dockerfile reasoning from @3ygun: Have an isolated docker container for the server to execute within. Implemented as Dockerfile and updated server README with setup instructions.
@tylermzeller reviewed the README changes (see branch) for most project README's in server/, firebase/, client/Android/, etc.


SA1642 - allow localized standard text

Please allow localized standard text for this rule.

@AArnott any idea how something like this would even work? Where does your team store the non-English version of the API documentation?

At Microsoft the non-English docs are authored and stored entirely independently of the source code. Basically a localization team takes our compiler-produced .xml file and translates it directly to MSDN documentation. I've never seen an xml doc file that had been translated into another xml doc comment file.
But our loc process is our own, and other companies, perhaps those working natively in a non-English language (or with customers that are not natively english) could certainly have an interest in documenting in source code in some other language as well.
To satisfy this, our StyleCop rule would need to compare the text it finds against a string resource rather than a string literal. Then we'd need to provide the translation for that string resource for each supported language. We could get the string from MSDN itself simply by looking at the translated version of the page and see what the template text is for that member type.
As for how the analyzer would know which language to fill in, perhaps we'd have to simply rely on the current thread's culture setting, which would tie it to the VS instance's language settings (e.g. tying it perhaps to the Windows user setting).
The really tricky part (I'm just thinking out loud here) would then be to not flag as an error to the user that the text is wrong when verifying later with a different culture active. So we'd have to allow all translations of the text, yet produce (in the code fix) the text with the culture that makes sense (either always English or perhaps the local culture).
Possible? yes. But I might wait to see how many others request this before starting work.

Hi, I came back to this enhancement..
Is the stylecop.json file not a solution for this?
If the default texts of all localizable rules can be overridden by the json file, this would be a solution for me.
Would this be feasible?

That sounds reasonable, as that would lock in a particular locale.

I'd be fine with the stylecop.json support as this provides at least (almost) the same functionality as StyleCop had.

Alternative proposal: The analyzer could use the language specified by the NeutralResourcesLanguageAttribute.

I think the NeutralResourcesLanguageAttribute should indicate the language of the writers of the code including the comments inside the code. How common is it that there ever a time where the resources in the code (non-satellite assembly) and the languages of the comments aren't the same language?

The summary of the attribute is: "Informs the resource manager of an app's default culture."
I think it's common to write code in english. The language of summaries, comments and resources should be the main language of the developer team to simplify the software development process. This set of texts can be translated by a translation agency.
How has StyleCop solved the problem?

Stylecop solved the problem with a configuration setting in its configuration file.

which would tie it to the VS instance's language settings

I don't think, that it's a good idea.
The better place will be stylecop.json. We have English UI both in Windows and Visual Studio (this is corporate policy), and it's convenient to have XML docs in Russian. Moreover, there are such possible cases:

source code could be accessed by Russian-speaking developer, which is located outside Russia (that is, OS location setting is not the way to go);
source code with English XML docs could be included in project.

IMO, the best way to achieve localization in StyleCop is a set of allowed cultures and appropriate resource assemblies.

Moreover this issue is the only problem that stops us from using StyleCopAnalyzers. We have a lot of comments being written in our native language, so now we have tons of rules violations (and of course we don't want to disable these rules).

Same here. Our team decided to document our code in our native language (mainly because we're dealing with a lot of legal terms that are incredibly hard to translate).
With the old StyleCop we could just set <StringProperty Name="Culture">de-DE</StringProperty> in Settings.StyleCop.

The old StyleCop/StyleCop project stores the localized versions in some ,resx files located at Project/Src/AddIns/CSharp/Analyzers. I guess you can use them as a reference. Currently they appear to support en-US (default), en-GB, de-DE, fr-FR, pl-PL, pt-BR and ru-RU.

Looking at the code, this addition looks pretty simple. PropertySummaryDocumentationAnalyzer already gets the expected strings from a resource file and it would be trivial to convert all the other classes.
The only thing left to do is to pass a settings object to those classes, add a DocumentationLocale to the settings and access the resourceFile via ResourceManager.GetString(name, culture).

Ongoing progress at https://github.com/dfyx/StyleCopAnalyzers/tree/implement-1143

Aaaaand done!

Alright, I merged your improvements.


Add modularScale

Replaces #45, adds modularScale helper!

Current coverage is 100% (diff: 100%)

Merging #48 into master will not change coverage

@@           master   #48   diff @@
===================================
  Files          11    12     +1
  Lines          30    40    +10
  Methods         0     0
  Messages        0     0
  Branches        0     0
===================================
+ Hits           30    40    +10
  Misses          0     0
  Partials        0     0

Powered by Codecov. Last update 6ce39a5...df69a75

This does not currently show the possible ratios in the documentation:

Opened an issue upstream to add support for this (https://github.com/documentationjs/documentation/issues/632), I'm hoping this will be possible. Otherwise we'll have to resort to JSDoc for this util for launch.


inserting level shifter cells

Inserting level shifters based on defined strategies in UPF.

how does this behave if you have both a level shifter and an isolation cell for the same output?

It would be helpful to have some more user documentation about our UPF support.  A high level summary of what OR supports and conceptually what it does.  We can refer people to the UPF spec for the fine details.


Label not rotate when angle is not 0

I modified the code in the ShowLabelsOnLayer.xaml, but the label does not rotate with non-zero angle value, no matter positive or negative.
This also happens for point features in my other applications, changing the angle value does not work at all.
Please let me know if this is a bug or something else also needs configuration to make it work.
Thanks!

Hi @GeoITwinkle,
We've been looking into this internally. I don't have an answer to share right now, but I've notified the relevant team and they're investigating. I also shared your Esri Community post with the team. Thank you for including the test project.
I'm hoping to share more in a few days. Thanks for your patience and thanks again for letting us know about the problem.

Hi @GeoITwinkle,
We've been looking into this internally. I don't have an answer to share right now, but I've notified the relevant team and they're investigating. I also shared your Esri Community post with the team. Thank you for including the test project.
I'm hoping to share more in a few days. Thanks for your patience and thanks again for letting us know about the problem.

Thank you for your follow up. It is not urgent at the moment, but I think it is worth looking into. Thanks!

@GeoITwinkle I confirmed that ArcGIS Runtime currently does not support rotated labels for polygon features. I'll make a note internally to update the sample to make that clearer.
For point features, angles are supported but they need to be specified differently. The following shows an example label definition for point features:
        private const string LabelJson =
@"{
    ""labelExpressionInfo"":{""expression"":""'Label'""},
    ""labelAngleInfo"":
        {
            ""angleExpressionInfo"": {""expression"":""75"",""returnType"":""number""},
            ""rotationType"":""arithmetic""
        },
    ""textLayout"":""straight"",
    ""labelPlacement"":""esriServerPointLabelPlacementAboveRight"",
    ""symbol"":
        {
            ""borderLineSize"":0,
            ""color"":[255,0,0,255],
            ""font"":
                {
                    ""decoration"":""none"",
                    ""size"":10,
                    ""style"":""normal"",
                    ""weight"":""normal""
                },
            ""horizontalAlignment"":""center"",
            ""type"":""esriTS"",
            ""verticalAlignment"":""middle"",
            ""xoffset"":0,
            ""yoffset"":0
        }
}";

Note that the textLayout field is required for label rotation to work in this case, and that labelPlacement must match the geometry type for the layer. labelingInfo documentation has a list of acceptable values.

@nCastle1  Thanks Nathan. I will modify the code and see how it goes.
By the way, there is no "LabelAngleInfo" or "textLayout" mentioned in the "labelingInfo documentation" webpage. Probably some kind of update is needed there. Otherwise developers will look into the Angle property of Text Symbol.
One more question: since Polygon feature is not supported for rotation, what about Polyline features?
Thanks.

@GeoITwinkle Thanks, I'll let the team know about the lack of documentation for those properties.
Angle rotation appears to work for polylines when using the point labelPlacement options:
private const string LabelJson =
@"{
    ""labelExpressionInfo"":{""expression"":""'Label'""},
    ""labelAngleInfo"":
        {
            ""angleExpressionInfo"": {""expression"":""10"",""returnType"":""number""},
            ""rotationType"":""arithmetic""
        },
    ""textLayout"":""straight"",
    ""labelPlacement"":""esriServerPointLabelPlacementAboveRight"",
    ""symbol"":
        {
            ""borderLineSize"":0,
            ""color"":[255,0,0,255],
            ""font"":
                {
                    ""decoration"":""none"",
                    ""size"":10,
                    ""style"":""normal"",
                    ""weight"":""normal""
                },
            ""horizontalAlignment"":""center"",
            ""type"":""esriTS"",
            ""verticalAlignment"":""middle"",
            ""xoffset"":0,
            ""yoffset"":0
        }
}";

When using the line labelPlacement options (e.g. esriServerLinePlacementBelowEnd), the label is aligned with the polyline regardless of the specified angle.
Let me know if you have any other questions and I'll do my best to get them answered.
One more thing: I can't share full details yet, but there are changes to the API for labeling in Runtime planned for a future release. I recommend keeping an eye on the blog for some exciting announcements.

@nCastle1 Hi Nathan, I tried point and polyline features and they both work. Although the rotation is somehow interesting, it does not matter now. For future changes, I hope it can provide accessible classes/properties to configure instead of json, will keep an eye on the blog. Thanks again for your help!


missing type is not inferred correctly

{"properties": {"foo": {"type": "string"}}, "required": "foo"} is recognized by json schema validators as being a JSON object, but jsonschema-gentypes converts that into Any
I cannot find any indication in the spec as to why type can be omitted. Perhaps it is an artifact of older specs?

I think what is incorrect or at least suboptimal is that the required property "foo" is not enforced by the generated types even though jsonschema is unambigous about the fact that it is required. That must be the reason why every implementation of jsonschema validation I have seen does have type inferrence rules, because otherwise it's not possible to do something useful with the above example. There is no chance that a schema can allow the payload to be both an integer and have a required property "foo", anyway.
On Wed, May 10, 2023, at 17:07, Stéphane Brunner wrote:

I didn't see any clear official documentation, but I found that:
OAI/OpenAPI-Specification#1388 (comment) https://github.com/OAI/OpenAPI-Specification/issues/1388#issuecomment-339061316
Then the implementation is correct :-)
—
Reply to this email directly, view it on GitHub https://github.com/sbrunner/jsonschema-gentypes/issues/469#issuecomment-1542378162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGMPRJVAY5JO2FHJOBJKKTXFOVKPANCNFSM6AAAAAAX42RDAE.
You are receiving this because you authored the thread.Message ID: @.***>

both are correct because type is not required. the question is whether the output types are optimal, and I don't think they are. in practice it is not possible to send an integer with this schema due to the required type.
it's not an important issue because I've now made it a policy in my project to add type everywhere, but it is something I only had to do for jsonschema-gentypes (again, schema validators work fine without type)
On Wed, May 10, 2023, at 17:48, Stéphane Brunner wrote:

As I understand, the correct schema for that is:
{
"type": ["object", "integer"],
"properties": {"foo": {"type": "string"}},
"required": "foo",
}
See: https://json-schema.org/understanding-json-schema/reference/type.html
—
Reply to this email directly, view it on GitHub https://github.com/sbrunner/jsonschema-gentypes/issues/469#issuecomment-1542435034, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGMPRL4JUTMP3VRNYCK2ATXFO2ELANCNFSM6AAAAAAX42RDAE.
You are receiving this because you authored the thread.Message ID: @.***>

I think the problem is not that anybody here is "incorrect" as per spec, but that the spec allows one to write self-contradictory schemas. For example, what does {"type": "integer", "required": ["foo"]} mean? An integer with a property?
On Wed, May 10, 2023, at 18:07, Stéphane Brunner wrote:

Finally, I realize what they say with Any it means kind of ["string", "number", "integer", "object", "array", "boolean", "null"] I will see to resolve this issue, thanks :-)
—
Reply to this email directly, view it on GitHub https://github.com/sbrunner/jsonschema-gentypes/issues/469#issuecomment-1542468150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGMPRM3O6LMWCNF6OPYE4TXFO4MVANCNFSM6AAAAAAX42RDAE.
You are receiving this because you authored the thread.Message ID: @.***>

I found another problem. In the generated code, Any incorrectly imported:
jsonschema-gentypes --json-schema <(echo '{}') --python=/dev/stdout

Produces:
_Root = Any

without any preceding import

This should be fixed with the last version, isn't it?

That works, thank you!
On Thu, May 11, 2023, at 14:48, Stéphane Brunner wrote:

Closed #469 https://github.com/sbrunner/jsonschema-gentypes/issues/469 as completed via #470 https://github.com/sbrunner/jsonschema-gentypes/pull/470.
—
Reply to this email directly, view it on GitHub https://github.com/sbrunner/jsonschema-gentypes/issues/469#event-9222075579, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGMPRNR4KY65WGASSBTI4TXFTNZBANCNFSM6AAAAAAX42RDAE.
You are receiving this because you authored the thread.Message ID: @.***>


RFM - nasm

I DON'T Want To Become The Maintainer

[x] I have followed the Package Triage Process and I do NOT want to become maintainer of the package;
[x] There is no existing open maintainer request for this package;

Checklist

[x] Issue title starts with 'RFM - '

Existing Package Details
Package URL: https://chocolatey.org/packages/nasm
Package source URL:  https://github.com/andyli/nasm-choco
Date the maintainer was contacted (in YYYY-MM-DD): 2021-09-03
How the maintainer was contacted:  E-mail via package index page's 'Contact Maintainers' link.

Contact attempt 2:

2021-09-11
Pull request to package source repository.

I'm ready to submit.  Do I need to do anything else to be made a maintainer?  I thought claiming it (above) was enough.

I've sent an invitation.

Updated package submitted.

Thanks for picking up this package @teknowledgist


Add profile for Data-Warehouse GmbH

Automatically generated pull request to add profile for Data-Warehouse GmbH according to application pkic/members#207.
This closes pkic/members#207

@skambia uncountably I was unable to find an SVG based logo on the website for Data-Warehouse GmbH, can you provide us with an SVG or other vector based logo?


Add GameStyle property

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: jamesmossmanjowett sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.


Validate HTML

With this PR, all HTML generated during the test run will be validated (with HTML-validate).
The bulk of the PR is fixes to various templates, so they actually validate.
This increases the run time of the test suite from ~20 minutes to ~24 minutes on my system. I consider this acceptable and have hence enabled this by default. There is a --no-validate-html option to turn validation off.

I think we can merge this now. I'll restructure the option that's being bolted onto settings later (it should go into the construction of our specialized template engine.


updates project setup

adds MIT LICENSE
adds Build.xcconfig for cross-platform development
adds workspace to better integrate with Swift packages
defines Template Macros for source file header
updates existing source files to use common header

Previous PR was closed automatically due to a commit.


Skip user data if the module is disabled

what

Skip the import of the user data file if the module is disabled

why

It triggers unnecessary plan changes even if the module is disabled
Pollutes the state when using different workspaces

references

https://github.com/cloudposse/terraform-aws-ec2-bastion-server/issues/20

/test all

/rebuild-readme

/test all

@alexandrusavin thanks for your contribution!


cleanup docs job

closes #588
Prerequisites:

[x] Unless it is a documentation hotfix it should be merged against the dev branch
[x] Branch is up-to-date with the branch to be merged with, i.e. dev
[x] Build is successful
[x] Code is cleaned up and formatted

Summary
removes the CI docs job, since GitHub now supports specifying the /docs directory as base directory: https://github.com/cmu-delphi/delphi-epidata/settings/pages -> needs to be changed

note:
I just changed the GitHub setting:


Extensions cannot be placed in the shipping address section of checkout

Initially flagged here along with a follow up screenshot here

Hey @nboliver @gil-- . The fix has shipped for this issue. Thanks again for your feedback.

Hey @nboliver @gil-- . The fix has shipped for this issue. Thanks again for your feedback.


Exposing config to implement custom Encode/Decode

I am trying to create custom Encode/Decode implementations for types in other crates that I'd like to use. However, I cant access the configuration as done on the impls.rs file of the encoder. How can I access the config (endianess, fixed/varint, etc) to write the data from the external type according to the config of the encoder/decoder?

Which config flags do you need access to?
We should be able to add functions to the [Config]*https://docs.rs/bincode/2.0.0-rc.2/bincode/config/trait.Config.html) trait, which should mean that we're always forward compatible. Something like:
diff --git a/src/config.rs b/src/config.rs
index bb3129f..9ff29fd 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -191,6 +191,11 @@ impl<E, I, A, L> Configuration<E, I, A, L> {
     }
 }

+pub enum Endianness {
+    Big,
+    Little,
+}
+
 /// Indicates a type is valid for controlling the bincode configuration
 pub trait Config:
     InternalEndianConfig
@@ -200,16 +205,21 @@ pub trait Config:
     + Copy
     + Clone
 {
+    fn endianness(&self) -> Endianness;
 }

-impl<T> Config for T where
+impl<T> Config for T
+where
     T: InternalEndianConfig
         + InternalArrayLengthConfig
         + InternalIntEncodingConfig
         + InternalLimitConfig
         + Copy
-        + Clone
+        + Clone,
 {
+    fn endianness(&self) -> Endianness {
+        <T as InternalEndianConfig>::ENDIAN
+    }
 }

 /// Encodes all integer types in big endian.
@@ -217,7 +227,7 @@ impl<T> Config for T where
 pub struct BigEndian {}

 impl InternalEndianConfig for BigEndian {
-    const ENDIAN: Endian = Endian::Big;
+    const ENDIAN: Endianness = Endianness::Big;
 }

 /// Encodes all integer types in little endian.
@@ -225,7 +235,7 @@ impl InternalEndianConfig for BigEndian {
 pub struct LittleEndian {}

 impl InternalEndianConfig for LittleEndian {
-    const ENDIAN: Endian = Endian::Little;
+    const ENDIAN: Endianness = Endianness::Little;
 }

 /// Use fixed-size integer encoding.
@@ -275,20 +285,14 @@ impl<const N: usize> InternalLimitConfig for Limit<N> {
 }

 mod internal {
-    use super::Configuration;
+    use super::{Configuration, Endianness};

     pub trait InternalEndianConfig {
-        const ENDIAN: Endian;
+        const ENDIAN: Endianness;
     }

     impl<E: InternalEndianConfig, I, A, L> InternalEndianConfig for Configuration<E, I, A, L> {
-        const ENDIAN: Endian = E::ENDIAN;
-    }
-
-    #[derive(PartialEq, Eq)]
-    pub enum Endian {
-        Little,
-        Big,
+        const ENDIAN: Endianness = E::ENDIAN;
     }

     pub trait InternalIntEncodingConfig {

@ZoeyR what do you think?

Which config flags do you need access to?
We should be able to add functions to the Config trait, which should mean that we're always forward compatible. Something like:
diff --git a/src/config.rs b/src/config.rs
index bb3129f..9ff29fd 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -191,6 +191,11 @@ impl<E, I, A, L> Configuration<E, I, A, L> {
     }
 }

+pub enum Endianness {
+    Big,
+    Little,
+}
+
 /// Indicates a type is valid for controlling the bincode configuration
 pub trait Config:
     InternalEndianConfig
@@ -200,16 +205,21 @@ pub trait Config:
     + Copy
     + Clone
 {
+    fn endianness(&self) -> Endianness;
 }

-impl<T> Config for T where
+impl<T> Config for T
+where
     T: InternalEndianConfig
         + InternalArrayLengthConfig
         + InternalIntEncodingConfig
         + InternalLimitConfig
         + Copy
-        + Clone
+        + Clone,
 {
+    fn endianness(&self) -> Endianness {
+        <T as InternalEndianConfig>::ENDIAN
+    }
 }

 /// Encodes all integer types in big endian.
@@ -217,7 +227,7 @@ impl<T> Config for T where
 pub struct BigEndian {}

 impl InternalEndianConfig for BigEndian {
-    const ENDIAN: Endian = Endian::Big;
+    const ENDIAN: Endianness = Endianness::Big;
 }

 /// Encodes all integer types in little endian.
@@ -225,7 +235,7 @@ impl InternalEndianConfig for BigEndian {
 pub struct LittleEndian {}

 impl InternalEndianConfig for LittleEndian {
-    const ENDIAN: Endian = Endian::Little;
+    const ENDIAN: Endianness = Endianness::Little;
 }

 /// Use fixed-size integer encoding.
@@ -275,20 +285,14 @@ impl<const N: usize> InternalLimitConfig for Limit<N> {
 }

 mod internal {
-    use super::Configuration;
+    use super::{Configuration, Endianness};

     pub trait InternalEndianConfig {
-        const ENDIAN: Endian;
+        const ENDIAN: Endianness;
     }

     impl<E: InternalEndianConfig, I, A, L> InternalEndianConfig for Configuration<E, I, A, L> {
-        const ENDIAN: Endian = E::ENDIAN;
-    }
-
-    #[derive(PartialEq, Eq)]
-    pub enum Endian {
-        Little,
-        Big,
+        const ENDIAN: Endianness = E::ENDIAN;
     }

     pub trait InternalIntEncodingConfig {

@ZoeyR what do you think?

The endianness and fixed/variable length encoding options should be all

Why do you need these config items yourself? The design of Config assumed that any custom implementations of Encode/Decode would eventually encode primitive types, which already respect the Config. Can you provide an example of what you want to encode?

Why do you need these config items yourself? The design of Config assumed that any custom implementations of Encode/Decode would eventually encode primitive types, which already respect the Config. Can you provide an example of what you want to encode?

https://docs.rs/ethers-core/latest/ethers_core/types/struct.U256.html
I'm trying to encode a uint256 type, which supports directly converting into little or big endian

I've been working on a patch to teach async-bincode to directly use a bincode configuration, and for that I need access to the configured limit. This is required because the buffer that async-bincode reads into needs to respect the same limit. The only way I can see to do this with a nice API is to be able to pass a Config and then read the limit from it.

I think it's fine to add helper functions to return certain config values, maybe with a big message that we can change the config values (but honestly I don't expect we will)
Something like
    const fn endianness(&self) -> Endianness {
        <T as InternalEndianConfig>::ENDIAN
    }
    const fn int_encoding(&self) -> IntEncoding {
        <T as InternalIntEncodingConfig>::INT_ENCODING
    }

Maybe we should add #[non_exhaustive] to Endianness and IntEncoding  as well

Should I provide a patch?


Preserve script array when serialized

I'm facing two issues with javascript arrays. The first one is the array is being serialized as object (using Newtonsoft.Json).
JS Code
function main() {
    let obj = {
        name: "Hello World"
    }

    return [obj]
}

C# Code
using (var engine = new V8ScriptEngine()) {
    engine.execute(jsCode);

    Newtonsoft.Json.JsonConvert.Serialize(engine.Script.main());
}

Output
{
    "0": {
        "name": "Hello World"
    }
}

Expected:
[
   { "name": "Hello World" }
]

I need to serialize it correctly, since I'm gonna store the result in mongodb. I don't need to access the data on c# side, my (c#) function just grab the data and save in mongodb.
Array Loop
The other issue is, I can't use  for (let x in y). However, a workaround I found is to use forEach.
let arr = ['hello', 'world'];

for (let s in arr) {
    Console.WriteLine(s);
}

// Output:
// 0
// 1
// 0
// 1
// ... bunch of 0's and 1's

arr.forEach(s => {
    Console.WriteLine(s);
});

// Output:
// hello
// world

Hi @MestreKarin,
ClearScript doesn't convert script arrays to .NET arrays, as it favors providing full access to script objects over automatic conversion.
If you must use Json.NET to serialize the result, you can use a method like this one:
private static object ConvertArray(object arg) {
    if (arg is ScriptObject) {
        dynamic scriptObject = arg;
        if (scriptObject.constructor.name == "Array") {
            int length = Convert.ToInt32(scriptObject.length);
            var array = new object[length];
            for (var index = 0; index < length; ++index) {
                array[index] = scriptObject[index];
            }
            return array;
        }
    }
    return arg;
}

And then:
Console.WriteLine(JsonConvert.SerializeObject(ConvertArray(engine.Script.main())));

On the other hand, if the result never includes .NET objects, you'll get better performance from JavaScript's JSON.stringify, especially for large arrays:
Console.WriteLine(engine.Script.JSON.stringify(engine.Script.main()));

As for your second question, aside from the call to Console.WriteLine, ClearScript is not involved in the processing of your JavaScript samples. The behavior of the for...in statement, when applied to a script object, is not under ClearScript's control. Consider using for...of instead.
Good luck!

My bad, I tought that we could use for...in with arrays.
For serializing, I will use the JSON.stringify and deserialize in c# and then save to database.
Thank you.


Prefix Lightning App environment variables

Proposed refactor
Prefix environment variables to indicate they are set by Lightning.
Motivation

For debugging purposes: I can easily grep for the prefix
Avoids accidental clashes (which could be incredibly difficult to debug).

Pitch
Rename all environment variables by prefixing "LAI_"

If you enjoy Lightning, check out our other projects! ⚡

Metrics: Machine learning metrics for distributed, scalable PyTorch applications.

Lite: enables pure PyTorch users to scale their existing code on any kind of device while retaining full control over their own loops and optimization logic.

Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, fine-tuning, and solving problems with deep learning.

Bolts: Pretrained SOTA Deep Learning models, callbacks, and more for research and production with PyTorch Lightning and PyTorch.

Lightning Transformers: Flexible interface for high-performance research using SOTA Transformers leveraging PyTorch Lightning, Transformers, and Hydra.

cc @borda

I'd like to take this up. I would really appreciate some clarification on the same, I'm looking through all the export commands in the code, how do I know which specific ones to update?


Fix | Revert Event source changes on TryBeginExecuteEvent and WriteEndExecuteEvent to address the failure on other MS products.

Other Microsoft products such as OpenTelemetry and Application Insight are facing difficulties in their products with the changes made to EventSource in v3.0.0.
This PR reverts those changes to accept:

ObjectId
DataSource
Database
CommandText

variables for TryBeginExecuteEvent and

ObjectId
CompositeState
SqlExceptionNumber

variables for TryEndExecuteEvent
@mbakalov can you check the changes from this build and confirm if the issue is resolved.

Interesting problem. Was it an issue because the connection id was added in the middle of the argument list or would any change at all cause issues?
It is unfortunate that we can't make the events richer. Can AppInsights and OpenTelemetry suggest ways that we can enhance the traces without breaking them?

Interesting problem. Was it an issue because the connection id was added in the middle of the argument list or would any change at all cause issues?

I do not have much detail on the problem, but apparently Expected payload for the BeginExecute is:

ObjectId
DataSource
Database
CommandText

And for EndExecute accordingly is:

ObjectId
CompositeState bitmask (0b001 -> successFlag, 0b010 -> isSqlExceptionFlag , 0b100 -> synchronousFlag)
SqlExceptionNumber

I think their are waiting those values in their own event listener.
I have tried to add the Message  to the event attribute, but there were some limitation the string should be constant and I was not able to add caller class name to the printed out message. I am still not sure if we could keep the message in there. If that is the case I can add a similar function for our use with a different name.

I've asked on the original issue in OpenTelemetry, hopefully we can get some useful feedback.

Cross-posting from the comment in the Otel issue: if you add additional payload at the end then it should be good enough to satisfy both OpenTelemetry and AppInsights. Hopefully this way works for everyone!
Happy to test out any changes to verify both OpenTelemetry and AppInsights.

Excellent, so we can just swap the field order around and it should be ok. The question is whether we want to do the same thing for all the events in SqlClient @JRahnama.

Excellent, so we can just swap the field order around and it should be ok. The question is whether we want to do the same thing for all the events in SqlClient

I will fix the part related to the recent request, I am not sure what you mean about all the events in
sqlClient. If you can elaborate a bit more I can start working on it if the team approves it.

I am not sure what you mean about all the events in sqlClient. If you can elaborate a bit more I can start working on it if the team approves it.

I thought there were other trace methods which took the connection id guid. I've looked and there don't seem to be, I was just mistaken.
Just changing BeginExecute to the version which has 4 payload items is enough, then the TryBeginExecute can call that one. Same pattern with EndExecute.

@mbakalov If you want to test the version from this PR the artifacts are at https://dev.azure.com/sqlclientdrivers-ci/7540d8a3-c1bc-4428-a007-d4b50b7762f4/_apis/build/builds/38263/artifacts?artifactName=Nuget&api-version=6.0&%24format=zip . There's a major version release coming up and I'm not sure if this can be pushed in at the last minute but if it can it'd be nice to get it done as soon as possible.

@Wraith2 - it would be nice to include this is possible!
Confirming that OpenTelemetry's tests are now passing with this new package version (they were failing on 3.0.0 before). I've not checked AppInsights yet, will try to do a bit later today.
cc @JRahnama

Confirming this fixes the Application Insights issue https://github.com/microsoft/ApplicationInsights-dotnet/issues/2346 as well, verified with a simple web app: dependency is captured using sqlclient 2.1.3, then not captured using 3.0.0, then again captured using the ci nuget.

A freindly reminder: don't forget to add a complimentary note over this class and explain the
considerable criteria related to OpenTelemetry and Application

There was an older EventSource version in the driver and it used to capture events for BeginExecute and EndExedute and nothing else. Most of the other teams were using that EventSource not the one recently added to the driver. A related comment is added to the Begin/End execute. Do you want me to add the comment to the entire class?

Yes, please. There is no guarantee it remains the same. So, it'd better have a general idea over the class with useful links for further changes to prevent any regression.


Do not pass /dev/shm as a 9p mount.

/dev/shm is passed in the OCI spec as a bind mount. We need to make sure that this is handled purely in the guest and not passed as 9p mount from the host side.

Closing this, meant to open this on kata.