Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ written while it was being built. See [RELEASING.md](RELEASING.md).

### Added

- Backend: A submission can now hold a description and a link to a folder of
attachments, next to the link to its repository.

### Changed

### Fixed
Expand Down
8 changes: 6 additions & 2 deletions api/proto/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ casbin role for this hackathon; `is_waiting` is false once approved.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
| result | [string](#string) | optional | |
| result | [string](#string) | optional | URL of the repository holding the submission's output. TODO: rename to `repository_url` after the hackathon. |
| status | [SubmissionStatus](#hackathon-entities-SubmissionStatus) | | |
| version | [int32](#int32) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
Expand All @@ -1418,6 +1418,8 @@ casbin role for this hackathon; `is_waiting` is false once approved.
| project_id | [string](#string) | | |
| creator_id | [string](#string) | | |
| modifier_id | [string](#string) | optional | |
| attachment_folder_url | [string](#string) | optional | |
| description | [string](#string) | optional | |



Expand Down Expand Up @@ -4673,7 +4675,9 @@ casbin role for this hackathon; `is_waiting` is false once approved.
| ----- | ---- | ----- | ----------- |
| team_id | [string](#string) | | |
| project_id | [string](#string) | | |
| result | [string](#string) | optional | |
| result | [string](#string) | optional | URL of the repository holding the submission's output. TODO: rename to `repository_url` after the hackathon. |
| attachment_folder_url | [string](#string) | optional | |
| description | [string](#string) | optional | |



Expand Down
4 changes: 4 additions & 0 deletions api/proto/hackathon/entities/submission.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ option go_package = "github.com/swissdatasciencecenter/hackagon/components/backe

message Submission {
string id = 1;
// URL of the repository holding the submission's output.
// TODO: rename to `repository_url` after the hackathon.
optional string result = 2;
SubmissionStatus status = 3;
int32 version = 4;
Expand All @@ -18,4 +20,6 @@ message Submission {
string project_id = 8;
string creator_id = 9;
optional string modifier_id = 10;
optional string attachment_folder_url = 11;
optional string description = 12;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ option go_package = "github.com/swissdatasciencecenter/hackagon/components/backe
message CreateSubmissionRequest {
string team_id = 1;
string project_id = 2;
// URL of the repository holding the submission's output.
// TODO: rename to `repository_url` after the hackathon.
optional string result = 3;
optional string attachment_folder_url = 4;
optional string description = 5;
}
4 changes: 3 additions & 1 deletion components/backend/Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ A versioned submission from a team for a project.
|--------|------|----------|--------|-----------|---------|-------------|
| `created_at` | time.Time | yes | no | yes | yes | Timestamp when the submission was created. |
| `modified_at` | time.Time | yes | no | no | yes | Timestamp of the last modification. |
| `result` | string | no | no | no | no | Result or output of the submission (e.g. a URL). |
| `result` | string | no | no | no | no | URL of the repository that contains the output of the submission. |
| `attachment_folder_url` | string | no | no | no | no | URL of the folder that contains the attachments. |
| `description` | string | no | no | no | no | Description of the submission. |
| `status` | enum(draft, final) | yes | no | no | no | Whether the submission is a draft or final. |
| `version` | int | yes | no | no | no | Monotonically increasing version number, unique per project+team. |

Expand Down
24 changes: 14 additions & 10 deletions components/backend/cmd/seed/h1.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,22 @@ func (h *harness) seedH1(now time.Time, admin, alice, bob, charles, dana *actor)
// one finalized.
if _, err := h.createSubmissions(teams, projects, []submissionSpec{
{
by: alice,
team: "Team Alpha",
project: "AutoML Pipeline Builder",
result: "",
final: false,
by: alice,
team: "Team Alpha",
project: "AutoML Pipeline Builder",
result: "",
description: "First pass at the search space; no evaluation yet.",
attachmentFolderURL: "",
final: false,
},
{
by: alice,
team: "Team Alpha",
project: "AutoML Pipeline Builder",
result: "https://github.com/team-alpha/automl-pipeline",
final: true,
by: alice,
team: "Team Alpha",
project: "AutoML Pipeline Builder",
result: "https://github.com/team-alpha/automl-pipeline",
description: "End-to-end AutoML pipeline with model search and a benchmark report.",
attachmentFolderURL: "https://drive.example.com/team-alpha/automl-pipeline",
final: true,
},
}); err != nil {
return err
Expand Down
12 changes: 7 additions & 5 deletions components/backend/cmd/seed/h2.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,13 @@ func (h *harness) seedH2(now time.Time, admin, alice, bob, yuki *actor) error {
// authored by somebody who is not an organizer.
if _, err := h.createSubmissions(teams, projects, []submissionSpec{
{
by: bob,
team: "Team Gamma",
project: "Solar Panel Optimizer",
result: "https://github.com/team-gamma/solar-optimizer",
final: true,
by: bob,
team: "Team Gamma",
project: "Solar Panel Optimizer",
result: "https://github.com/team-gamma/solar-optimizer",
description: "Optimizes panel tilt from local irradiance data.",
attachmentFolderURL: "https://drive.example.com/team-gamma/solar-optimizer",
final: true,
},
}); err != nil {
return err
Expand Down
36 changes: 21 additions & 15 deletions components/backend/cmd/seed/h3.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,31 @@ func (h *harness) seedH3(now time.Time, admin, alice, dana *actor) error {
// for a team they are not on.
latest, err := h.createSubmissions(teams, projects, []submissionSpec{
{
by: alice,
team: "Team Delta",
project: "CLI Code Generator",
result: "",
final: false,
by: alice,
team: "Team Delta",
project: "CLI Code Generator",
result: "",
description: "",
attachmentFolderURL: "",
final: false,
},
{
by: alice,
team: "Team Delta",
project: "CLI Code Generator",
result: "https://github.com/internal/cli-code-gen",
final: true,
by: alice,
team: "Team Delta",
project: "CLI Code Generator",
result: "https://github.com/internal/cli-code-gen",
description: "Generates CLI scaffolding from an OpenAPI spec.",
attachmentFolderURL: "https://drive.example.com/internal/cli-code-gen",
final: true,
},
{
by: dana,
team: "Team Epsilon",
project: "Data Pipeline Visualizer",
result: "https://github.com/internal/data-pipeline-viz",
final: true,
by: dana,
team: "Team Epsilon",
project: "Data Pipeline Visualizer",
result: "https://github.com/internal/data-pipeline-viz",
description: "Renders pipeline DAGs with live run status.",
attachmentFolderURL: "",
final: true,
},
})
if err != nil {
Expand Down
28 changes: 16 additions & 12 deletions components/backend/cmd/seed/h6.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,27 +304,31 @@ func (h *harness) seedH6(now time.Time, alice, bob, charles *actor) error {
}

// Each team's submissions, made by a synthetic member — bob's team included,
// so his own ballot is untouched. Drafts carry no link, as an early draft
// often does not.
// so his own ballot is untouched. Drafts carry no link or description, as an
// early draft often does not.
var subSpecs []submissionSpec
for t, s := range specs {
author := synthetic[t*teamSize]
for range s.drafts {
subSpecs = append(subSpecs, submissionSpec{
by: author,
team: s.team,
project: s.title,
result: "",
final: false,
by: author,
team: s.team,
project: s.title,
result: "",
description: "",
attachmentFolderURL: "",
final: false,
})
}
if s.final {
subSpecs = append(subSpecs, submissionSpec{
by: author,
team: s.team,
project: s.title,
result: "https://github.com/open-science-hack/" + s.repo,
final: true,
by: author,
team: s.team,
project: s.title,
result: "https://github.com/open-science-hack/" + s.repo,
description: "Final submission of " + s.title,
attachmentFolderURL: "https://drive.example.com/open-science-hack/" + s.repo,
final: true,
})
}
}
Expand Down
29 changes: 20 additions & 9 deletions components/backend/cmd/seed/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,16 @@ func (h *harness) createTeams(
// Versions are not stated because they are not the seed's to choose: the
// handler counts what the team has already submitted for the project, so the
// order of the specs is the version order. `final` finalizes it afterwards;
// without it the submission stays a draft.
// without it the submission stays a draft. An empty `result`, `description`
// or `attachmentFolderURL` is left unset on the submission.
type submissionSpec struct {
by *actor
team string
project string
result string
final bool
by *actor
team string
project string
result string
description string
attachmentFolderURL string
final bool
}

// createSubmissions writes submissions in order and returns each team's last
Expand All @@ -650,13 +653,21 @@ func (h *harness) createSubmissions(
}

req := &teamMsgs.CreateSubmissionRequest{
TeamId: teamID,
ProjectId: projectID,
Result: nil,
TeamId: teamID,
ProjectId: projectID,
Result: nil,
AttachmentFolderUrl: nil,
Description: nil,
}
if spec.result != "" {
req.Result = &spec.result
}
if spec.description != "" {
req.Description = &spec.description
}
if spec.attachmentFolderURL != "" {
req.AttachmentFolderUrl = &spec.attachmentFolderURL
}

resp, err := h.team.CreateSubmission(spec.by.ctx, req)
if err != nil {
Expand Down
9 changes: 8 additions & 1 deletion components/backend/db/schema/submission.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ func (Submission) Fields() []ent.Field {
field.Time("modified_at").
Default(time.Now).UpdateDefault(time.Now).
Comment("Timestamp of the last modification."),
// TODO: rename to `repository_url` after the hackathon.
field.String("result").
Optional().
Comment("Result or output of the submission (e.g. a URL)."),
Comment("URL of the repository that contains the output of the submission."),
field.String("attachment_folder_url").
Optional().
Comment("URL of the folder that contains the attachments."),
field.String("description").
Optional().
Comment("Description of the submission."),
field.Enum("status").
Values("draft", "final").
Comment("Whether the submission is a draft or final."),
Expand Down
12 changes: 7 additions & 5 deletions components/backend/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading