text:
I suggests adding a new API endpoint to facilitate the dispatching of workflows. It empowers developers and teams to automate repetitive tasks and orchestrate complex workflows efficiently.

          I suggests adding a new [API endpoint](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event) to facilitate the dispatching of workflows. It empowers developers and teams to automate repetitive tasks and orchestrate complex workflows efficiently.

Create a workflow dispatch event
Payload:
POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
Content-Type: application/json
Authorization: Bearer <token>

{
  "ref": "main",
  "inputs": {
    "param1": "value1",
    "param2": "value2"
  }
}

Permissions:

"Actions" repository permissions (write)

Additional endpoints:

Enable workflow (PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable)
Disable workflow (PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable)
Get a workflow (GET /repos/{owner}/{repo}/actions/workflows/{workflow_id})
Get workflow usage (GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing)
List repository workflows (GET /repos/{owner}/{repo}/actions/workflows)

Originally posted by @bencurio in https://github.com/go-gitea/gitea/issues/28163#issuecomment-2202120215

Congratulations for the longest issue title 🎉


text:
drone not able to auth via oauth2

drone:latest can login to gitea:latest, i'm create app in gitea oauth2 screnn and set env varaibles for drone, but when i'm authorize drone i get error:
Login Failed. unauthorized_client: client is not authorized
May 14 01:24:09 central01.z1.unistack.org dockerd-current[1517]: [Macaron] 2019-05-13 22:24:09: Completed POST /login/oauth/access_token
 400 Bad Request in 114.064282ms
May 14 01:24:09 central01.z1.unistack.org docker[15577]: [Macaron] 2019-05-13 22:24:09: Completed POST /login/oauth/access_token 400 Bad
 Request in 114.064282ms
May 14 01:24:09 central01.z1.unistack.org dockerd-current[1517]: ERRO[0252] oauth: cannot exchange code: GkQ1EgbX-ZmG8PCfi0IYWiK2T9ICbIo
QSQi4uI-0c94=: unauthorized_client: client is not authorized

I do not know for sure for latest of gitea version but version 1.8.1 can work again with drone.

All works fine now

I'm still experiencing this issue:
gitea_1        | [Macaron] 2019-09-10 10:47:17: Started POST /login/oauth/grant for XXX.XXX.XXX.XXX
gitea_1        | [Macaron] 2019-09-10 10:47:17: Completed POST /login/oauth/grant 302 Found in 36.181938ms
gitea_1        | [Macaron] 2019-09-10 10:47:17: Started GET /login/oauth/access_token for 172.20.0.1
gitea_1        | [Macaron] 2019-09-10 10:47:17: Completed GET /login/oauth/access_token 404 Not Found in 12.233255ms
drone_1        | {"level":"error","msg":"oauth: cannot exchange code: 2VQ4KdZ <...> 5RKYf98wJSMk=: : ","time":"2019-09-10T10:47:17Z"}

Redirects are working fine. Any ideas?

pump

@sleepycodernotes IMHO this was an issue that should be fixed by now.
See Drone issue 2704 for more information.
See this comment for a description how to configure it properly.

Using latest images : gitea/drone/treafik/portainer

Did you follow the explanation I linked to? https://github.com/drone/drone/issues/2704#issuecomment-552084152 / https://github.com/go-gitea/gitea/issues/6883#issuecomment-492112398
If you have a firewall: did you ensure that both containers can connect to each other?

i did
i'm using windows 10 wsl 2, dont know where to look

I'm not a Windows user but for testing whether the firewall might be the reason, you know, you could simply search in the internet.

as i understand windows firewall give permission to docker, i run docker-compose in ubuntu and can access all images from windows. All images are in same network

In that case I can't help you. But it still looks like a network error (because it says connection refused in your screenshot).

I'm having a similar issue, which i'm not able to work around.
I use gitea, drone and traefik (latest) and want to make the oauth2 flow working.
I'm able to request access to drone from gitea, but the final redirect fails with:
Login Failed. Post "https://git.<internaldomain>/login/oauth/access_token": dial tcp: lookup git.<internaldomain> on 127.0.0.11:53: no such host
It seems like drone is not able to resolve the internal domain for gitea from within the container in the last step.
This is my docker-compose configuration for drone.
 drone-server:
        image: drone/drone:latest
        volumes:
          - ./drone-data:/var/lib/drone/
          - /var/run/docker.sock:/var/run/docker.sock
        restart: always
        environment:
          - DRONE_SERVER_HOST=drone.<internaldomain>
          - DRONE_SERVER_PROTO=https
          - DRONE_LOGS_DEBUG=true
          #GITEA Settings
          - DRONE_GITEA_SERVER=https://git.<internaldomain>
          - DRONE_GITEA_CLIENT_ID=677d401a-1f97-400f-92c5-2008134c819f
          - DRONE_GITEA_CLIENT_SECRET=qQ0FOe7JXDd3vYw5ty3RkQk6FRPnxW_82fvNgPLCr20=
          - DRONE_RPC_SECRET=39b27c73abdb5fbde740a399d5b3d3fc
        labels:
          - "traefik.enable=true"
          #  Router to forward Port 80 tto 443
          - "traefik.http.routers.drone80.rule=Host(`drone.<internaldomain>`)"
          - "traefik.http.routers.drone80.entrypoints=web"
          - "traefik.http.routers.drone80.middlewares=httpsredirect"
          - "traefik.http.middlewares.httpsredirect.redirectscheme.scheme=https"
          - "traefik.http.middlewares.httpsredirect.redirectscheme.permanent=true"
          #  Route which handles HTTPS Traffic
          - "traefik.http.services.drone.loadbalancer.server.port=80"
          - "traefik.http.services.drone.loadbalancer.server.scheme=http"
          - "traefik.http.routers.drone.tls=true"
          - "traefik.http.routers.drone.rule=Host(`drone.<internaldomain>`)"
          - "traefik.http.routers.drone.entrypoints=websecure"

And this one for Gitea
    gitea:
      image: gitea/gitea:latest
      environment:
        - USER_UID=1000
        - USER_GID=1000
        - DOMAIN=git.<internaldomain>
        - SSH_DOMAIN=git.<internaldomain>
      restart: always
      volumes:
        - ./gitea:/data
        - /etc/timezone:/etc/timezone:ro
        - /etc/localtime:/etc/localtime:ro
      ports:
        #- "3000:3000"
        - "222:22"
      labels:
        - "traefik.enable=true"
        #  Router to forward Port 80 tto 443
        - "traefik.http.routers.git80.rule=Host(`git.<internaldomain>`)"
        - "traefik.http.routers.git80.entrypoints=web"
        - "traefik.http.routers.git80.middlewares=httpsredirect"
        - "traefik.http.middlewares.httpsredirect.redirectscheme.scheme=https"
        - "traefik.http.middlewares.httpsredirect.redirectscheme.permanent=true"
        #  Route which handles HTTPS Traffic
        - "traefik.http.services.git.loadbalancer.server.port=3000"
        - "traefik.http.services.git.loadbalancer.server.scheme=http"
        - "traefik.http.routers.git.tls=true"
        - "traefik.http.routers.git.rule=Host(`git.<internaldomain>`)"
        - "traefik.http.routers.git.entrypoints=websecure"

source: gharchive/issue

authors: BenMatheja DblK PhilsLab alexanderadam sleepycodernotes vtolstov

repo: go-gitea/gitea

license: MIT

license_type: permissive

license_source: github-api


text:
Various fixes in login sources

Several fixes in login sources affecting PAM and SMTP authentication.

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@0b74dfe). Click here to learn what that means.
The diff coverage is 50%.

@@            Coverage Diff            @@
##             master   #10428   +/-   ##
=========================================
  Coverage          ?   43.67%
=========================================
  Files             ?      586
  Lines             ?    81386
  Branches          ?        0
=========================================
  Hits              ?    35544
  Misses            ?    41439
  Partials          ?     4403

Impacted Files
Coverage Δ

modules/notification/webhook/webhook.go
40.66% <50%> (ø)

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 0b74dfe...905b058. Read the comment docs.

source: gharchive/pull-request


text:
Make Ctrl+Enter (quick submit) work for issue comment and wiki editor

