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

feat/improve configuration #75

Merged
merged 80 commits into from
Apr 21, 2022
Merged

Commits on Oct 4, 2021

  1. Configuration menu
    Copy the full SHA
    b5c5417 View commit details
    Browse the repository at this point in the history
  2. config: remove config_default.toml since its now part of the classes

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    6a1b0c2 View commit details
    Browse the repository at this point in the history
  3. fix: add missing items to the configuration

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    5afc196 View commit details
    Browse the repository at this point in the history
  4. fix: have a test token in the pytest env

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    f8fabf5 View commit details
    Browse the repository at this point in the history
  5. enable slots on cfg classes, fix colour converter, properly prevent t…

    …oken from being changed
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    6cc4e20 View commit details
    Browse the repository at this point in the history
  6. fix: remove unused class definitions

    when converting to a marshmallow schema, desert does not use class defined Meta classes
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    82b1c73 View commit details
    Browse the repository at this point in the history
  7. config: add autogenerated default cfg toml file

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    4a80406 View commit details
    Browse the repository at this point in the history
  8. fix: properly deserialize discord.Colour to a string representation

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    311ff54 View commit details
    Browse the repository at this point in the history
  9. feat: add configuration via a yaml cfg file

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    62aa7dc View commit details
    Browse the repository at this point in the history
  10. fix: allow log level 50, as documented

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    e4d9e1e View commit details
    Browse the repository at this point in the history
  11. feat: made testable config system by refactor config file loading

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    70128af View commit details
    Browse the repository at this point in the history
  12. tools: add pre-commit hook to automatically export default config

    if any modmail configuration file is edited, a pre-commit hook will run to check that the autogenerated files are up-to-date
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    4707d6c View commit details
    Browse the repository at this point in the history
  13. tools: automatically export required environment varaibles to .env.te…

    …mplate
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    26cc817 View commit details
    Browse the repository at this point in the history
  14. tools: add app.json to configuration exports

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    b8d7080 View commit details
    Browse the repository at this point in the history
  15. minor: manaually update references to configuration files

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    19ddc22 View commit details
    Browse the repository at this point in the history
  16. fix: add missing modmail dependencies to additional hook dependencies

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    06aad80 View commit details
    Browse the repository at this point in the history
  17. fix: no configuration files now loads the default config

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    cc50262 View commit details
    Browse the repository at this point in the history
  18. fix: create a Config instance when adding it to the bot

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    bdc7d42 View commit details
    Browse the repository at this point in the history
  19. fix: load prefix from modmail_config.toml if not in .env

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    29de36e View commit details
    Browse the repository at this point in the history
  20. fix: ignore extra configuration variables

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    2166f8c View commit details
    Browse the repository at this point in the history
  21. minor: use attr helper method instead of reimplementing it

    checked with a debug command while in a debug session
    '{x for x in attr.fields(klass)} == attribs' is True.
    They are exactly the same, so I've switched to using the attr method instead of rolling my own.
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    be6b698 View commit details
    Browse the repository at this point in the history
  22. chore: switch _load_config to pack positional args rather than requir…

    …e an iterable
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    4a367c4 View commit details
    Browse the repository at this point in the history
  23. fix: rewrite environment variable parser to support all configuration…

    … options
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    4e085d7 View commit details
    Browse the repository at this point in the history
  24. feat: add ConfigMetadata part 1

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    4495938 View commit details
    Browse the repository at this point in the history
  25. fix recursive dict update overriding set values

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    0085f2a View commit details
    Browse the repository at this point in the history
  26. chore: update export docstring

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    9417d3c View commit details
    Browse the repository at this point in the history
  27. fix: respect priorty of configuration sources

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    bb1d956 View commit details
    Browse the repository at this point in the history
  28. fix pre-commit maybe

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    d5f1290 View commit details
    Browse the repository at this point in the history
  29. nit: rename config class Bot to BotCfg to prevent future confusion

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    f3c3326 View commit details
    Browse the repository at this point in the history
  30. fix: add ConfigMetadata part 2

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    6e14be0 View commit details
    Browse the repository at this point in the history
  31. chore: remove unused dict manipulation method

    removed the now defunct _recursive_dict_update method
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    c05e0bb View commit details
    Browse the repository at this point in the history
  32. chore: implement new metadata options on cfg default export

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    444aca1 View commit details
    Browse the repository at this point in the history
  33. tests: add config loading tests

    test if the cofngiruation properly reads from provided files
    
    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    014e9aa View commit details
    Browse the repository at this point in the history
  34. feat: add configuration manager cog

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    2a2b9dc View commit details
    Browse the repository at this point in the history
  35. migrate some existing values to new configuration

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    9eeee2e View commit details
    Browse the repository at this point in the history
  36. minor: hide frozen values which can't be changed from the configuration

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    d6cbf86 View commit details
    Browse the repository at this point in the history
  37. feat: rudimentary setting and getting configuration status

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    249fa5e View commit details
    Browse the repository at this point in the history
  38. refactor getvalue

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    a3402a8 View commit details
    Browse the repository at this point in the history
  39. fix: don't load the .env file to the environment

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    21a46d4 View commit details
    Browse the repository at this point in the history
  40. minor: change config pre-commit hook to exit with 1 if files edited

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    a22f51a View commit details
    Browse the repository at this point in the history
  41. fix precommit requirements

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    1c7dd19 View commit details
    Browse the repository at this point in the history
  42. config: allow emojis to be set (needs more work)

    Signed-off-by: onerandomusername <genericusername414+git@gmail.com>
    onerandomusername committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    dd0e287 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    76ff3cd View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    9409421 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    627e650 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2021

  1. Configuration menu
    Copy the full SHA
    4b8d288 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    94b14e0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4117dcc View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2021

  1. Configuration menu
    Copy the full SHA
    7743899 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    003177e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b4e0b7d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d644a96 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    52a339d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0937a13 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3c60d4c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5ad572d View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2021

  1. fix: use commands.run_converters() in the configuration manager

    ensures that we use the cache and special conversion methods to convert variables
    this means that all of the varaible conversion is handled by discord.py
    all conversion errors are propagated outwards and caught by our error handler
    onerandomusername committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    8bc7c27 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    263ad6b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a596b4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81c08da View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    196d2a8 View commit details
    Browse the repository at this point in the history
  6. nits: standardize naming and make class names more self explanatory

    cfg, config, configuration... why so many similarily named classes???
    onerandomusername committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    ebcaf94 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2fd074c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fa02b34 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3d1986d View commit details
    Browse the repository at this point in the history
  10. use factories to generate mutable classes and add more logging

    tests: mark xfail the test for default config caching
    onerandomusername committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    ff04a5a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    258fa1b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    bfe641c View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2021

  1. Configuration menu
    Copy the full SHA
    fe53cf7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4e7fb22 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dd2f16c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    03fd57f View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2021

  1. Configuration menu
    Copy the full SHA
    f0ec067 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2022

  1. chore: address reviews

    restructuring, using 'startswith', other updates
    onerandomusername committed Jan 2, 2022
    Configuration menu
    Copy the full SHA
    09a33d4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8d18ccc View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2022

  1. Configuration menu
    Copy the full SHA
    4087767 View commit details
    Browse the repository at this point in the history
  2. fix: pin discord.py

    onerandomusername committed Apr 21, 2022
    Configuration menu
    Copy the full SHA
    5911ff8 View commit details
    Browse the repository at this point in the history
  3. update black

    onerandomusername committed Apr 21, 2022
    Configuration menu
    Copy the full SHA
    768277e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    62e82fa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4644d76 View commit details
    Browse the repository at this point in the history