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

Change to GitHub workflow badge routes #8671

Comments

@chris48s
Copy link
Member

chris48s commented Dec 1, 2022

🥱 TL;DR

If you have a github workflow .github/workflows/test.yml

name: Run Tests
...

You need to update your badge URL from

https://img.shields.io/github/workflow/status/<user>/<repo>/Run%20Tests
to
https://img.shields.io/github/actions/workflow/status/<user>/<repo>/test.yml?branch=main

  • The key change here is that the workflow parameter is now the workflow filename, not the name: defined in yaml
  • We also recommend specifying the branch param in most cases, although it is not required.

If a branch param is not supplied the badge will look first for builds on your default branch and then fall back to the latest build on any branch or ref if none are found on the default branch. This is mainly useful for "branchless" worfklows (like workflows that runs against a tags or release).

If your workflow is in a subdirectory under .github/workflows, include the subdir in the route.

https://img.shields.io/github/actions/workflow/status/<user>/<repo>/sub_directory/test.yml?branch=main

Note that the workflow filename/path is case sensitive.

❓ Why are we making this change?

This change resolves the problem reported in #8146 Some users were reporting that our badges were reporting incorrect or unexpected values in some situations.

After consulting with GitHub support, it transpired that identifying workflows using the name in the yaml file can be ambiguous in some situations and defaults to finding workflows on any branch when a branch param is not specified, rather than the default branch. Switching to identifying workflows by the workflow filename and making branch a required parameter resolves these problems. Two workflows can have the same name string in yaml, but filename is unique on a given branch. GitHub themselves have quietly switched their own native badges to using this method.

We decided that dropping the old badges (using the workflow name) and requiring users to switch to the new URLs (rather than keeping the old ones "working") was the right choice for our users because in some cases the old badges were serving data which was inaccurate or unexpected in subtle ways. Serving accurate data is the most important thing for us to prioritise.

😭 You made a breaking change! Waa

We know. We try never to do this and it is not a decision we took lightly, especially given this is one of our highest traffic badges. In general, our philosophy is: If you embedded a shields badge in your README in 2013 and the upstream service is still online, that badge should still work today. We achieve this with almost no exceptions.

Occasionally we do need to change badge routes for various reasons, but usually we keep old URLs working using redirects. In this case, it was not possible to provide a transition because the new badge route uses a different parameter.

One of the reasons we try to never do this is because we don't really have a great way to communicate a breaking change to our users or provide warning before it happens. We have no idea who uses our service. We don't ask anyone to sign up, we don't track you. Hopefully given that constraint we have done a reasonable job of this.

📚 Further Reading

@chris48s chris48s changed the title Placeholder issue Change to GitHub workflow badge routes Dec 15, 2022
@chris48s chris48s pinned this issue Dec 15, 2022
kevinoid added a commit to kevinoid/python-project-template that referenced this issue Dec 15, 2022
As required by badges/shields#8671

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
kevinoid added a commit to kevinoid/node-project-template that referenced this issue Dec 15, 2022
As required by badges/shields#8671

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
kevinoid added a commit to kevinoid/node-project-template that referenced this issue Dec 15, 2022
As required by badges/shields#8671

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
igorpecovnik added a commit to armbian/build that referenced this issue Dec 15, 2022

Verified

This commit was signed with the committer’s verified signature.
igorpecovnik added a commit to armbian/build that referenced this issue Dec 15, 2022

Verified

This commit was signed with the committer’s verified signature.
igorpecovnik added a commit to armbian/build that referenced this issue Dec 15, 2022

Verified

This commit was signed with the committer’s verified signature.
dangowans added a commit to cityssm/lot-occupancy-system that referenced this issue Dec 15, 2022
josiah-wolf-oberholtzer added a commit to josiah-wolf-oberholtzer/uqbar that referenced this issue Dec 15, 2022
josiah-wolf-oberholtzer added a commit to josiah-wolf-oberholtzer/supriya that referenced this issue Dec 15, 2022
stephane-caron added a commit to qpsolvers/qpsolvers that referenced this issue Dec 15, 2022

Verified

This commit was signed with the committer’s verified signature.
stephane-caron Stéphane Caron
EgorBron added a commit to Blusutils/DESrv that referenced this issue Dec 15, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
stephane-caron added a commit to tasts-robots/pink that referenced this issue Dec 15, 2022

Verified

This commit was signed with the committer’s verified signature.
stephane-caron Stéphane Caron
AlbertUnruh added a commit to Alberto-X3/Alberto-X3-V3 that referenced this issue Dec 15, 2022
in reaction to badges/shields#8671
markus-k added a commit to markus-k/adventofcode that referenced this issue Dec 15, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
according to badges/shields#8671
SaifAqqad added a commit to SaifAqqad/AHK_MicMute that referenced this issue Dec 15, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Techcable added a commit to slog-rs/slog that referenced this issue Sep 10, 2023
ranisalt pushed a commit to ranisalt/node-argon2 that referenced this issue Sep 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
The path in shields has undergone the following changes:
badges/shields#8671
gogo2464 pushed a commit to gogo2464/pwntools that referenced this issue Sep 10, 2023
The old API was a hack apparently, but it looks like GitHub Actions slowly gets less and less sketchy over time, and even goes as far as providing well-designed APIs.
Ref. badges/shields#8671
muscliary pushed a commit to muscliary/cobra that referenced this issue Sep 12, 2023
mirdaki added a commit to mirdaki/theforce that referenced this issue Sep 12, 2023
mirdaki added a commit to mirdaki/theforce that referenced this issue Sep 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* Fix the build status button

badges/shields#8671

* Remove branch query
stakach pushed a commit to PlaceOS/PlaceOS that referenced this issue Sep 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update README.md

Fix CI build badges, see: badges/shields#8671
patrickm68 added a commit to patrickm68/NodeJS-core-utils that referenced this issue Sep 14, 2023
Update the build shield badge to the new format.

Refs: badges/shields#8671
EFord36 added a commit to EFord36/uvloop that referenced this issue Sep 14, 2023
See the linked GitHub issue from the previous version of the badge:
badges/shields#8671

In summary, this type of badge was changed in a breaking fashion such that
the badges were just linking to the github issue rather than showing the
data. Updating the url resolves this.

Also update the link of the badge to specify the workflow file rather
than the name, which matches the new behaviour of the badge.
acook added a commit to acook/remedy that referenced this issue Sep 15, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
noraj added a commit to noraj/vscode-languagetool-linter that referenced this issue Sep 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
austinabell added a commit to austinabell/nesdie that referenced this issue Sep 17, 2023

Verified

This commit was signed with the committer’s verified signature.
austinabell Austin Abell
austinabell added a commit to austinabell/ipld-proofs that referenced this issue Sep 17, 2023

Verified

This commit was signed with the committer’s verified signature.
austinabell Austin Abell
phijor added a commit to phijor/mopidy-notify that referenced this issue Sep 17, 2023
kangalio added a commit to serenity-rs/poise that referenced this issue Sep 19, 2023

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
* Move check inherit testing code to separate file

* Quickstart: auto-register commands on startup

* user_data_setup->setup

But keep a deprecated function alias so this is not breaking

* Rearrange quickstart type definitions

To save one line and to make the ordering more logical (Data and Error always appear in this order in poise, and Context should follow after because it refers to the previous two)

* Add register_in_guild and register_globally convenience

* Rename listener to event_handler

* Fix fmt and docs

