Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plugin API] allow plugins read-only access to ParseTradeResult.EResult #3221

Closed
8 tasks done
zypA13510 opened this issue Jun 17, 2024 · 1 comment
Closed
8 tasks done
Labels
✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. 🙏 Wishlist Issues marked with this label are wishlisted. We'd like to make them happen but they're not crucial.

Comments

@zypA13510
Copy link

Checklist

Enhancement purpose

As of today, plugins with IBotTradeOffer interface can register their own trading logic to ASF. However, the plugin only has access to the Bot and TradeOffer objects, there is no way for the plugin to know why the trade is rejected by ASF core logic.

Solution

Upon reading the relevant code, I can see that the ShouldAcceptTrade function actually returns more information, including a reason when the trade is not accepted.
I would like to propose exposing this information via the interface to plugins, so plugins can selectively override certain outcomes while leaving others untouched.

Why currently available solutions are not sufficient?

For example, if the plugin would like to respect the FilterBadBots global config and give it priority, there is no way to do so without re-implementing the entire blacklisting logic.

Can you help us with this enhancement idea?

Yes, I can code the solution myself and send a pull request

Additional info

No response

@zypA13510 zypA13510 added ✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. 👀 Evaluation Issues marked with this label are currently being evaluated if they're going to be considered. labels Jun 17, 2024
@JustArchi JustArchi added 🙏 Wishlist Issues marked with this label are wishlisted. We'd like to make them happen but they're not crucial. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. and removed 👀 Evaluation Issues marked with this label are currently being evaluated if they're going to be considered. labels Jun 17, 2024
@JustArchi
Copy link
Member

JustArchi commented Jun 17, 2024

Very good idea, I don't have anything against, thanks for suggesting it 🏆 - use new IBotTradeOffer2 interface instead, which replaces the functionality of the previous one 🙂

I've marked V6.0.4.1 with release of this.

chen8945 pushed a commit to Ckid-Home/ArchiSteamFarm that referenced this issue Jul 31, 2024
* Make some inventory description properties public

* CI: Switch to using environment variables

* CI: Run qodana in different environment

* CI: Run first part of publish in test environment

* Monitoring: Bump OpenTelemetry dependencies, since the upstream issue is fixed

* Automatic translations update

* Update github/codeql-action action to v3.25.6

* Update swashbuckle-aspnetcore monorepo to v6.6.2

* Update dependency MSTest to v3.4.0

* Update ASF-ui digest to 63254c3

* CI: Divide environments further

* Bump

* Update ASF-ui digest to b1521b7

* Update ASF-ui digest to 491227c

* Update donation options

* Update ASF-ui digest to 8e361ae

* Automatic translations update

* Update dependency MSTest to v3.4.1

* Update dependency Microsoft.IdentityModel.JsonWebTokens to v7.6.0

* Update docker/login-action action to v3.2.0