This PR uses a more general method to handle quick submit  (Ctrl+Enter or Cmd+Enter).
With this PR, the editor for Edit Comment can respond to quick submit (which didn't before)
Partially fixes:

#14843

Then all the forms mentions in #14843 can be improved to benefit the quick submit after this PR.
This PR also removes the required SubmitReviewForm.Type check, now empty type (triggered by quick submit) means "comment".

Updated. And add js-quick-submit  class to more textareas

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@bcf13b6). Click here to learn what that means.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main   #19729   +/-   ##
=======================================
  Coverage        ?   47.35%
=======================================
  Files           ?      958
  Lines           ?   133603
  Branches        ?        0
=======================================
  Hits            ?    63268
  Misses          ?    62676
  Partials        ?     7659

Impacted Files
Coverage Δ

services/forms/repo_form.go
40.76% <0.00%> (ø)

Continue to review full report at Codecov.

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

:rocket:

authors: 6543 codecov-commenter wxiaoguang


text:
Try to catch more broken translations

Result: #23866
Gitea should drop the ` as string quoter, it is not recognized by Crowdin and it causes problem for translators.

Codecov Report

Merging #23867 (1b50355) into main (f521e88) will decrease coverage by 0.15%.
The diff coverage is 28.82%.

@@            Coverage Diff             @@
##             main   #23867      +/-   ##
==========================================
- Coverage   47.14%   46.99%   -0.15%
==========================================
  Files        1149     1158       +9
  Lines      151446   153187    +1741
==========================================
+ Hits        71397    71993     +596
- Misses      71611    72700    +1089
- Partials     8438     8494      +56

Impacted Files
Coverage Δ

cmd/dump.go
0.66% <0.00%> (-0.01%)
:arrow_down:

cmd/mailer.go
0.00% <0.00%> (ø)

cmd/manager.go
0.00% <0.00%> (ø)

cmd/manager_logging.go
0.00% <0.00%> (ø)

cmd/migrate_storage.go
5.76% <0.00%> (-0.12%)
:arrow_down:

cmd/restore_repo.go
0.00% <0.00%> (ø)

cmd/web.go
0.00% <0.00%> (ø)

models/actions/run.go
1.63% <0.00%> (-0.10%)
:arrow_down:

models/actions/runner.go
1.44% <ø> (ø)

models/packages/package.go
45.45% <0.00%> (-1.13%)
:arrow_down:

... and 66 more

... and 71 files with indirect coverage changes
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

authors: codecov-commenter wxiaoguang


text:
Show explanation if user cannot add new email

This change concerns the "Manage Email Addresses" submenu
in the Account settings.

I do not think it is right to merge some "unclear" changes into code base.
I will figure out this problem by a new PR.

I think I understand the problem now.
->  Clarify the reason why the user can't add a new email if there is a pending activation #25509

Thanks for this PR. I will close it in favour of the other PR.

authors: n0toose techknowlogick wxiaoguang


text:
Preconfigure OAuth Git credential helpers

OAuth Git credential helpers are universally useful so preregister on every instance. https://git-scm.com/doc/credential-helpers
Fixes #25189

Tested, working

I'm not a fan of that approach, because even if the admin explicitly deletes that OAuth application, it reappears on restart. I don't think that's wanted behavior.
How about the following idea:

Add a (prechecked?) checkbox on installation page if OAuth applications for git credential helpers should be created
Create them directly after install
Add a gitea admin subcommand to create the OAuth applications for existing instances or if they were deleted previously

Or we can have a configuration to enable/disable the feature.

The problem as it seems to me is that our system of OAuth applications isn't made for preconfigured ones.
If we make a configuration option for this, we'd have to decide how to handle if something changes manually, for example an admin deletes one of the predefined OAuth apps while keeping the configuration parameter. This would probably result in the same thing I described in my previous comment - deleted OAuth apps reappearing again.
What we could do is creating another field for OAuth apps where we set whether they are visible are hidden in the UI.
I still think the best way to do it though would be a checkbox on the installation page, and then we maybe could add a button in the OAuth apps UI to recreate those OAuth apps if they were deleted.

if the admin explicitly deletes that OAuth application, it reappears on restart

I've added a config option to prevent the applications being recreated, though I can't think when this would be useful.

@hickford I proposed another solution in #26291. I'll close this PR for now, feel free to reopen if you don't like my proposal.

authors: denyskon hickford lunny


text:
[WIP] add gcp storage

WIP as missing docs, tests, and probably more

Would something like https://github.com/beyondstorage/go-storage help? It also helps Azure Blob Storage

Would something like https://github.com/beyondstorage/go-storage help? It also helps Azure Blob Storage #25458

https://github.com/beyondstorage/go-storage looks promise.

https://github.com/beyondstorage/go-storage looks promise.

I'm not sure that is still actively developed. The domain was taken over by domain squatters, the only commits and PRs appear to be from dependabot.
https://gocloud.dev might be one we want to look at instead, pulumi is a project that uses it.

closing as gcp has s3 API support, so this is not needed.

@techknowlogick perhaps we should document that.
I don't think most GCP users are aware they can simply use the S3 Settings

authors: delvh lunny techknowlogick wxiaoguang


text:
Fix divider in subscription page (#27298)

Backport #27298 by @yp05327
divider should always display in subscription page.
Before:

After:
(no changes when there's no subscriptions)

sorry for off-topic
but why there is not build neither in GitHub release nor dl.gitea.com.

sorry for off-topic but why there is no latest builds neither in GitHub release nor dl.gitea.com anymore.

Did you mean https://dl.gitea.com/gitea/main/gitea-main-nightly-linux-amd64 ?

sorry for off-topic but why there is no latest builds neither in GitHub release nor dl.gitea.com anymore.

Did you mean https://dl.gitea.com/gitea/main/gitea-main-nightly-linux-amd64 ?

like that but for nightly builds and release candidates:
I mean:
https://dl.gitea.com/gitea/1.22.0-dev/
https://dl.gitea.com/gitea/1.21.0-rc0/
both only have source code. but previously they had also the built binaries for all platforms. I use windows.

authors: GiteaBot lunny yekanchi


text:
Revert "Fix EOL handling in web editor"

Reverts go-gitea/gitea#27141
close #28097

This behavior already effects end users.
If there is no quick fix (eg: in 1 or 2 days), let's revert it to old behavior. Then you have enough time to propose a new fix.

It's a trivial fix, I will provide soon. That's assuming the current behaviour can even be considered "broken", I think monaco is doing the sensible thing by defaulting to user's platform.

https://github.com/go-gitea/gitea/pull/28119

Will merge it in 1 day.

@silverwind the last call for the merge in 12h, if you still have objection, please show a real case to help understanding the "problem" you are worrying about.

I'm strongly against this because it removes editorconfig support.

But it broke many users' online editors. I was surprised when I edit a readme and only add one new line then all files were changed with no warning until I take a look at diff.

The only "necessary" revert is this line:
https://github.com/go-gitea/gitea/pull/27141/files#diff-898533f7342f43a8390c353ae398fa85578aaa93667b3ff99a5dd889c048e1c7L290
Ideally we should just convert line endings based on the new server pref.

Added server-side convertion in https://github.com/go-gitea/gitea/pull/28119/commits/e58dcc03437dca23ed8bc24c8b7434ac088e14be, this will always be correct, no matter what happens on the client side.

authors: lng2020 lunny silverwind wxiaoguang


text:
Don't link wiki revision to commit

In #7907 a change was made to use the same template for repo and wiki
commit lists. However, there is no code or logic for showing the diff of a wiki commit so it just produces broken links like:
http://localhost:3000/mrsdizzie/%!s(%3Cnil%3E)/commit/5e72eeb00896d3853ab22a01950a50119b249567

See: https://try.gitea.io/mrsdizzie/linktesting/wiki/Home/_revision for example
This just removes the link for now until that feature is implemented

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@1823697). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             master   #9244   +/-   ##
========================================
  Coverage          ?   41.1%
========================================
  Files             ?     555
  Lines             ?   72400
  Branches          ?       0
========================================
  Hits              ?   29763
  Misses            ?   38892
  Partials          ?    3745

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 1823697...8103cd2. Read the comment docs.

authors: codecov-io mrsdizzie


text:
官方的可以，这个根本不行啊

OpenDB方法不存在，用dsn链接 就说用户名密码错误。工具都可以链接，官方的也可以，就这个不行

README 写的有点错误，修正了下

README 写的有点错误，修正了下

dsn := "clickhouse://gorm:gorm@localhost:9942/gorm?dial_timeout=10s&read_timeout=20s"
dsn := "clickhouse://username:password@host:port/database?dial_timeout=10s&read_timeout=20s"??? why? failed to initialize database, got error parse

repo: go-gorm/clickhouse


text:
Are sub queries supported in scopes?

Your Question
I'm attempting to use a sub-query in a scope:
txn := w.db.Begin()
txn.Scopes(models.FileNeedsEncode).Preload("Path.QualityProfile").First(&fileRecord)

Where FileNeedsEncode looks like
func FileNeedsEncode(db *gorm.DB) *gorm.DB {

	subQuery := db.Table("encodes").Select("MAX(id)").Where("file_id = files.id")

	return db.Joins("left join paths on paths.id = files.path_id").
		Joins("left join encodes as e on e.file_id = files.id").
		Where("e.id = (?) OR e.id is null",
			subQuery,
		).
		// This clause must match the models.PathAbleToEncode scope
		Where("paths.type in (?)", []int{
			PathTypeStandard,
		}).
		Where("files.size >= paths.minimum_file_size").
		Where("files.status = ?", FileStatusEnabled).
		Where(
			"((files.status_encoder = ? AND (files.checksum != e.checksum_at_end OR e.checksum_at_end is null)) OR e.status = ?)",
			FileEncodeStatusNotDone, EncodeCancelled,
		).
		Where("files.status_encoder not in (?)", []int64{
			FileEncodeStatusPending,
			FileEncodeStatusErrored,
		}).
		Order("paths.priority DESC")
}

And while it might not be the most efficient query, this similarly used to work in gorm v1, however in v2 it generates the following query:
SELECT MAX(id) FROM `encodes` left join paths on paths.id = files.path_id left join encodes as e on e.file_id = files.id WHERE file_id = files.id AND (e.id = (SELECT MAX(id) FROM `encodes` left join paths on paths.id = files.path_id left join encodes as e on e.file_id = files.id WHERE file_id = files.id AND (e.id = () OR e.id is null) AND paths.type in (1) AND files.size >= paths.minimum_file_size AND files.status = 1 AND (((files.status_encoder = 0 AND (files.checksum != e.checksum_at_end OR e.checksum_at_end is null)) OR e.status = 2)) AND files.status_encoder not in (2,3) ORDER BY `encodes`.`id`,paths.priority DESC LIMIT 1

Whereas I'd expect it to generate:
SELECT `files`.`id`,`files`.`path_id`,`files`.`name`,`files`.`size`,`files`.`checksum`,`files`.`source`,`files`.`status`,`files`.`status_encoder`,`files`.`created_at`,`files`.`updated_at` FROM `files` left join paths on paths.id = files.path_id left join encodes as e on e.file_id = files.id WHERE (e.id = (SELECT MAX(id) FROM encodes WHERE file_id = files.id) OR e.id is null) AND paths.type in (1) AND files.size >= paths.minimum_file_size AND files.status = 1 AND (((files.status_encoder = 0 AND (files.checksum != e.checksum_at_end OR e.checksum_at_end is null)) OR e.status = 2)) AND files.status_encoder not in (2,3) ORDER BY `files`.`id`,paths.priority DESC LIMIT 1

Is there a correct way to handle this in v2?

After testing more it does appear that this does not work in scopes any longer.

it should works, can you create a reproducible PR if it doesn't?

authors: ewanwalk jinzhu

repo: go-gorm/gorm


text:
rename blockwise{sender/reciever}.peerDrive blockwise{sender/reciever}.startedByClient

just rename variable becasue it is confuse what does mean 'peerDrive'.

Renamed by commit https://github.com/go-ocf/go-coap/commit/f3a28847f6a4f40d143cd217b01a289f501b3629

repo: go-ocf/go-coap


text:
支持支付宝接口AES加解密吗

@guoxk 支持，我记得有方法，但是未测试过，client.SetAESKey()，请求参数会加密，但是返回参数并未做吃力

明白

我又试了一下，只要对biz_content做加密，就报业务参数错误，具体怎么做aes加密，我还未特别清楚
{"code":"40004","msg":"Business Failed","sub_code":"ACQ.INVALID_PARAMETER","sub_msg":"参数无效：参数格式错误"}

OK，我自己研究一下

authors: guoxk iGoogle-ink

repo: go-pay/gopay


text:
GNET now ranks first. check the techempower benchmark again, pls update README.md

gnet - high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go. Ranks #10 in TechEmpower Plaintext Benchmark, beating all other go frameworks.

See https://github.com/go-perf/awesome-go-perf#network

@cristaloleg check this again
https://www.techempower.com/benchmarks/#hw=ph&test=plaintext&section=data-r22
it's now first! #1 golang net framework faster than rust / c++ / c
so it's good to let everyone know. and also mention it as Round 22 then you wont need to update the readme again.

I don't see a good reason to follow TechEmpower rating. Too much updates for no reason. Thanks 😉

authors: cristaloleg sprappcom

repo: go-perf/awesome-go-perf


text:
[Google App Engine Standard Environment] no such file or directory

When i run migrations in the Google App Engine Standard Environment i got the next error:
panic: open /tmp/staging/srv/internal/app/someapp/repository/migrations: no such file or directory goroutine 1 [running]: github.com/go-pg/migrations.(*Collection).MustRegisterTx(...) /go/pkg/mod/github.com/go-pg/migrations@v6.7.3+incompatible/collection.go:333 github.com/go-pg/migrations.MustRegisterTx(0xc000407f58, 0x2, 0x2) /go/pkg/mod/github.com/go-pg/migrations@v6.7.3+incompatible/default.go:35 +0x7f some.website.net/example/project/internal/app/someapp/repository/migrations.init.0() /tmp/staging/srv/internal/app/someapp/repository/migrations/1562685639_initialize_db.go:41 +0x4ad

I am sure that this is due to the fact that in this environment writing / reading of the file system is prohibited. Is there any way around this problem?

You can try to disable sql auto discover via https://godoc.org/github.com/go-pg/migrations#Collection.DisableSQLAutodiscover

You can try to disable sql auto discover via https://godoc.org/github.com/go-pg/migrations#Collection.DisableSQLAutodiscover

It works! Thank you!

repo: go-pg/migrations


text:
UniversalClient and Unix Sockets

Is it possible for UniversalOptions to support the Options.Network setting? My application has a config file where the user can specify a single redis server (through either tcp or unix sockets), or a redis cluster to talk to. Currently this makes it hard to use UniversalClient because it doesn't support Options.Network, not even when we're using a single redis server.

client := redis.NewUniversalClient(&redis.UniversalOptions{
        Addrs: ...,
        Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) {
                ....
        },
})

repo: go-redis/redis

license_source: bigquery


text:
generate constants for string enum properties

This change generates constants for string enum model properties. E.g., for this model definition
definitions:
  Book:
    type: object
    properties:
      genre:
        type: string
        enum:
          - scifi
          - mystery
          - horror

you get:
const (
	BookGenreScifi   string = "scifi"
	BookGenreMystery string = "mystery"
	BookGenreHorror  string = "horror"
)

similar in spirit to https://github.com/go-swagger/go-swagger/pull/660

Current coverage is 68.82% (diff: 100%)

Merging #686 into master will not change coverage

@@             master       #686   diff @@
==========================================
  Files            19         19
  Lines          5216       5216
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits           3590       3590
  Misses         1277       1277
  Partials        349        349

Powered by Codecov. Last update 7252939...da06f7a

Thanks a lot :+1:

authors: casualjim codecov-io rgarcia

repo: go-swagger/go-swagger


text:
Add multi screen examples code and fixed args, add image Save quality support

Please provide Issues links to:

Issues: #

Provide test code:

Description
...

 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.You have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant vcaesar

repo: go-vgo/robotgo


text:
没有更新缓存而是删除吗？

if table != nil {
if cacher := session.engine.getCacher2(table); cacher != nil && session.statement.UseCache {
//session.cacheUpdate(table, tableName, sqlStr, args...)
cacher.ClearIds(tableName)
cacher.ClearBeans(tableName)
}
}

cacheUpdate is not ready. I will improve this code later.

authors: lunny t-xinlin

repo: go-xorm/xorm


text:
Way to generate Multicolumn Indexes?

https://www.postgresql.org/docs/9.6/static/indexes-multicolumn.html
https://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html
seems there is only create single column index.

type MyTable struct {
    Id int64
    Column1 string `xorm:"index(s)"`
    Column2 string `xorm:"index(s)"`
}

@lunny this just create separate index for Column1 and Column2, like
CREATE INDEX Column1_idx ON MyTable (Column1);
CREATE INDEX Column2_idx ON MyTable (Column2);

How to generate this following sql:
CREATE INDEX Column1_idx ON MyTable (Column1, Column2);

Have you tried this code?
type MyTable struct {
    Id int64
    Column1 string `xorm:"index(s)"`
    Column2 string `xorm:"index(s)"`
}
engine.CreateIndexes(new(MyTable))

@lunny , Sorry, it created the index, I am not try it before.
But how to create index with specifies descending sort order?
CREATE INDEX Columns_idx ON MyTable (Column1, Column2, CreatedAt desc);

With the same name on the quote after index will be a group indexes.
type MyTable struct {
    Id int64
    Column1 string `xorm:"index(s)"`
    Column2 string `xorm:"index(s)"`
    CreatedAt time.Time `xorm:"created index(s)"`
}

thanks, please notice CreatedAt desc  on above sql, the descending sort seems cannot created

It's not supported.

Can you add support for custom index sequence?

@lauyoume any suggestion about the xorm tag format to support custom index sequence? How about
type MyTable struct {
    Id int64
    Column1 string `xorm:"index(s desc)"`
    Column2 string `xorm:"index(s)"`
    CreatedAt time.Time `xorm:"created index(s)"`
}

@lunny
Not only index sequence, Now using tag can't fully describe the order of the columns in the index.
Your implementation is currently based on the order of the structure fields.
If I want to create index like this, how to describe the order of col1/col2/col3.
Alert table MyTable  add index idx_col1_col2(col1, col2);
Alert table MyTable  add index idx_col3_col2_col1(col3, col2, col1);

beego orm, Using interface to  custom index
// for index
func (u * MyTable) TableIndex() [][]string {
    return [][]string{
        []string{"col1", "col2"},
        []string{"col3", "col2", "col1"},
        []string{"col4", "col3 desc"},
    }
}
// for unique
func (u * MyTable) TableUnique() [][]string {
    return [][]string{
        []string{"col4", "col5"},
    }
}

How about
type MyTable struct {
    Id int64
    Column1 string `xorm:"index(s desc, 2)"`
    Column2 string `xorm:"index(s,3)"`
    CreatedAt time.Time `xorm:"created index(s,1)"`
}

It's a good solution, may you add support for this?

@lauyoume I will try this.

@lunny  any plan for this feature?

No plan currently. Maybe someone could send a PR to fix.

authors: TangMonk giter lauyoume lunny


text:
增企业微信api声明

增企业微信api声明

企业微信相关部分并不是所有开发者都需要的，建议可以通过其他方式提供给大家使用，谢谢～

authors: godbasin qqxs

repo: godbasin/wxapp-typescript-demo


text:
Build script failed for customized godot build configuration

Godot build version:
Master
OS/device including version:
VirtualBox Ubuntu 18.04.4
Issue description:
In case of the custom build when the disabled_3d is True(or disable_advanced_gui="yes") build will filed compactly for all OS docker build not only for tools(as I guess it should be)
# custom.py
production="yes"
disable_3d="yes"

I would not recommend using custom.py to override compile options in this case. If you need to optimize export templates for size, then I'd suggest modifying build scripts themselves as of now. Or, you could actually modify SConstruct file within the engine to ignore disable_3d option for editor builds.

repo: godotengine/godot-build-scripts


text:
Area2D Collision disabled, can't be enabled inside of a signal

Godot version:
v3.1.beta4.official
OS/device including version:
macOS Mojave 10.14.3
Issue description:
When you disable an Area2D's collision you can't enable it inside of another node signal.
Steps to reproduce:

Create an Area2D ("Goal") with CollisionShape2D
Disable CollisionShape2D Collision
Connect the signal body_entered and put a print inside of it
Create another Area2D ("Toggler") with CollisionShape2D
Connect the signal body_entered and enable the "Goal" Collision inside of it
Create a KinematicBody2D ("Player") with CollisionShape2D
Make the "Player" pass through the "Toggler", "Goal" will look like it's enabled but if the "Player" pass through it, it will not print anything

Minimal reproduction project:

area_2d_collision_bug.zip

In 3.2, doing this results in error. You are supposed to defer setting this (e.g. set_deferred("disabled", false))

authors: KoBeWi juancolacelli

repo: godotengine/godot


text:
Better allign for Public Methods list in API doc

Usually when we look for methods we tend to search them by name not their return datatype. I suggest change type of text alignment as on mock-up:

well, pretty nice idea, should add support to richtextlabel to do this..
On Fri, Nov 20, 2015 at 6:34 PM, n-pigeon notifications@github.com wrote:

Usually when we look for methods we tend to search them by name not their
return datatype. I suggest change type of text alignment as on mock-up:
[image: doc_text_align]
https://cloud.githubusercontent.com/assets/6152134/11312499/bfe9bf4e-8fd6-11e5-8c8f-4ffc6fba5b3c.jpg
—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/2851.

guess it needs column support...
On Fri, Nov 20, 2015 at 6:39 PM, Juan Linietsky reduzio@gmail.com wrote:

well, pretty nice idea, should add support to richtextlabel to do this..
On Fri, Nov 20, 2015 at 6:34 PM, n-pigeon notifications@github.com
wrote:

Usually when we look for methods we tend to search them by name not their
return datatype. I suggest change type of text alignment as on mock-up:
[image: doc_text_align]
https://cloud.githubusercontent.com/assets/6152134/11312499/bfe9bf4e-8fd6-11e5-8c8f-4ffc6fba5b3c.jpg
—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/2851.

I like this idea. Also: the methods should be sorted in alphabetical order.

Alphabetical order would be probably rather tricky with "set_, get_, is_, is_set_as" and so on which should be next to each other if they are in the same context like:
set_as_toplevel()
is_set_as_toplevel()
also some don't share name just context like:
hide()
show()

ah this is worse, it's not columned text, it's grid support... thinking
about implementing this gives me nightmares :|
guess will have to do it eventually..
On Fri, Nov 20, 2015 at 8:39 PM, n-pigeon notifications@github.com wrote:

Alphabetical order would be probably rather tricky with "set_, get_, is_,
is_set_as" and so on which should be next to each other if they are in the
same context like:
set_as_toplevel()
is_set_as_toplevel()
also some don't share name just context like:
hide()
show()
—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/2851#issuecomment-158558358.

Done! It literally gave me nightmares after the first day working on int :D

Awesome, thanks! :D

Beautiful! Thx!

authors: akien-mga n-pigeon reduz vnen


text:
Godot 3.2 export android

Godot version:
Godot 3.2.dev commit id:0239d8bd9fa03965439aac2482d18746f807bd00
OS/device including version:
Linux Manjaro
Issue description:
I don't know if this is an issue or not, simply I don't know how to test the new android export. I follow the documentation instruction, but Godot doesn't create the android project template. I attach some screenshot to better understand.

Tell me the template is missing but I have installed all templates.

It's a bug or is intended to do this for now? How can I test the new android export for some feedback?
Steps to reproduce:
Look the screenshot
Minimal reproduction project:

The templates have to be exactly match for your version of Godot, so if you compiled from master yourself, you also need to compile the templates. And I think there might be something wrong with creation of android templates right now. I was not able to compile it myself few days ago. Everything looked like it's going all right, but there was no templates in the folder after all. Looks like #28498 has something to do with this.

@freemanfromgodotengine They are now in another folder (not copied to /bin anymore).

You can find the generated apk in godot/platform/android/java/build/outputs/apk

@erammos I can't find the .apk there on /android/java although the folder should be correct. Don't know what I'm doing wrong.

I can't find the .apk there on /android/java although the folder should be correct. Don't know what I'm doing wrong.

Btw, i can't export the gradle project from "Install Android Build Template", I get the same error "Android build template is missing", although i have installed the template

Well I have managed to solve that issue. You have to take everything in godot/platform/android/java/  (except the Build folder), zip them in a file named as "android_source.zip" and  last copy-paste it in your templates folder 3.2.dev

There is no android_source.zip on godot server so it won't work. Apk file won't going to work. Zipping java  folder works but it does not work on android phone, i.e crashes( might be some other bug).

There is no android_source.zip on godot server so it won't work. Apk files won't going to work. Zipping java folder works but it does not work on android phone, i.e crashes( might be some other bug).

Maybe the engine libs are missing in java folder... you have to compile the engine first (scons platform = android )

I did copy pasted lib folder in android_source.

If it crashes, your best option is to run adb logcat and open an issue with the log.

I do not have the android_source.zip file in my templates folder and I can still build for android perfectly fine, for oculus quest and a normal android device @erammos

authors: HugeGameArtGD LinuxUserGD creikey erammos freemanfromgodotengine gamergamesz grevius5 neikeq


text:
LightOccluder in Tilemaps loosing their lightmask

When using LightOccluders on different light masks in a tileset scene, the light masks will be reset to 1 after convert to TileSet.
After a quick view in the generated tileset.xml it seems to me, that the light mask info isn't stored there.
Converting it to a .res file instead of .xml has the same issue.

tilemap draws everything as a batch, including occluders so any per-tile information except material is lost by design. Maybe what we could do is add a property so we can set the occluder mask for the entire tilemap?

an alternative for what you desire may be using more than one tilemap with different occluder masks

In my case, there was only one occluder in the tilemap. It was on mask 2, but then reset to mask 1. Sorry, my description was a bit unclear in that point.

oh ok, now you can change occluder mask in tilemap settings
On Sat, Dec 12, 2015 at 10:50 AM, Sven Lange notifications@github.com
wrote:

In my case, there was only one occluder in the tilemap. It was on mask 2,
but then reset to mask 1. Sorry, my description was a bit unclear in that
point.
—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/3025#issuecomment-164153100.

great, thx! i'll check it with the next build :)

authors: nopeson reduz


text:
Android physical keyboard input getting stuck on left arrow key

Godot version:
3.1.1 stable win64
OS/device including version:
Win10 x64 for export, Android 9 device, QWERTZ keyboard
Issue description:
Using a physical keyboard (in my case via https://github.com/Genymobile/scrcpy) and pressing the left arrow key gets all keyboard input stuck.
Touch/Mouse input still appears to be handled in my own project.
Steps to reproduce:

Set up a scene with a script that handles keyboard input in '_process(delta)' with 'is_action_pressed(...)'.
Export for android and play.
Press arrow keys up, right, down. Those work.
Press arrow key left, all currently pressed keys get stuck and no further keyboard input is accepted.

Minimal reproduction project:
https://github.com/The5-1/AndroidKeyboardBug
Possibly related:
#6612 #6388 #8032

Just to add, I noticed this when fixing the bug that enabled android physical keyboards #29948. It wasn't 'introduced' by the fix as far as I could see, it already seemed to exist, but it is possible it wasn't occurring in the wild simply because most physical keyboards weren't working.
I didn't add an issue at the time but did mention it, and after small attempts to fix it decided it was more of a design decision and something for an android expert e.g. @m4gr3d ?
As far as I could see, the problem is caused because we return all keys as unhandled (see GodotInputHandler.java the return values of onKeyDown and onKeyUp are false.
There seems to be some kind of in built android function that is called when pressing left arrow, it was crashing with something to do with audio on mine. I had a bit of a google but I couldn't work out what this was.
However regardless of that, the bigger question remains whether it is a good idea for us to be returning keys as unhandled, when some of them will be handled. Of course because of the godot design we don't know in advance which will be handled (it depends which have been assigned, maybe we could have the action keys return handled?).
I fixed this in my android build by simply returning true from both functions. But it is not a proper fix, it really requires discussion.

@lawnjelly, I stumble upon your gamedev.net post regarding Godot contributions and came to know about this issue. So I thought to take a look at it and fixed this issue. What I see is:

This issue has nothing to do with KeyEvent.KEYCODE_BACK, this is special key code to tell activity to go back to previous activity or home screen if there is no previous activity, and this is being handled correctly.
Issue is because of Android's weird behavior or you may say it an optimization. So when an Android app/game's activity return's false from onKeyDown api, Android system may optimize and does not send KeyUp event for that key down event. Also, strangely it does not happen in all cases and that why other key were working.
I fixed it simply by returning true from onKeyDown and onKeyUp (for onKeyUp, it may not be needed but safer to return true) for every case where ever we dispatch runnable on queueEvent.

I am not sure about rules of submitting patches and I may take some time to figure them out, meanwhile please find patch generated on top of git tag 3.1.1-stable as follows:
diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java
index ccf78f26f..bd82bcdfb 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotView.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotView.java
@@ -307,6 +307,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
                                        GodotLib.key(keyCode, chr, false);
                                }
                        });
+                       return true;
                };

                return super.onKeyUp(keyCode, event);
@@ -355,6 +356,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
                                        GodotLib.key(keyCode, chr, true);
                                }
                        });
+                       return true;
                };

                return super.onKeyDown(keyCode, event);

Patch for master branch:
diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java
index a443a0ad9..098ba2f7b 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java
@@ -106,6 +106,7 @@ public class GodotInputHandler implements InputDeviceListener {
                                        GodotLib.key(keyCode, chr, false);
                                }
                        });
+                       return true;
                };

                return false;
@@ -152,6 +153,7 @@ public class GodotInputHandler implements InputDeviceListener {
                                        GodotLib.key(keyCode, chr, true);
                                }
                        });
+                       return true;
                };

                return false;

Yes that's basically what I used to fix it in my android build (I returned true at the end of the function so as to catch the case of game devices too, just in case they also caused the same bug, your positioning may be better, I'll have to review it after the weekend).
I actually had more than just keyboard input stopping working (although I believe this may have happened too) I was actually getting a crash too in audio. This may have been happening to OP as well, but we would need adb logcat to see.
Without getting any further better info on this I'll probably just make a PR to change the return value to true, and hope it gets discussed in PR meeting. (I've only been delayed on this and another PR because of another Android build issue).

Indeed I too had the audio playback get stuck as well.
The sound currently output was repeated and overlapping at an extremely high rate.

authors: The5-1 lawnjelly shivmsit


text:
Tileset Editor does not support shape transforms

Godot version:
3.2 alpha 2
OS/device including version:
Windows 10 64 bits
Issue description:
Convert to TileSet generates incorrect collision shapes when sprites have centered set to true.
It seems to just take the polygon property inside the CollisionPolygon2D and use those values to generate the collider.

Disabling centered and manually redrawing the polygon will generate the correct collision shape when converting to tileset.

Steps to reproduce:

Open TilesetEdit.tscn and convert to TileSet saving as TileSet.tres
Try to edit collision shapes using integrated tileset editor
Expected:
Collision shapes should look as in TilesetEdit.tscn
Actual:
Collision shapes are offset as if being centered in the top left of the tile

Minimal reproduction project:
https://github.com/godotengine/godot-demo-projects/tree/master/2d/platformer

This bug only seems to impact the tileset editor. When actually using the tileset in a tilemap all collisions are at the correct location

The problem here seems to be, that the tileset editor plugin ignores the transform property of the collision shape completely while "export to tileset" uses it to position the shape. This leads to problems when you want to edit a tileset that was created by the latter.
I see two solutions that would not break compatibility with existing tilesets:

Rewrite the tileset editor plugin so that it handles an additional transform property for selected polygons
Rewrite the tileset editor so that it converts between an absolute coordinate system and a coordinate system relative to the transform every time it reads and writes tileset collision polygons.

I would personally prefer the first option as it's a lot cleaner and less hacky even though it comes with quite some code changes. The second one would be easier to implement but might lead to problems in the future.
Any thoughts?

Hmm I reexported and all collisions where broken. Maybe it's because I
modified one of the tiles in the tileset editor.
On Sun, Oct 20, 2019, 15:13 SpechtMagnus, notifications@github.com wrote:

This bug only seems to impact the tileset editor. When actually using the
tileset in a tilemap all collisions are at the correct location
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/32901?email_source=notifications&email_token=AAEAT3JETUOZGQR7ECTLYB3QPSNVRA5CNFSM4JCDKUD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBYQECA#issuecomment-544277000,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEAT3NSJKTUILYEHNO77G3QPSNVRANCNFSM4JCDKUDQ
.

Yeah I think option 1 would be the best.
.tres files are text based and can be edited and generated by scripts. I wouldn't want the editor plugin modifying what was a valid format until now and reading and writing every time does feel hacky.

Still an issue in Godot 3.2.3.stable, on Windows 10 64-bit.
For anyone who tries to fix it in the future, the centered: true issue also affects Navigation and Occlusion polygons.

(the title change may have been meant to reflect that, but I wanted to make sure it was specifically mentioned)
You can still work around it by disabling centered on the sprite and redrawing the polygons before converting.

authors: Luna-Rex SpechtMagnus noidexe


text:
GraphEdit's connection_from_empty signal gives the wrong slot

Godot version:
269145a346bddae5cbbf00fd17b6c8eac4cd4665 Mono
OS/device including version:
ArcoLinux
Issue description:
The value given from the signals connection_from_empty and connection_to_empty will be wrong if not every slot is enabled.

In this example, Godot will report in connection_from_empty that Slot 1 is slot 0, Slot 2 is slot 1, and Slot 3 is slot 2.  Meanwhile, with connection_to_empty, Godot reports that Slot 2 is slot 0, and Slot 3 is slot 1.  So, it seems to be ignoring slots that aren't enabled, and starts with the first enabled slot for counting.
This is a big problem when you need to get, for example, the type of the slot you're dragging from, but are given an entirely different slot based on what's active and what's not.  To my knowledge, no other signal in GraphEdit operates this way.
Tested in both GDScript and C#.

As it turns out, the other signals do seem to operate with this slot offset.
Nonetheless, it's not usable with get_slot_type_x(), since that does not take it into account.  So if I set Slot 2's type to 1 and attempted to reference it, I would instead get Slot 3's type of 0, since that then becomes slot 2 in this configuration.

This can be closed in favor of #37227

authors: mrushyendra somnivore


text:
FileSystem -> Create Scene has different behaviour than Scene -> New Scene

Godot version:
3.2 Beta 4
OS/device including version:
Mint 19.2
Linux Linux 4.15.0-72-generic
Issue description:

Steps to reproduce:
Right click in FileSystem to create a new scene and it asks for a name. This should just be removed completely because it makes an empty scene anyways.

Update: The name actually is used, but only when you save the scene

I think that the option should still be removed to be consistent with Menu->Scene->New Scene

Um, it asks for the filename. When you save that empty scene it will create "This goes nowhere!.tscn".
If anything, we could change behavior of empty scenes. When you delete scene root, the tab becomes "empty scene" too, but you can still save it when you add new root.

I would vote for one of two options

File System -> New scene asks for a name, the scene should be created with a named root node and automatically saved to the file system

File System -> New scene is just a shortcut for Scene -> New Scene (Top bar), does not ask for a name. Maybe CTRL S automatically highlights the folder you right clicked in but the name is the root node name

Still valid in 3.2.4 beta4

Should we move this to proposals?

authors: KoBeWi nathanfranke nathanwfranke


text:
Borderless Windows Crash Desktop Environment

Godot version: 3.2
OS/device including version: Linux Mint 19.3 Tricia x86_64
Issue description: Project > Project Settings... > Display > Window > Size: Borderless when set to True will cause Cinnamon Desktop to crash upon launching the game. When Cinnamon is restarted, game seems to work fine and not crash again.
Steps to reproduce: After setting Borderless "True", Play the project and click on anything inside the window.
Minimal reproduction project: it was tried with a scene composed of just a top Control node with a Panel child

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

authors: Codified-Vexing KoBeWi


text:
Error: affine_invert: Condition "det == 0" is true

Godot version:
3.2
OS/device including version:
Kubuntu 20.04
Issue description:
While running my game, I am getting spam errors of:
E 0:00:01.065   affine_invert: Condition "det == 0" is true.
<C++ Source>  core/math/transform_2d.cpp:51 @ affine_invert()
Steps to reproduce:
Add the following line in C# code:
rigidBody2d.Transform = newTransform;
From what I can understand this is not the right way to do what I want to achieve.
But nevertheless, if the API does allow this, I believe the error must be addressed.

What is the output of GD.Print(newTransform);?

The output is something like this:
((0, 0), (297.6345, 0), (0, 0))
((0, 0), (446.4517, 0), (0, 0))
((0, 0), (0, -37.6484), (0, 0))
((0, 0), (297.2244, 0), (0, 0))
((0, 0), (445.8366, 0), (0, 0))
((0, 0), (0, -40.46407), (0, 0))
((0, 0), (296.7818, 0), (0, 0))
((0, 0), (445.1726, 0), (0, 0))
((0, 0), (0, -43.262), (0, 0))
((0, 0), (296.3065, 0), (0, 0))
((0, 0), (444.4598, 0), (0, 0))
((0, 0), (0, -46.04094), (0, 0))
((0, 0), (295.7989, 0), (0, 0))

@MugenTwo This is expected behavior. The determinant is zero because the X axis of your transform is (0, 0) (the part on the left), so Godot has to throw an error.
        Transform2D translation = new Transform2D();

        translation.y = motion * distance;

You are creating a new Transform2D called translation and setting translation.y without setting translation.x, also note that translation is a misleading name since this is a full transform. More importantly, you need to use Transform2D.Identity instead of new Transform2D(), since in C# it is a language feature that parameterless constructors make every member the default value.
I think you should read the code more closely:
	var xf = Transform2D()

	xf[2]= motion * d

Index 2 is the origin, and also as I said you need to use Identity, so try this instead:
        Transform2D transform = Transform2D.Identity;

        transform.origin = motion * distance;

Anyway, I'm closing this because this isn't a Godot bug.

@aaronfranke Isn't godot supposed to tell me which line and code generated an error instead of showing a cpp error?

@MugenTwo Godot already told you that the determinant is zero, and it already told you that it's a problem with the transform. There is no possible way for Godot to give more details about the error.
In your original code you are starting with a zeroed-out transform and setting the Y component. So what does Godot do, tell you to set the X component? That's not even a line of code causing the problem, it's a lack of code. But even then, that's not the solution you were looking for, since you meant to set the origin instead of the Y component.

authors: MugenTwo aaronfranke


text:
TextureFrame could handle region rects

For example it would allow us to use spritesheets in texture frames.
What do you think ?
If the issue is accepted I would like to take care of it. :smile:

Use AtlasTexture for this..
On Feb 14, 2016 15:04, "Wilhem Barbier" notifications@github.com wrote:

For example it would allow us to use spritesheets in texture frames.
What do you think ?
If the issue is accepted I would like to take care of it. Thanks [image:
:+1:]
—
Reply to this email directly or view it on GitHub
https://github.com/godotengine/godot/issues/3709.

Well, I guess this solves my problem. Thanks for your answer ! :+1:

authors: nounoursheureux reduz


text:
Unsaved scripts don't prompt when closing editor

Godot version
098e3cf / 3.4
System information
W10
Issue description
When you modify a script, it gets the "modified" status, but it's ignored by the editor. When you quit, any script changes are lost. Only unsaved scenes are handled.
Resolving this would effectively resolve #36281 (after #54653)
Steps to reproduce

Open any script in script editor
Modify it
Close Godot

Minimal reproduction project
No response

Sorry, I had this open in a different tab and copied the wrong issue tag... oops

@KoBeWi Should a 'save script' dialogue appear for each unsaved script, or just a 'save all script changes' overall dialogue; or should this be an option toggled via the settings like for scenes?
Alternatively, should script changes just count as part of their scene/s, and not show any additional popups?

@Calinou I have an effectively complete solution working at this point, but I've run into a problem. Built-in scripts don't seem to get a 'modified' status (though they are recognised as unsaved when quitting), and furthermore aren't saved by the save_all_scripts method meaning that my code doesn't work for them. I can't work out how to actually save all scripts, or to do it separately for built-in and external scripts (without saving scenes at the same time).
Do you have any advice for how I could resolve this, or will #54653 be adapted for 3.x (making both script types save in a similar way), meaning I should just pull request anyway?

The PR should be made against master branch first.

Ah, ok - because the 3.4 version is included in this issue I assumed it was for 3.x, so made my changes on that version. Should I make separate pull requests for 3.x and 4.0? I don't really know how it's done on GitHub yet.
2 Dec 2021 17:33:05 Tomek @.***>:

The PR should be made against master branch first.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub[https://github.com/godotengine/godot/issues/55026#issuecomment-984844529], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AP3YOETWNH65ZA5RSRPCGDDUO6UU7ANCNFSM5IEOETTA].

Should I make separate pull requests for 3.x and 4.0?

Depends on how much different they are. Sometimes the changes are the same for both branches, so the commit can be cherry-picked. But if they are too different, 3.x needs a separate PR.

That makes sense, thank you (;
2 Dec 2021 17:55:16 Tomek @.***>:

Should I make separate pull requests for 3.x and 4.0?
Depends on how much different they are. Sometimes the changes are the same for both branches, so the commit can be cherry-picked. But if they are too different, 3.x needs a separate PR.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub[https://github.com/godotengine/godot/issues/55026#issuecomment-984861651], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AP3YOEU5CTM3FBVFZXXCMNLUO6XIFANCNFSM5IEOETTA].

There's one aspect of my changes (and my changes in 3.x) that I don't like; I had to add a variable bool close_without_saving to script_editor_plugin, as I couldn't find a better way of preventing scripts from being automatically saved on quit. I've added a TODO comment to this and might find a different workaround later. Apart from that, my fixes worked as expected in my tests and seem to fit in with the rest of the code workings.

Is this still relevant?
I tested it on 3.5 beta — scripts are saved when closing the editor (there's no prompt tho)
I tried different editor options.

I also tested it in 3.4 — scripts are saved
Win7

there's no prompt tho

That's a bug: #18010
There should be a prompt. Also did you test with built-in scripts?

Well yeah built-in scripts are not saved when project reloading.
So is this only built-in scripts problem (script changes are lost)

I had to add a variable bool close_without_saving

Just providing an update: I found my PR again recently, and have reworked it to work again and to remove poor practices such as the above unnecessary statefulness. I'm happy with how it works now, though shaders and built-in scripts would definitely benefit from special handling in future.

built-in scripts are not saved when project reloading

Built-in scripts are saved when their scene is saved, which means there is some additional weirdness and inconsistency in the saving system. I've addressed this temporarily by displaying a warning with the list of unsaved built-in scripts (since their scenes will be saved without prompting), but it should be addressed fully whenever possible.

authors: KoBeWi ator-dev me2beats


text:
Strange errors when running a mostly UI based project

Godot version
v4.0.beta14.official [28a24639c]
System information
Mac
Issue description
I have a UI project I've recently converted from 3.5.1 to 4.beta.14, and I find these errors popping up whenever I start the project.

visibility_changed
size_flags_changed
minimum_size_changed
The error pointed out is:
https://github.com/godotengine/godot/blob/master/core/object/object.cpp#L1270
Yet no callstack is given.
Steps to reproduce
I'm not exactly how to reproduce this as it's not present in another project.
I'm interested in trying to figure out why the error appears, but I guess I will have to recompile the engine to get deeper debugging on that?
Minimal reproduction project
I won't upload my full project here, but interested in solutions to debug these three errors.
I would assume it's something to do with an old node that I ported over from 3.5.1, but without deleting and re-adding all nodes in the project, might there be some easier way to test for where this is coming from?

Please note that I do not use any of these signals in my project, this is some Godot core node using such I guess.

Could be related?
https://github.com/godotengine/godot/issues/51543

@tavurth have you tried with the latest version?

@akien-mga unfortunately I'm blocked from using the latest update for my projects until we can resolve this issue:
https://github.com/godotengine/godot/issues/73824
Unfortunately I don't have enough time to test sources outside my project scope at the moment.

Still present v4.0.rc3.official [7e79aead9] except now I have a new one about blender.

I'm not sure but if the error is "signal is already connected", then maybe it means the error occurs because you're trying to connect a signal twice?

@coppolaemilio I've narrowed this down to the TabContainer component.
I had a node tree like this:
TabContainer
  Tab(Control)
  Tab(Control)

I deleted the TabContainer and created a new one with the same attributes. The errors are now gone.
I would assume this is a migration script bug, but I will close this issue. If you feel it should still be open please let me know.

I now have no errors at all somehow! 🥳

authors: coppolaemilio rainlizard tavurth


text:
[4.0.beta17] .net - double clicking (unnecessarily long) debug log entry doesn't jumpt to source but to source-generator code

Godot version
4.0.beta17.mono.official
System information
Windows 10
Issue description
As the title says, the log output is needlessly deep into internals (screenshot here: https://github.com/godotengine/godot/pull/71943#issuecomment-1415809223), but the actual issue is that double clicking the log entry doesn't jump to the source file but attempts to open the source-generator generated file instead:

Steps to reproduce
Print debug statements from a c# file, and try to double click the log entry in the editor.
Minimal reproduction project
If required i can create one

Yes, it's pushwarning. Currently, in 4.1.1rc1 it doesn't jump to the source generators anymore, but prints error logs in the regular console output instead:
Cannot open file '/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs'.
  Failed to read file: '/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs'.
  Cannot load C# script file '/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs'.
  Failed loading resource: /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs. Make sure resources have been imported by opening the project in the editor at least once.
  Cannot open file '/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs'.
  Failed to read file: '/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs'.
  Cannot load C# script file '/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs'.
  Failed loading resource: /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Godot.SourceGenerators.Internal/Godot.SourceGenerators.Internal.UnmanagedCallbacksGenerator/Godot.NativeInterop.NativeFuncs.generated.cs. Make sure resources have been imported by opening the project in the editor at least once.


text:
Unsigned int suffix not highlighted in shader editor

Godot version
4.0.1
System information
Windows 10 x64
Issue description

Steps to reproduce

Create shader
Add uint, e.g. 4u

Minimal reproduction project
N/A

GDShaderSyntaxHighlighter uses CodeHighlighter which doesn't recognize this syntax.

authors: KoBeWi jsjtxietian


text:
Godot 4 .Net - Loading / Assigning a script exported from another project fails with error ("Cannot instance script because the associated class could not be found")

Godot version
v4.0.1.stable.mono.official [cacf49999]
System information
Windows 10
Issue description
Exporting a script from one godot project and loading it in another does not work (following https://docs.godotengine.org/en/stable/tutorials/export/exporting_pcks.html). The ResourceLoader.Load

same error

It would be appreciated if we could get some communication regarding this bug. This affects an engine feature that has its own dedicated page in the Godot docs, but the feature is rendered entirely inoperable for C# projects by this bug. I realize the shift to Godot 4 is a large one and that there are probably a mountain of bugs that need to be dealt with, but it would really nice if we could get even a speculative ETA for this fix. Would it be reasonable to assume that this will be fixed relatively soon, e.g. v4.1 or earlier? Or are there enough higher priority items that we should just assume that this will be broken until v4.2+?

agree with u。
hotfix is import part for a gameengine.

It would be appreciated if we could get some communication regarding this bug.

While the docs pages says this works like that and the page claims to be up to date, it is also wrong.
This feature has simply never been implemented after the move to .NET 6 for Godot 4.

Quite honestly, this is one of the most disappointing answers that you could have given. Yes, I am aware that the bug is labeled as still open. Yes, I am aware that hoping that there was progress on the bug was a long shot. Yes, I am aware that every project is going to have bugs and broken features. No, I am not going to invest the significant amount of time it would take to learn the engine systems and implement the feature myself.
Godot as a whole is positioning itself to be a viable alternative to engines such as Unity and especially Unreal Engine when it comes to developing 2D games or 3D games that don't require AAA visuals. However, wanting to have broader appeal means that you can't hide behind the "We're open source, so fix it yourself!" non-answer if you want to be taken seriously. You may consider that answer acceptable from the perspective of an open source project contributor, but it is significantly less so from an outsider's perspective.
Would it be possible for me to learn enough about the engine and implement the feature myself? Perhaps. But that's certainly not always going to be the case, especially since Godot is a beginner friendly engine by nature of having strong 2D support. It's not unreasonable to think that some beginner developer might implement a game in Godot and then decide to learn how to make it moddable and encounter this issue. I would not expect someone with minimal programming experience to dive into Godot's code and implement such a feature themselves.
As it stands, I have very little invested in Godot at the moment. I would like to invest more time into Godot. But answers such as this are not encouraging. Releasing DLC or making a game moddable is not some obscure use case for game developers. If such a feature is so fundamentally broken that it flat out doesn't work, how many other features should I expect to come across that flat out don't work either? I am not willing to invest the considerable amount of time it would take to release a well polished game if the platform I am working with is simply going to tell me to implement or fix it myself any time I come across a bug or broken feature.

I'm sorry you feel they way, but you're not gonna get any promises that bugs will be fixed anywhere, not here, not with Unity, or any other commercial project, sure they have more resources, but no one can, or should, promise that bugs will be fixed. There's plenty of bugs that have been present in bit commercial projects for years.
It's of course not optimal, but this is a community driven project, based on best efforts and voluntary work. We who contribute here, save for a few people who actually are paid in various ways or sponsored, get no direct reward. And some of us spend significant portions of our spare time doing it, because we want to, and demand nothing in return.
And honestly it's disheartening when people complain over having an entirely free engine, with no royalty, no restrictions, and a massive community that pretty much every single day make improvements on some part of it, and it isn't perfect.
I wasn't telling you "if you want it fixed then fix it yourself", I said "if you can help with this you are welcome to!"... And responded to your attitude that implied that bugs reported in this engine are not worked on, responded to, and resolved.

Is this getting fixed in 4.2

Try adding this to your external project:
  <ItemGroup>
    <PackageReference Include="Godot.SourceGenerators" Version="4.1.1"
                      OutputItemType="Analyzer"
                      ReferenceOutputAssembly="false" />
    <PackageReference Include="GodotSharp" Version="4.1.1" />
  </ItemGroup>

  <PropertyGroup>
    <GodotProjectDir>$(MSBuildProjectDirectory)</GodotProjectDir>
  </PropertyGroup>

https://github.com/OrdinaryGizmos/godot/tree/fix-plugin-load-context
I found a fix. The issue is that for Godot to know that there are scripts in your DLL, it has to call Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);
Further complicating the matter, the AssemblyAttribute that it looks for is AssemblyHasScriptsAttribute and this is loaded from GodotSharp.dll in a different AssemblyLoadContext than the game.
My patch adds a custom resolver to the Main.cs file in the mono glue that loads GodotSharp.dll (or any dependencies) from into the correct AssemblyLoadContext.
After loading the assembly you will need to call Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);
This was tested on Godot 4.2-dev6 for my game. I plan on opening a pull request.

@granitrocky Nice find! I can confirm that it worked with your code snippet in godot 4.1.2 as well as in 4.2-beta5. The error is gone and the minimum reproducable project correctly prints "Hello World!".
I opened a pull request to add this info to the docs for now: https://github.com/godotengine/godot-docs/pull/8486
PS: Inspecting a node with an imported script spams error messages in the output but that doesn't seem to cause any problems with the functionality of the script.

Cannot open file 'res://HelloWorld.cs'.
Failed to read file: 'res://HelloWorld.cs'.
Cannot load C# script file 'res://HelloWorld.cs'.
Failed loading resource: res://HelloWorld.cs. Make sure resources have been imported by opening the project in the editor at least once.

@Heremeus
Nice! Glad it's working across releases. That bug about the spam messages is weird. I am seeing that in 4.2-beta5, too. I wonder if it's an ALC thing again or something else...

@Heremeus @granitrocky This way is not available in godot 4.2.1-mono. 😟

@Heremeus @granitrocky This way is not available in godot 4.2.1-mono. 😟

Haven't tried it in 4.2.1 yet but as @raulsntos mentioned in https://github.com/godotengine/godot-docs/pull/8486, the ScriptManagerBridge wasn't meant to be used for this. It's quite possible that they changed things internally and the unintended workaround is gone. But again, I haven't tested it, so can't confirm.

@iwangxiaodong Yeah I don't think we should rely on this. It would be better to find a different way to get the dlls dynamically loaded.
However, I do see that LookupScriptsInAssembly is still public in the 4.2 branch, so I think it should work.

@granitrocky @Heremeus
Simplified：
AppDomain.CurrentDomain.AssemblyResolve += (s, e) => Assembly.Load(e.Name);
var asm = Assembly.LoadFile(ProjectSettings.GlobalizePath("res://ExportingProject.dll"));
var script = ((GodotObject)Activator.CreateInstance(asm.GetType("HelloWorld"))).GetScript();

@iwangxiaodong
I'm a bit confused. Are you saying that snippet works? I don't think you're supposed to do Assembly.Load inside the AssemblyResolve event. Take a look at The example Here.

@granitrocky
AssemblyResolve makes Assembly.LoadFile work correctly.
Otherwise asm.GetType("HelloWorld") is null.

@granitrocky
I understand, the key point is LookupScriptsInAssembly:
var alc = AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly());
var bytes = Godot.FileAccess.GetFileAsBytes("res://ExportingProject.dll");
var asm = alc.LoadFromStream(new MemoryStream(bytes));
ScriptManagerBridge.LookupScriptsInAssembly(asm);
var ok = ProjectSettings.LoadResourcePack("res://ExportingProject.pck");//GD.Print(ok);
var script = GD.Load

What is the long term plan for this?
Can we register scripts from an external dll or project outside of the godot project directory?

My workaround is to inherit the node you want to use in the main project, and override all its lifecycle method.
BaseNode: This is the node you want to use in your main project, but you cannot use it directly in Godot since it's in another assembly.
DerivedNode: This is the node in your main project.

public partial class DerivedNode : BaseNode {
    public override void _Ready(){
        base._Ready();
    }
// the same for _Process, _Input, _EnterTree ... etc
}

If we do not override these methods, BaseNode's lifecycle methods are not called at all.

@granitrocky Thank you for the workaround.
@iwangxiaodong Works fine for me in v4.2.1.stable.mono.official [b09f793f5]
var file = File.ReadAllBytes(ProjectSettings.GlobalizePath("res://Mod.dll"));
var context = AssemblyLoadContext.GetLoadContext(typeof(Godot.Bridge.ScriptManagerBridge).Assembly);
var assembly = context.LoadFromStream(new MemoryStream(file));
Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);

bool success = ProjectSettings.LoadResourcePack("res://mod.pck", false);

if (success)
{
    GD.Print("Success!");

    var importedScene = (PackedScene)ResourceLoader.Load("res://mod.tscn");
    var mod = importedScene.Instantiate<Node>();
    AddChild(mod); // Mod.cs is attached to base node in mod.tscn
}

public partial class Mod : Node2D
{
    public override void _Ready()
    {
        GD.Print("Hello from Mod");
    }
}

Although I have one question. If I run the above code a second time I get the following error.
System.ArgumentException: An item with the same key has already been added. Key: res://Mod.cs

The error points to this line
Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);

How would you remove this key so it can be added again? Because I'm making a mod loader with a button "Load Mods" and I want to be able to press the "Load Mods" button more than once and it should remove all the mods and then load them again.

Can we have another ticket with more specific issue.
The problem is that scripts do not function in multi-assembly projects.

OrdinaryGizmos@afa8858
I found a fix. The issue is that for Godot to know that there are scripts in your DLL, it has to call Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);
Further complicating the matter, the AssemblyAttribute that it looks for is AssemblyHasScriptsAttribute and this is loaded from GodotSharp.dll in a different AssemblyLoadContext than the game.
My patch adds a custom resolver to the Main.cs file in the mono glue that loads GodotSharp.dll (or any dependencies) into the correct AssemblyLoadContext.
After loading the assembly you will need to call Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);
This was tested on Godot 4.2-dev6 for my game. I plan on opening a pull request.
UPDATE: This fix in the commit is only for tools enabled builds. I am working on a fix for exported releases.
NEW UPDATE: I upgraded to 4.2-beta5 and rewrote my changes. You shouldn't need to modify the engine code at all. All you need to do when loading a DLL is the following 3 lines. In this case dllFile is a byte[] that I preloaded.
        var context = AssemblyLoadContext.GetLoadContext(typeof(Godot.Bridge.ScriptManagerBridge).Assembly);
        var assembly = context.LoadFromStream(new MemoryStream(dllFile));
        Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(assembly);

@Heremeus Can you try out these three lines and see if that fixes it for you?

This worked for my 4.3 build.  Thank you very much for the workaround!

authors: AThousandShips Heremeus MYTX-Wildfire Odaimoko RedworkDE dangerz diybl granitrocky haltingstate iwangxiaodong m1ntkat orolyn valkyrienyanko zkWildfire