* Change autocomplete callback value conversion from json::Value::from() to json::to_value() [json!() macro does this]. (#128)

* serenity_context and poise::Context traits

* Allow supplying timeout to modal execute

* Fix example

* Fix docs

* Bump to 0.5.0

* [Feature] Allow to bypass command checks for owners (#130)

* introduce skip_checks_for_owner feature

* fix skip_checks_for_owners

* fix missing owner check for `skip_checks_for_owners`

* Separate cooldowns and min max testing

It was stuffed into the add command before, now it's separate commands `cooldowns` and `minmax`

* Don't panic on modal timeout

* Fallback to HTTP in user_permissions even with cache enabled

* Update rustdoc-scrape-examples invocation

* Bump to 0.5.1

* Update Cargo.lock

To get rid of "cpufeatures 0.2.2 is yanked" message

* Impl SlashArgument instead of SlashArgumentHack

For primitive types and model types, the slash argumen trait impl is using SlashArgument instead of SlashArgumentHack now, which means those implementations are visible in the docs. Which is very much nicer than before.

Also, this commit makes SlashArgument::choices a default method. I decided it's annoying to have to unconditionally implement it even though it's `Vec::new()` in most cases. I originally didn't make it a default method just for "safety" so you don't forget to implement it _if_ you need it but I think that's a bad argument

* Fix sneaky bug

Welp and I was wondering why editing non-track_edits command `~say` re-runs the command (but not reuses response, or tracks deletions (coming in next commit))... It's because dispatch_message gets given a MessageEditFromInvalid... But why? Yeah because I mixed up the two match cases

* Add track_deletion

* Make builtins::servers aware of teams. (#133)

* Add all Context's methods to Prefix/ApplicationContext

Theoretically a small breaking change (some Context methods changed from &self to self. Some lifetimes were also changed from the &self lifetime to 'a, but this is not breaking because the lifetime has been strictly expanded. Anyways I'm not making a breaking release for this because it will realistically affect nobody and it causes more total pain making this a breaking release)

* Increase MSRV to 1.60.0 due to time crate

And set rust-version Cargo.toml field for the first time (it was added in 1.56)

* Update CI badge in README

badges/shields#8671

* Bump to 0.5.2

* Add missing `Detailed changelog`'s in CHANGELOG

* Add paginate

* Always print Command errors to console also

The result of a lengthy debugging ssession with Logan King. The problem: if a slash command initial response has an error (e.g. empty content), the interaction completely expires, you can't use it anymore. Any further attempt at sending a response is `Unknown Interaction` or `Unknown Webhook`. So the default error handler for command errors, which just sends the error message to Discord, ran into this, and was unable to send the error message to Discord. And the FrameworkOptions::on_error default error handler emits a log::error in that case, but obv the user doesn't see that when not having logging configured. So Logan King was rightly really confused why their bot was just endlessly showing "... Sending command ..." - that's apparently Discord's helpful way of saying "the bot did respond, but with an error, so we locked this interaction ^.^ and instead of 'this bot responded incorrectly' or something we'll show an endless loading message! this will definitely not confuse anyone ever! ^.^". ANYHOW, this commit unconditionally prints Command errors via eprintln!() as well in the default error handler, so it can't be missed

* Feature guard pagination example (#138)

* Print login message in framework_usage

* Add missing commas in macros for localizations (#143)

* Add missing commas in macros for localizations

* Add testing code

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>

* Document default_member_permissions

Fixes #145

* Add EventWrapper example

Fixes #146

* Add missing events to EventWrapper (#144)

* Add unit test example

Fixes #142

* Update links in README.md (kangalioo -> serenity-rs)

* Add panic handler (#140)

* Restructure dispatch::slash functions like prefix

Forgot some stuff from restructguring

* Catch panics during command execution

- Adds FrameworkError::CommandPanic
    - The default on_error impl spawns a nice error embed
- Wraps all instances of run_invocation/run_interaction/run_autocomplete in catch_unwind
- Adds a `div` command to the testing crate to test the panic catching (by triggering a div by zero)

* Replace let-else with match to please MSRV

* Gate catch_unwind call behind feature flag

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>

* Update kangalioo -> serenity-rs and fix typos

Changes extracted from the pre-force-push #140 (6c082b5...1bac198)

* Split develop branch into current and next

* Bump to 0.5.3

* Fix FrameworkContext::user_data being async (#137)

* Fix FrameworkContext::user_data being async

* fmt

* Make FrameworkContext::user_data async again

I realized the function was supposed to be async to stay API-compatible with the Framework methods, that's how it was created in c10ec4d.

This commit basically reverts #137, except for the lint changes

* Optionally display subcommands in help menu

Only one recursion level deep so far because infinite recursion would have been a pain and I don't even know if that's what users want so it's single recursion level for now and if someone complains I'll go through the async recursion trouble

* Amend to previous commit: clippy allow

* Remove redundant import in testing crate

* Change CommandPanic payload type to Option<String>

Previously, it was Box<dyn Any + Send> - making the entire type not Sync. This wasn't intentional.

This is technically a breaking change, but since CommandPanic was only introduced a few days ago, and was itself a breaking change, this is basically just a quick hotfix reversal of a breaking change.

* Bump to 0.5.4

* Support #[min_length] #[max_length]

Fixes #154

* Bump to 0.5.5

* Make a bunch of structs non_exhaustive...

...and rename AutocompleteChoice.name to label (I think it fits better)

* Forgot enums (while applying non_exhaustive)

* Test RoleParseError downcasting

* Rework of builtins::help() (#161)

* Rework of builtins::help()

* Use find_command instead of duplicating code

* Fix env variable `set` -> `export` for Unix

* Fix unneeded mut

* cargo fmt

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>

* Add HelpConfiguration:include_description

#161 changed single help command to include description. This commit makes it optional (but keeps the new behavior as default)

* Fix cargo test

* Change Command field types

- category: `Option<&'static str>` -> `Option<String>`
- help_text: `Option<fn() -> String>` -> `Option<String>`
- aliases: `&'static [&'static str]` -> `Vec<String>`
- context_menu_name: `Option<&'static str>` -> `Option<String>`

The &'static references meant you couldn't dynamically change those values which is very powerful so better do this breaking change now than potentially later.
It's not like it hurts to use String and Vec here due to the allocations - every bot will have a two-digit, max three-digit number of Command instances anyways and they will all be initialized on startup.

Also, the fn() in help_text was really ugly and was just a hack for rustbot to share common parts of the help text. But this should be done by just changing the help_text field in main() or whatever. Actually though, I was able to keep the #[command] attribute's help_text_fn field working. But it runs the function at command construction time now instead of on demand when help is called. So, behavior change technically

* Deduplicate CreateReply creation code

Adds Context::reply_builder

* Remove outdated TODO

* Remove pub(super) and make private instead

In my opinion pub(crate) or pub(any other path) is a code smell. If you're trying to use it, then either:
- your module structure is messed up and you should move code that accesses implementation detail of your type into the same module as that type (this was the reason for the pub(super) from this commit. The required restructuring I apparently already did some time ago)
- those "implementation" details should actually be public because trying to fully use that type evidently requires accessing those details (that's why for example poise's EditTracker methods are public, or why the CreateReply::reply_builder method I recently added is public)

* Remove unused function warning when testing

* Okay apparently Discord needs "es-ES" instead of "es" now

* Add ChoiceParameter trait instead of direct impls

Fixes #126

* fix: typo (#165)

Co-authored-by: xtfdfr <sadorowo@gmail.com>

* Support pattern parameters in #[command]

Fixes #158

Wow this more complicated than I expected

* Fix with simd-json (amend to 8471b6e)

* Restructure `#[command]` docs into sub headings

* Refinements to builtins::help (#167)

* Refinements to builtins::help

* Make rustfmt happy

* Make MSRV happy

---------

Co-authored-by: Rogier 'DocWilco' Mulhuijzen <github@bsdchicks.com>

* Add Infallible to __NonExhaustive enum variants

* Restructure examples

framework_usage and testing are gone in favor of basic_structure and framework_features. The examples/README now describes what each example contains. And the root README points to the examples folder

[amend commit] fix rustfmt

[amend commit] fix some things to make the example actually runnable (lol), fix feature gates, use poise::builtins::register_globally

* Add Context::{cache, http} shorthands

And remove the internal `.sc()` function in favor of the `.cache()` shorthand or full blown `.serenity_context()`

[amend commit] fix feature gate

* Use eprintln in default Setup error handler

Previously it used log::error which is not visible enough. If someone doesn't have a logger configured, they will miss it and it will cause BIG TIME confusion. Had it happen to someone I helped debug in #poise, and I Just fell into that trap myself and was downloading and using CodeLLDB, looking through tokio internals, looking up async debuggers, placing dbg!()'s deep within serenity's HTTP code; before finding out it was just some setup error

* feature: subcommmand_required parameter (#170)

* Add Infallible to __NonExhaustive enum variants

* add: subcommmand_required

* Fix a few things

- The code was not properly formatted (`cargo fmt --all`)
- There was a redundant is_subcommand value added to a bunch of things (including find_command - this PR was a breaking change and would have belonged to the `next` branch! But since is_subcommand was redundant and I removed it, this PR becomes not-breaking again (which makes sense; this kind of small feature shouldn't need breaking changes))
- The is_subcommand check was in the wrong place. The parse_invocation is really only for parsing, not for any action. If it returns an error, it should be an error in _parsing_, not in execution or usage. And it also belongs after the track_edits related checks, because if a message was edited that poise isn't even allowed to care about, it shouldn't throw an error too (this would have been another problem with the is_subcommand check in parse_invocation)

* Improve text

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>
Co-authored-by: xtfdfr <sadorowo@gmail.com>

* Make FrameworkError and SlashArgError variants non_exhaustive

* Added Support for Opening Modals as an MCI Response (#173)

* feat: added support for responding to an mci with a modal

* feat: added example, simplified modal send as mci interface

* fix: fixed example

* Some changes ™

- Move component modal example into modal.rs instead of making new file
- Make component modal example prefix_command too to catch any oversights that may make component modals rely on a slash command interaction being present (e.g. previously, execute_component_interaction took ApplicationContext and couldn't be invoked in prefix context at all)
- Deduplicate code between execute_modal and execute_component_interaction (and rename the latter to be clearer)
- Remove Modal::execute_component_interaction function in favor of free-standing execute_modal_on_component_interaction function - I want to avoid an explosion of utility trait functions for any combination of defaults yes/no, component yes/no... That said, I realize we're already halfway in this mess with execute and execute_with_defaults both existing so I'd also be open to go all the way and add execute_component_interaction and execute_component_interaction_with_defaults
- Add `impl AsRef<serenity::Context> for poise::Context` to make free-standing execute_modal_on_component_interaction function work well; and because it makes sense in general to have

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>

* Add CooldownContext struct to make Cooldowns usable in more situations (#175)

* Convert Cooldowns to use HashMap instead of OrderedMap for better scaling (#180)

* Fix failing CI build (#181)

- Update serenity 0.11.6 -> 0.11.5
- Update proc_macro2 1.0.47 -> 1.0.64
- Disambiguate several serenity re-exports
- Temporarily disable serenity/simdjson test since feature is broken upstream (serenity-rs/serenity#2474)

* add `reply()` for `poise::context` (#183)

* fix the behavior of poise::reply::builder::CreateReply.reply

* unnecessary change by mistake

* change back to original

* add reply()

* remove reply_reply()

* Adhere to unwritten codebase conventions

Made on phone in GitHub's absolutely janky web UI, and untested. Let's see how this goes

---------

Co-authored-by: kangalio <jannik.a.schaper@web.de>

* Two dependency bumps (#186)

* Bump `tokio` to `1.25.1`

* Bump `env_logger` to `1.10.0`

* Bump `tokio` to `1.25.1`

* Allow passing cooldown config on demand

That way, you can have different cooldown durations depending on which user / guild / whatever is invoking the command

* Remove old `CooldownTracker` methods and migrate internals

- Renames `CooldownTracker::new_2` and `CooldownTracker::remaining_cooldown_2` to `CooldownTracker::new` and `CooldownTracker::remaining_cooldown` respectively.
- Adds a new `cooldown_config` field to `Command` wrapped in a Mutex to allow updating by the user
- Adds a new example using a command check to modify the `cooldown_config` on the `Command`
- updates `#[poise::command]` to new `Command` structure

* Bump MSRV to 1.63

Needed for dependency updates in #186 that
were done to resolve some `cargo audit`
vulnerabilities

* Remove uneccessary NonZeroU64 usage

The new serenity id types impl PartialEq<u64> and From<u64> so we don't need to bother with hhe NonZeroU64 directly

* Fix copy paste typo in pagination button IDs

Co-authored-by: jamesbt365 <jamesbt365@gmail.com>

* Fix empty initial message in pagination

Co-authored-by: jamesbt365 <jamesbt365@gmail.com>

---------

Co-authored-by: kangalioo <jannik.a.schaper@web.de>
Co-authored-by: ChancedRigor <chancedrigor@users.noreply.github.com>
Co-authored-by: Peanutbother <6437182+peanutbother@users.noreply.github.com>
Co-authored-by: Andre Julius <noromoron@gmail.com>
Co-authored-by: Gnome! <45660393+GnomedDev@users.noreply.github.com>
Co-authored-by: Maximilian Mader <max@bastelstu.be>
Co-authored-by: Whitney <67877488+whitbur@users.noreply.github.com>
Co-authored-by: Horu <73709188+HigherOrderLogic@users.noreply.github.com>
Co-authored-by: docwilco <66911096+docwilco@users.noreply.github.com>
Co-authored-by: franuś <97941280+xtfdfr@users.noreply.github.com>
Co-authored-by: xtfdfr <sadorowo@gmail.com>
Co-authored-by: Rogier 'DocWilco' Mulhuijzen <github@bsdchicks.com>
Co-authored-by: G0ldenSp00n <71467406+G0ldenSp00n@users.noreply.github.com>
Co-authored-by: B-2U <82710122+B-2U@users.noreply.github.com>
Co-authored-by: Overzealous Lotus <103554783+OverzealousLotus@users.noreply.github.com>
Co-authored-by: jamesbt365 <jamesbt365@gmail.com>
miketheman added a commit to miketheman/riot that referenced this issue Oct 3, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
tomjaguarpaw added a commit to tomjaguarpaw/haskell-opaleye that referenced this issue Oct 5, 2023
tomjaguarpaw added a commit to tomjaguarpaw/haskell-opaleye that referenced this issue Oct 5, 2023
tomjaguarpaw added a commit to tomjaguarpaw/haskell-opaleye that referenced this issue Oct 7, 2023
tomjaguarpaw added a commit to tomjaguarpaw/haskell-opaleye that referenced this issue Oct 8, 2023
bskinn added a commit to bskinn/flake8-absolute-import that referenced this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment