-
Notifications
You must be signed in to change notification settings - Fork 1
Add submission_url to config and refactor logic into services #90
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
base: master
Are you sure you want to change the base?
Conversation
… explicit ruby version 3.2 because newer versions (eg 3.4) are not supported (eg BigDecimal).
Allow users to configure a custom submission url + refactor rake task logic into services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 89c6c86 in 2 minutes and 4 seconds
More details
- Looked at
1086
lines of code in16
files - Skipped
1
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. lib/grade_runner/runner.rb:7
- Draft comment:
Consider handling potential trailing slash issues when concatenating submission_root_url and submission_path. Using URI.join or ensuring proper formatting can avoid double slashes. - Reason this comment was not posted:
Comment was on unchanged code.
2. lib/tasks/grade.rake:11
- Draft comment:
Using ARGV.each to define tasks may be brittle and hard to maintain. It might be worth reviewing if this dynamic task creation is truly needed. - Reason this comment was not posted:
Comment was on unchanged code.
3. lib/grade_runner/runner.rb:7
- Draft comment:
Consider normalizing the submission_url to avoid potential double slashes if submission_root_url ends with a trailing slash. - Reason this comment was not posted:
Comment was on unchanged code.
4. lib/grade_runner/services/github_service.rb:14
- Draft comment:
Ensure ActiveSupport is required to use 'present?' here in non-Rails environments. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
5. lib/grade_runner/services/token_service.rb:28
- Draft comment:
Consider logging or handling the error context in the rescue block for validate_token to aid debugging. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
6. lib/grade_runner/services/spec_service.rb:103
- Draft comment:
Review the zip extraction logic; using 'unless File.exist?(file_path)' might skip extracting updates if a file already exists. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
7. lib/grade_runner/services/spec_service.rb:71
- Draft comment:
Consider checking the outcome of the 'git commit' command to detect commit failures rather than suppressing output. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
8. lib/grade_runner/services/token_service.rb:51
- Draft comment:
Consider updating the message 'Please enter valid token' to 'Please enter a valid token' for better clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
While the suggestion would make the message more grammatically correct, this is an extremely minor UI text change. The current message is perfectly understandable. The rules specifically say not to comment on pure UI changes and to only keep comments that require clear code changes. This feels like unnecessary nitpicking that doesn't materially improve the code.
The message could be seen as slightly unprofessional without proper grammar. Some might argue that maintaining high quality even in error messages is important.
While polish is good, this change is too minor to warrant a PR comment. The current message is clear enough for users to understand.
Delete this comment as it's about a minor UI text change that doesn't impact functionality or code quality in any meaningful way.
Workflow ID: wflow_yM0IrLgypYoWPmkG
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
end | ||
result = Oj.load(res.body) | ||
result["success"] | ||
rescue => e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rescue in validate_token
swallows errors without logging; consider logging the exception for easier debugging.
let me know if this is something you'd like to use. TLDR; lots of refactoring to improve readability and added submission_url to config. |
@heratyian, wow, thanks for this work! We will need to do some extensive testing with Grades + I am curious about your motivation for adding the cc @jelaniwoods, you may also want to take a first look at this and comment any questions or concerns. |
Correct. I've created a dpi grades server and it's working. Unfortunately I'm getting pushed to ween dpi off first draft over the next year or so. In general I really like this unit test suite grade passback in a codespace approach since students are using the tools of the trade and I can track progress in canvas. I'd like to build out more projects using grade_runner (maybe even create something for other languages) Ideally we can still work together on some open source tools like this. |
Gotcha. We had a look at the code changes and discussed this. Since these are pretty significant changes, and since reviewing and testing them on our side takes a lot of time that we don't have right now on our small team, we'd prefer that for your purposes you maintain a fork of the I think it's worth keeping this PR open for now as a reminder to us, and as a potentially useful refactoring of the gem (but in need of a thorough review), if you'd like. |
Appreciate it. fwiw I haven't tested |
Added submission_url to the config. A lot of the logic in the rake tasks was hard to follow. Used Claude to break up logic from rake task into services for better separation of concerns. Did some smoke testing and seems to not break anything.
Important
Add
submission_url
configuration and refactor rake task logic into service classes for improved modularity and maintainability.submission_url
toGradeRunner
configuration inlib/grade_runner.rb
.README.markdown
to documentsubmission_url
configuration.lib/grade_runner/services/
.ConfigService
,GithubService
,GradeService
,SpecService
, andTokenService
for modular functionality.grade.rake
andgrade_runner.rake
to use new service classes.GradeService
methods.VERSION
to0.0.14
.Gemfile
andgrade_runner.gemspec
for dependency management.Rakefile
andREADME.markdown
for clarity and accuracy.This description was created by
for 89c6c86. It will automatically update as commits are pushed.