Skip to content
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

For classroom like GitHub #10785

Open
sycured opened this issue Mar 20, 2020 · 30 comments
Open

For classroom like GitHub #10785

sycured opened this issue Mar 20, 2020 · 30 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@sycured
Copy link

sycured commented Mar 20, 2020

Hi,
Do you plan to permit an usage like https://classroom.github.com/ ?

It'll be very good to have the possibility to create assignments and students to have their repositories created automatically when applying to the assignment.

For doing this like action (ci/cd, whatever), just having a webhook auto-assigned is perfect.

Regards

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Mar 21, 2020
@lunny
Copy link
Member

lunny commented Mar 21, 2020

Sounds interesting.

@lafriks
Copy link
Member

lafriks commented Mar 21, 2020

If you have used it, could you write up task list that need to be implemented in Gitea?

@sycured
Copy link
Author

sycured commented Mar 21, 2020

Hi, I took some screenshot when I created a classroom and look workflow for individual assignment: https://imgur.com/a/9ZdGkLB

Links to examples about autograding:

@lunny
Copy link
Member

lunny commented Mar 22, 2020

I haven't used that but I think it should have the features.

  • A classroom could be binding to an organization.
  • Owners could create some assignments.
  • Owners could add students as members.
  • Students could view assignments and create a repository link to an assigment.
  • Students could pull and push codes from the assignment repository.
  • Owners could add review on the assignment repositories.

We could create three tables, classroom, assignment and student_assignment.

type Classroom struct {
    ID int64
    Name string
    OrgID int64
    StudentTeamID int64
    CreatorID int64
}

type Assignment struct {
    ID int64
    ClassroomID int64
    Name string
}

type StudentAssignment struct {
    ID int64
    AssignmentID int64
    StudentUserID int64
    RepoID int64
    Status AssignmentStatus
}

@sycured
Copy link
Author

sycured commented Mar 22, 2020

I haven't used it, just created a classroom to take screenshots.

So yes, a classroom is owned by an organization.

About running test and autograding, I think that adding score to StudentAssignment and having an API endpoint for our CI/CD to update that score could be great.

Another big deal, it's implementing LTI (github-education-resources/classroom#2350 & http:https://www.imsglobal.org/activity/learning-tools-interoperability) this can be useful.

Another thing is Group Assignment: https://imgur.com/a/Z6MiMOq

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

How are tests added for scoring?

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

Also maybe this should be made as sepperate project and integrated in Gitea using API

@sycured
Copy link
Author

sycured commented Mar 22, 2020

On GitHub it's like using GitHub Actions to run tests...
But using CI/CD can be a lot better if we can interact like that:

student apply for assignment 1:

  1. create repo using our start repo (like a fork or better like a copy/fake fork)
  2. Add webhook to our CI/CD job
  3. When push on master -> send to CI/CD
    We run the job, take repository username/repositoryname, run test and when finished, curl -XPOST final score sur l'api de gitea
  4. If scoring is >= $requiredminimalscore, green, show score and repository locked to read-only
    If not, red show score and repository still open to push

Big problem, attach the score to each commit because it's the only way for students to look it and can read an automatic status about tests (comment inside commit)

We won't open CI/CD platform to students

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

Yes but how to score as tests only have failed/success how to know how many tests there were and how much of them actually failed and how much there is in total

@sycured
Copy link
Author

sycured commented Mar 22, 2020

In my case, it's one suitcase:
For examples:

  • Haskell: stack test
    Run 1500 tests across the project
    Process: git clone [email protected]:students/assignmentrepo . and stack test

  • Python: pytest
    Run 250 tests across the project
    Process: git clone [email protected]:students/assignmentrepo . and pytest

The output of each can be redirected to a file or just parsed and we had it to the commit as a comment.

For example if we hide all lines before 829, the end is clear: https://travis-ci.com/github/sycured/streaming_calc_haskell/jobs/298983826#L829

I've no failure in that example but it's very clear

@techknowlogick
Copy link
Member

As Gitea is not looking at building a CI itself, we do have a status API, and so this would be perfect for a separate application that reports status back to Gitea.

@sycured
Copy link
Author

sycured commented Mar 22, 2020

I take the example all time of using a CI/CD and push back to gitea, I use Zuul and DroneCI at this time so no problem if we can push back status, score and comment on the commit do the ping to CI/CD

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

Is tests and ci instructions saved in same student repo or it is pulled from somewhere else?

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

If they are how to prevent student from changing them?

@sycured
Copy link
Author

sycured commented Mar 22, 2020

Impossible for student to see it, it's on server side ;)
we load a container image (podman) that students can't access

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

Ok but ci instructions like .travisci.yml or .drone.yml would still be in students git repo?

@sycured
Copy link
Author

sycured commented Mar 22, 2020

Absolutely no because it's server side

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

I'm just thinking how than travis gets instructions than as they need to be in git repo? 🤔

Sorry for so many questions, just trying to understand whole process

@sycured
Copy link
Author

sycured commented Mar 22, 2020

I won't use Travis CI for this thing… We have a CI/CD like Jenkins/Bamboo where all instructions are saved server-side so no file in repository like CircleCI or Travis CI or DroneCI

It's the same thing about Classroom for GitHub where they ask for a repository including all the tests scripts and process:

Excepted that you're not implementing a CI/CD in gitea, it's better to use our solution

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

Ok, than we need to think out a way how to use drone ci for this

@sycured
Copy link
Author

sycured commented Mar 22, 2020

why not considering it like a webhook and students can't modify/change it ?

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

Webhook itself is not the problem, problem is that at least Drone CI supports repository instructions to be in repository as file.
btw does students need to submit their task as PR or just as commits?

@sycured
Copy link
Author

sycured commented Mar 22, 2020

They commit on their repositories, nothing more.

For Drone and similar, I think, we need like GitHub:

  • 1 repo that is the base repo for student repo
  • 1 repo used by CI/CD to pull tests/process

Workflow:

  1. Instance a docker
  2. git pull [email protected]:organization(or classroom)/repotest-for-assignment1 .
  3. rm -rf .git
  4. git pull [email protected]:stduentid/assignment1 .
  5. Launch test

@techknowlogick
Copy link
Member

If you don't want them to edit webhooks you could use global webhooks and connect that to whichever CI system you use, that allows them to have full admin over their repo w/o being able to edit webhooks.

@lafriks
Copy link
Member

lafriks commented Mar 22, 2020

I don't think students need to have admin rights over repo. They should have only write rights, so that they can not mess with automation and integration processes. Anyway for drone ci integration to work only way is to have .drone.yml file in repository IMHO. We could probably implement branch protection to have wilcard filter field to not allow editing files that match that filter.

@sycured
Copy link
Author

sycured commented Mar 23, 2020

I don't think students need to have admin rights over repo.

The only way is the possibility for the classroom/organization to create repository for their students inside classroom's/organization's repositories and not anymore inside student's repositories.

What's the best way?
Because the most safe is a repository owned by classroom/organization and adding student as contributor.

IRL: student's code sent for assignment still is owned by student so it's better to have the reposity in student's repositories

Big question for student side: how can we remove full owner rights on the repository inside their account?

@lafriks
Copy link
Member

lafriks commented Mar 23, 2020

We could probably work something out for this like adding field for custom admin user for user repository

@lafriks
Copy link
Member

lafriks commented Mar 23, 2020

Ok, I have implemented protected file patter option in branch protection in PR #10806

@sycured
Copy link
Author

sycured commented Jun 18, 2020

Any ETA?

@lafriks
Copy link
Member

lafriks commented Jun 18, 2020

I have started prototype but no eta at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

4 participants