* Monitor incoming trades (JustArchiNET#3201)

* Monitor incoming trades

* Apply feedback

* Misc.

* Misc

* Downgrade prometheus exporter again

* Add initial support for build attestations

* Fix observable counters

* Bump

* Update crowdin/github-action action to v2 (JustArchiNET#3209)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* CI: Misc

* CI: Misc

* Update ASF-ui digest to a72c668

* Update dependency MSTest to v3.4.2

* Update dependency MSTest to v3.4.3

* Update ASF-ui digest to 605cbf7

* Update ASF-ui digest to 7818887

* Update github/codeql-action action to v3.25.7

* Closes JustArchiNET#3210

* Bump

* Make ASF compatible with global invariant mode

Requires Humanizer update

* Use native Rfc2898DeriveBytes for Pbkdf2 instead of CryptSharp implementation

I've verified it generates the same results

* Bump

* Automatic translations update

* Update wiki digest to f05654b

* Update actions/attest-build-provenance action to v1.2.0

* Automatic translations update

* Update github/codeql-action action to v3.25.8

* Automatic translations update

* Update ASF-ui digest to 1e68294

* Automatic translations update

* Update dependency Humanizer to v3.0.0-beta.54

* Update ASF-ui digest to c5a2ac4

* Misc

Paused could be flipped in the meantime between starting the background check and finishing it, we can check it again after having games to farm.

* Bump

* Automatic translations update

* CI: Fix failure when in PR mode

* Update docker/build-push-action action to v5.4.0

* Automatic translations update

* Make PICS changes happen a bit more often

* Update ASF-ui digest to 185cc47

* Automatic translations update

* Update ASF-ui digest to 7efd77d

* Update actions/checkout action to v4.1.7

* Update github/codeql-action action to v3.25.9

* Update ASF-ui digest to 51952a3

* Update github/codeql-action action to v3.25.10

* Update actions/attest-build-provenance action to v1.3.1

* Update dependency OpenTelemetry.Extensions.Hosting to v1.9.0

* Update renovate.json5

* Automatic translations update

* Closes JustArchiNET#3221

* Update IBotTradeOffer2.cs

* Bump

* Update docker/build-push-action action to v6 (JustArchiNET#3222)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update actions/attest-build-provenance action to v1.3.2

* Update opentelemetry-dotnet-contrib monorepo to v1.9.0

* Update dependency Microsoft.IdentityModel.JsonWebTokens to v7.6.1

* Update ASF-ui digest to 1c49bcf

* Update dependency OpenTelemetry.Instrumentation.Runtime to v1.9.0

* Update docker/build-push-action action to v6.0.1

* Add support for selected bot groups

* Automatic translations update

* Update ASF-ui digest to 3ae4df4

* Update dependency Microsoft.IdentityModel.JsonWebTokens to v7.6.2

* Bump

* Update docker/build-push-action action to v6.0.2

* chore: blacklist summer sale 2024 appid (JustArchiNET#3226)

refers to https://steamcommunity.com/my/gamecards/2861690

* Bump

* Automatic translations update

* chore(deps): update docker/build-push-action action to v6.1.0

* Automatic translations update

* Automatic translations update

* Resolve selected .NET 9 analyzer warnings

* Move dockerfiles from legacy KV format

https://docs.docker.com/reference/build-checks/legacy-key-value-format/

* Misc

* Automatic translations update

* Add deprecation helper

* Bump

* chore(deps): update docker/build-push-action action to v6.2.0

* chore(deps): update github/codeql-action action to v3.25.11

* Automatic translations update

* chore(deps): update asf-ui digest to 91c39f3

* Automatic translations update

* Automatic translations update

* chore(deps): update asf-ui digest to 6a4b92a

* Automatic translations update

* chore(deps): update docker/build-push-action action to v6.3.0

* chore(deps): update jetbrains/qodana-action action to v2024.1.8

* Remove deprecated functionality, bump

* Automatic translations update

* chore(deps): update docker/setup-buildx-action action to v3.4.0

* chore(deps): update wiki digest to 743294a

* chore(deps): update actions/download-artifact action to v4.1.8

* chore(deps): update actions/upload-artifact action to v4.3.4

* Automatic translations update

* chore(deps): update asf-ui digest to cd60876

* chore(deps): update dependency jetbrains.annotations to v2024 (JustArchiNET#3243)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Automatic translations update

* Update prometheus exporter to fixed version

Apparently all of our issues should be resolved by now

* Bump

* chore(deps): update wiki digest to 469c6c7

* chore(deps): update wiki digest to 7539ff8

* Automatic translations update

* Cleanup main csproj file

* Misc

* Automatic translations update

* chore(deps): update actions/setup-dotnet action to v4.0.1

* Misc

* Update config.yml

* Fix ASF trying to create www folder if it doesn't exist yet

It seems that ASP.NET is trying to create initialized WebRootPath if it doesn't exist yet. This might be unwanted, as user might want to explicitly disable www directory while still having interest in IPC. On top of that, ASF will outright crash if creating such directory will be impossible, e.g. because of insufficient permission.

It makes sense for us to check first if the directory exists - if not, we can omit it entirely, so ASP.NET will default to NullFileProvider and simply respond 404 to everything unhandled from the code perspective.

@SuperSandro2000 will resolve NixOS/nixpkgs#312242 without a need of disabling IPC. In other words, you can use IPC with no www folder attached in order to still have ASF API and /swagger available. ASF will no longer crash in this scenario, it also won't try to create a directory on read-only filesystem.

* Misc

* chore(deps): update asf-ui digest to 29f16e8

* Automatic translations update

* chore(deps): update asf-ui digest to 329c79b

* chore(deps): update actions/attest-build-provenance action to v1.3.3

* Fix struct reordering (JustArchiNET#3247)

* chore(deps): update actions/setup-node action to v4.0.3

* chore(deps): update dependency microsoft.identitymodel.jsonwebtokens to v7.6.3

* Misc optimization

* Automatic translations update

* Misc

* chore(deps): update asf-ui digest to 3aab5a4

* Automatic translations update

* chore(deps): update asf-ui digest to 6df84ff

* chore(deps): update github/codeql-action action to v3.25.12

* chore(deps): update wiki digest to 0b5412c

* Automatic translations update

* Automatic translations update

* Misc

* Monitoring (JustArchiNET#3251)

* Add more plugin metrics

* Update dashboard to account for changed labels in upstream library and new plugin metrics

* Bring back deprecated function

* Bump

* Misc

* chore(deps): update docker/build-push-action action to v6.4.0

* Automatic translations update

* chore(deps): update asf-ui digest to bd5cdf0

* chore(deps): update dependency microsoft.identitymodel.jsonwebtokens to v8 (JustArchiNET#3252)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency mstest to v3.5.0

* chore(deps): update asf-ui digest to a1d6bea

* chore(deps): update docker/build-push-action action to v6.4.1

* chore(deps): update github/codeql-action action to v3.25.13

* Remove ConfigureAwaitChecker.Analyzer

Appropriate detecion is now available in Roslyn

* Misc

* chore(deps): update dependency steamkit2 to v3.0.0-alpha.2

* Misc SK2 improvements

* chore(deps): update docker/build-push-action action to v6.5.0

* chore(deps): update docker/login-action action to v3.3.0

* chore(deps): update docker/setup-buildx-action action to v3.5.0

* chore(deps): update dependency microsoft.identitymodel.jsonwebtokens to v8.0.1

* chore(deps): update crowdin/github-action action to v2.1.0

* Automatic translations update

* chore(deps): update asf-ui digest to 62a5689

* Automatic translations update

* chore(deps): update github/codeql-action action to v3.25.14

* Automatic translations update

* chore(deps): update asf-ui digest to 74f0f71

* Misc fix against case-sensitivity for 2fafinalized

* chore(deps): update crowdin/github-action action to v2.1.1

* chore(deps): update github/codeql-action action to v3.25.15

* Bump

* chore(deps): update asf-ui digest to a138b8c

* chore(deps): update wiki digest to d2c0479

* Automatic translations update

* chore(deps): update asf-ui digest to 07ceace

* chore(deps): update wiki digest to d8213b7

* chore(deps): update docker/setup-buildx-action action to v3.6.1

* Automatic translations update

* chore(deps): update asf-ui digest to 745b067

* chore(deps): update actions/attest-build-provenance action to v1.4.0

* Automatic translations update

---------

Co-authored-by: Łukasz Domeradzki <[email protected]>
Co-authored-by: ArchiBot <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Göls <[email protected]>
Co-authored-by: Jack Nolddor <[email protected]>
Co-authored-by: Vita Chumakova <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. 🙏 Wishlist Issues marked with this label are wishlisted. We'd like to make them happen but they're not crucial.
Projects
None yet
Development

No branches or pull requests

2 participants