Skip to content

[ALT-10963] Change check_profile , opening project view.#39

Merged
Tsyklop merged 7 commits into
mainfrom
bug/ALT-10963_empty_check_profile
May 14, 2026
Merged

[ALT-10963] Change check_profile , opening project view.#39
Tsyklop merged 7 commits into
mainfrom
bug/ALT-10963_empty_check_profile

Conversation

@KirillovProj
Copy link
Copy Markdown
Contributor

@KirillovProj KirillovProj commented Apr 29, 2026

Summary

  • preserve check_profile for remote tasks during YAML serialization/deserialization and student task updates, so server data is not overwritten with an empty value
  • harden Hyperskill project opening and YAML loading by tolerating missing config directories, skipping unsupported topic tasks, and handling remote YAML loading failures per item instead of aborting the whole load
  • fix task directory resolution in the course view so projects still open correctly when Task.getDir() cannot resolve the task directory
  • block remote task submission when check_profile is empty and add logging around load/apply/save/submit flows to make these failures diagnosable

Details

  • added a dedicated YAML mixin for RemoteEduTask and explicitly serialize check_profile
  • excluded check_profile from generic additional-property serialization to avoid duplicate/conflicting YAML output
  • changed student task change application to update check_profile only for remote tasks and log mismatches
  • made config-dir lookups nullable and updated YAML sync/load code to fail soft when files or directories are missing
  • updated deep remote info loading to continue after RemoteYamlLoadingException
  • adjusted course view logic to resolve visible task files from the actual task directory instead of relying on a later getDir() lookup
  • added regression coverage for YAML serialization, YAML change handling, and course view task directory lookup
  • updated the Hyperskill courses link in the new project UI to use the tracked campaign URL

Testing

  • added/updated regression tests for:
    • remote task YAML serialization
    • YAML change-after-event handling
    • course view task directory lookup

@KirillovProj KirillovProj requested a review from Tsyklop April 29, 2026 14:14
@KirillovProj KirillovProj self-assigned this Apr 29, 2026
@KirillovProj KirillovProj added the bug Something isn't working label Apr 29, 2026
@Tsyklop Tsyklop changed the title [ALT-10963] Don't overwrite check_profile from server with an empty string. [ALT-10963] Change check_profile , opening project view. May 12, 2026
Copy link
Copy Markdown
Contributor

@meanmail meanmail left a comment

Choose a reason for hiding this comment

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

Review summary

The PR has grown well beyond its original one-line scope. The original empty-string-overwrite fix from commit 3766a0d was lost in subsequent commits, so the very bug this PR was created for is no longer prevented. There are also several leftover debug logs, unused imports, scope creep (UI URL change, project view refactor, soft-fail YAML loading, Retrofit body logging, two large docs files), and a few smaller correctness/style issues. Details inline.

Blocking

  1. StudentTaskChangeApplier still overwrites a non-empty checkProfile with an empty value when the deserialized item carries "". The newCheckProfile.isNotEmpty() guard from 3766a0d was dropped in e44e4073. Please restore it and add a regression test covering exactly this scenario.

Strongly recommended before merge

  1. Strip the [DEBUG_LOG]-prefixed and per-call info logs (model setter, every YAML save, every applyChanges, every Retrofit request body, every deserialization). At minimum downgrade them to debugLOG.info here will produce a lot of noise on real courses and the Retrofit body log can leak auth-bearing payloads.
  2. Drop unused imports in YamlLoader.kt (EduOAuthCodeFlowConnector, HTTP_BAD_REQUEST, HTTP_FORBIDDEN, HTTP_UNAUTHORIZED).
  3. Consider splitting the unrelated changes (course-view refactor, UTM-link change, soft-fail in YamlDeepLoader, Retrofit body logging, the two new docs files) into separate PRs — they are not part of ALT-10963 and make review harder.

Smaller things

  1. isHyperskillTopicsLesson() matches section.presentableName == "Topics" — fragile; reuse HyperskillCourse.getTopicsSection() and compare by reference.
  2. HyperskillSubmitConnector user-facing error string is hardcoded English instead of EduCoreBundle.
  3. HyperskillSubmissionFactory.createEduTaskSubmission now explicitly assigns reply.checkProfile = "". EduTask has no check profile concept — please confirm the server expects this field on plain edu submissions; otherwise drop the assignment.
  4. RemoteEduTaskYamlMixin.kt is missing a final newline; two blank lines before private val LOG in RemoteEduTask.kt.

@Tsyklop Tsyklop requested a review from meanmail May 13, 2026 06:43
Copy link
Copy Markdown
Contributor

@meanmail meanmail left a comment

Choose a reason for hiding this comment

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

Thanks for the quick turnaround! All blocking and important comments from my previous review are addressed in 0ecdc84 — the isNotEmpty() guard is back in StudentTaskChangeApplier, two targeted regression tests cover the empty/non-empty cases, all the info-level diagnostic logs are gone (Retrofit body, model setter, per-deserialization, per-save, per-applyChanges), unused imports in YamlLoader are dropped, isHyperskillTopicsLesson now uses HyperskillCourse.getTopicsSection() by reference, the hardcoded English error string is replaced with a new EduCoreBundle key, and the spurious reply.checkProfile = "" in createEduTaskSubmission is removed. Final newlines also fixed. LGTM. (Couldn't resolve the inline threads myself — missing permission — please mark them as resolved in the UI.)

@Tsyklop Tsyklop merged commit c85a7ab into main May 14, 2026
0 of 3 checks passed
@Tsyklop Tsyklop deleted the bug/ALT-10963_empty_check_profile branch May 14, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants