Skip to content

Commit

Permalink
ci: add CI job to create issues for our code TODOs. (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Aug 4, 2023
1 parent 1ed71c6 commit 27a70cd
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 15 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/todos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ☑️ Create issues from TODOs

on:
workflow_dispatch:
inputs:
importAll:
default: 'false'
required: false
type: boolean
description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing.
push:
branches:
- main

permissions:
issues: write
repository-projects: read
contents: read

jobs:
todos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run Issue Bot
uses: derjuulsn/todo-issue@main
with:
blobLinesBefore: 2
label: code:todo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion crates/bones_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct AssetProviders {
pub type ResAssetProviders<'a> = bones_ecs::system::Res<'a, AssetProvidersResource>;

/// The type of the [`AssetProviders`] resource.
// TODO: Make a custom system parameter to prevent needing to manualy .borrow() this resource.
// TODO: Create custom system parameter to prevent needing to manualy `.borrow()` `AssetProvidersResource`.
#[derive(Deref, DerefMut, Clone, TypeUlid)]
#[ulid = "01GNWY5HKV5JZQRKG20ANJXHCK"]

Expand Down
2 changes: 1 addition & 1 deletion crates/bones_bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub mod _private {
}

/// Trait that may be derived to implement a Bevy asset type.
// TODO: Integrate or move HasLoadProgress with BonesBevyAsset.
// TODO: Integrate or move `HasLoadProgress` to `BonesBevyAsset`.
pub trait BonesBevyAsset: TypeUlid + Asset {
/// Install the asset loader for this type.
fn install_asset(app: &mut App);
Expand Down
3 changes: 2 additions & 1 deletion crates/bones_bevy_renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ glam = { version = "0.23", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
# TODO: Update when PR merged: https://github.com/forbjok/bevy_simple_tilemap/pull/9
# TODO: Update `bevy_simple_tilemap` when our PR is merged.
# https://github.com/forbjok/bevy_simple_tilemap/pull/9
bevy_prototype_lyon = "0.8"
# Disable default features to remove rayon par-iter, is not performant. Once https://github.com/forbjok/bevy_simple_tilemap/pull/17 is merged,
# switch off fork back to original crate.
Expand Down
8 changes: 4 additions & 4 deletions crates/bones_bevy_renderer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn sync_sprites<W: HasBonesWorld>(

let world = world_resource.world();

// TODO: Evaluate cost of calling this every frame
// TODO: Evaluate cost of initializing bones render components every frame.
world.components.init::<bones::Sprite>();
world.components.init::<bones::Transform>();

Expand Down Expand Up @@ -419,9 +419,9 @@ fn sync_tilemaps<W: HasBonesWorld>(
tile_map.clear();
tile_map.set_tiles(tile_iter);

// TODO: This is probably a bug in bevy_simple_tilemap. If the tilemap atlas has been
// changed, and one of the tiles in the map had a tile index greater than the max tile
// count in the new atlas, the map renderer will panic.
// This is maybe a bug in bevy_simple_tilemap. If the tilemap atlas has been changed,
// and one of the tiles in the map had a tile index greater than the max tile count in
// the new atlas, the map renderer will panic.
//
// This shouldn't happen because we made sure to `clear()` the tiles and ensured that
// all the new tile indexes are clamped, but apparently the chunks are updated a frame
Expand Down
2 changes: 1 addition & 1 deletion crates/bones_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ keysize32 = []
aligned-vec = "0.5"
anyhow = "1.0"
atomic_refcell = "0.1"
# TODO: Replace with our own macros
# TODO: Replace Bevy's `Deref` and `DerefMut` derives with our own macros.
bevy_derive = "0.10"
bitset-core = "0.1"
bytemuck = "1.12"
Expand Down
2 changes: 1 addition & 1 deletion crates/bones_ecs/src/components/untyped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl UntypedComponentStore {
.map(|(_i, x)| x),
)
} else {
// TODO: More tests for this iterator
// TODO: Add more tests for the ZST component iterator.
let mut idx = 0usize;
let max_id = self.max_id;
let iterator = std::iter::from_fn(move || loop {
Expand Down
3 changes: 2 additions & 1 deletion crates/bones_ecs/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::error::Error;

/// The types of errors used throughout the ECS.
// TODO: Re-evaluate possible errors. Some of them may not be used anymore.
// TODO: Re-evaluate `EcsError` variants.
// Some of them may not be used anymore.
#[derive(Debug, thiserror::Error)]
pub enum EcsError {
/// A resource was not initialized in the [`World`][crate::World] but the
Expand Down
7 changes: 4 additions & 3 deletions crates/bones_ecs/src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ pub struct UntypedResourceInfo {
/// The memory layout of the resource
pub layout: Layout,
/// Cell containing the raw pointer to the resource's data
// TODO: Evaluate possibility of avoiding an `Arc` here, and just passing references with a
// lifetime for acessing it, instead of cloning the Arc like we do here.
// TODO: Evaluate possibility of avoiding an `Arc` clone.
// We might be able to just just pass references with a lifetime for acessing it,
// instead of cloning the Arc like we do here.
pub cell: Arc<AtomicRefCell<*mut u8>>,
/// A function that may be called to clone the resource from one pointer to another.
pub clone_fn: unsafe extern "C" fn(*const u8, *mut u8),
Expand Down Expand Up @@ -323,7 +324,7 @@ mod test {
resources.insert(A(vec![7, 8, 9]));
assert_eq!(resources.get::<A>().borrow().0, vec![7, 8, 9]);

// TODO: Split into more focused test for cloning
// TODO: Create more focused test for cloning resources.
assert_eq!(r2.get::<A>().borrow().0, vec![3, 2, 1]);

resources.insert(B(1));
Expand Down
2 changes: 1 addition & 1 deletion crates/bones_matchmaker/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async fn impl_proxy(match_info: MatchInfo, clients: Vec<Connection>) -> anyhow::
.detach();

// Spawn task for handling the client's unreliable messages
// TODO: De-duplicate this code a little?
// TODO: De-duplicate matchmaker proxy code if possible.
task_pool
.spawn(async move {
let result = async {
Expand Down
3 changes: 2 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ allow = [
"CC0-1.0",
"ISC",
"BSD-2-Clause",
"MPL-2.0", # TODO(zicklag): I believe MPL is fine for us, but maybe double-check this.
# TODO: Validate that it is not a problem for us to have MPL licensed dependencies.
"MPL-2.0",
"OpenSSL",
]
default = "deny"
Expand Down

0 comments on commit 27a70cd

Please sign in to comment.