Skip to content

Conversation

rodrigo-pessoa-lrn
Copy link
Contributor

Problem Statement

Since PR #81 is merged (relating to typing), a workflow (Github Action CI) should be added to ensure that typing is enforced, consistent and so that it is not out of sync over time.

PR Actions

Follow up work after PR #81.

What was done

  • Added Github CI action for type checking with MyPy (using --strict setting).
  • Fixes files which did not conform / pass MyPy's strict type checking.

How was this change tested

  • Ran mypy --strict learnosity_sdk to verify all type hints and issues.
  • Ran test suite.
  • Ran coverage checker.
  • Ran learnosity-sdk-assessment-quickstart with local build.

Notes:

  • Only the file learnosity_sdk/request/init.py was failing the MyPy check. The main changes to the logic were handling the cases where the optional request parameter was not provided (i.e. was None). I chose to raise errors in the cases where request was None (but needed to a dictionary) to avoid introducing logic and potentially silent errors / bugs.

@rodrigo-pessoa-lrn rodrigo-pessoa-lrn force-pushed the AIL-44/feature/adds_type_validation_github_action branch 4 times, most recently from f7c3f2b to a3938d1 Compare November 4, 2024 17:50
@rodrigo-pessoa-lrn rodrigo-pessoa-lrn marked this pull request as ready for review November 4, 2024 17:51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 praise: couple of comments but looking good 👍

@rodrigo-pessoa-lrn rodrigo-pessoa-lrn force-pushed the AIL-44/feature/adds_type_validation_github_action branch from 0beebf2 to 2012163 Compare November 5, 2024 10:56
@rodrigo-pessoa-lrn rodrigo-pessoa-lrn changed the title Ail 44/feature/adds type validation GitHub action [FEATURE] Adds type validation GitHub action Nov 5, 2024
@rodrigo-pessoa-lrn rodrigo-pessoa-lrn force-pushed the AIL-44/feature/adds_type_validation_github_action branch 4 times, most recently from c70a7e3 to adc8c10 Compare November 5, 2024 14:11
@rodrigo-pessoa-lrn rodrigo-pessoa-lrn force-pushed the AIL-44/feature/adds_type_validation_github_action branch 3 times, most recently from e984de2 to 990e7bc Compare November 6, 2024 10:36
self.secret = secret
self.request = request
if hasattr(request, 'copy'):
# TO DO: Fix improper handling when request is a string (bug relevead by proper typing). Issue: AIL-415

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤓 nitpick:

Suggested change
# TO DO: Fix improper handling when request is a string (bug relevead by proper typing). Issue: AIL-415
# TODO: Fix improper handling when request is a string

@rodrigo-pessoa-lrn rodrigo-pessoa-lrn force-pushed the AIL-44/feature/adds_type_validation_github_action branch from 990e7bc to 66bec37 Compare November 6, 2024 12:10
@rodrigo-pessoa-lrn rodrigo-pessoa-lrn force-pushed the AIL-44/feature/adds_type_validation_github_action branch from 66bec37 to 1af8eca Compare November 6, 2024 12:12
Copy link
Contributor

@ferdia-sopermaccafraidh-lrn ferdia-sopermaccafraidh-lrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🚀

We'll follow up on that typing issue that was caught but not introduced here as well 👍

@rodrigo-pessoa-lrn rodrigo-pessoa-lrn merged commit 3b617f3 into master Nov 6, 2024
6 of 8 checks passed
@rodrigo-pessoa-lrn rodrigo-pessoa-lrn deleted the AIL-44/feature/adds_type_validation_github_action branch November 6, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants