Skip to content

Commit

Permalink
New file storage (#97)
Browse files Browse the repository at this point in the history
* [ML4SE-343] New directory

* [ML4SE-343] Changed plugin description. Added possibility to send files from the plugin directory.

* [ML4SE-343] Changed assistant directory.
  • Loading branch information
mikrise2 authored Feb 15, 2024
1 parent 57e7e15 commit 68cb1e5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import kotlinx.serialization.Serializable
* @param type The log type. By default, it is set to "default".
*/
@Serializable
data class Log(val logPaths: List<String>, val type: String = "default")
data class Log(val logPaths: List<String>, val isInPluginDirectory: Boolean = false, val type: String = "default")
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
package org.jetbrains.research.tasktracker.tracking

import com.intellij.openapi.application.PathManager
import org.jetbrains.research.tasktracker.config.content.Log
import java.io.File
import java.nio.file.Path
import kotlin.io.path.Path

class ExternalLogger(private val root: Path, private val log: Log) : Loggable() {
class ExternalLogger(private val projectRoot: Path, private val log: Log) : Loggable() {
override val logFileType: String = log.type

override fun getLogFiles(): List<File> = log.logPaths.map {
val root: Path = if (log.isInPluginDirectory) {
Path(PathManager.getPluginsPath())
} else {
projectRoot
}
root.resolve(it).toFile()
}.filter { it.exists() }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pluginName: Refactoring course
pluginDescription: "We want to track your progress through the code refactoring course in order to collect data on file changes during the course completion. Please, when you are ready, press the next button."
researchId: "RefactoringCourse"
pluginName: "Kotlin Introduction"
pluginDescription: "We want to track your progress through the kotlin introduction course in order to collect data on file changes during the course completion. Please, when you are ready, press the next button."
researchId: "Kotlin Introduction"
logs:
- logPaths:
- "eduAssistant.log"
type: "ai"
- "edu-assistant/eduAssistant.log"
type: "assistant"
isInPluginDirectory: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tasks:
- description: description
- description: "Take the kotlin introduction course, and after that, press the next button."
files:
- extension: KOTLIN
filename: Main
Expand Down Expand Up @@ -57,4 +57,4 @@ tasks:
relativePath: WarmUp/task/src/main/kotlin/jetbrains/kotlin/course/warmup
sourceSet: SRC
id: main
name: example
name: "Kotlin Introduction"
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.nio.file.Path
import java.nio.file.Paths
import kotlin.io.path.createDirectories

private const val FILE_DIRECTORY = "/tmp/files/"
private const val FILE_DIRECTORY = "/data/tt-files/"

suspend inline fun PipelineContext<Unit, ApplicationCall>.createLogFile(
logFileType: String,
Expand Down

0 comments on commit 68cb1e5

Please sign in to comment.