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

Visibility into Jenkins-readiness of instructor assignment repos #35

Open
ncbrown1 opened this issue May 17, 2017 · 5 comments
Open

Visibility into Jenkins-readiness of instructor assignment repos #35

ncbrown1 opened this issue May 17, 2017 · 5 comments
Assignees

Comments

@ncbrown1
Copy link
Contributor

In the assignments index page for instructors, we would like to be able to know the "build status" of each assignment. This allows instructors to know whether they have properly set up their assignment repos for auto-grading.

We would like to be able to see an icon to the right of each assignment list item in the index page of the assignments view:

https://github.com/project-anacapa/course-github-org-tool/blob/feature/assignment-view/app/views/assignments/_index_instructor.html.erb#L5

The icons for each status are as follows:

PENDING == yellow hourglass
SUCCESS == green checkmark
FAILURE == red X
ERROR == red ?

@ncbrown1
Copy link
Contributor Author

You may want to add methods to the Git Strategy for accessing & updating the commit/build status for a given repository. You can add those to the files in this folder:

https://github.com/project-anacapa/course-github-org-tool/tree/feature/assignment-view/lib/strategies

@ncbrown1
Copy link
Contributor Author

@ncbrown1
Copy link
Contributor Author

ncbrown1 commented May 17, 2017

Operations needed given a Repo object:

Set Commit Status
Get Commit Status

For example, to set the status in the rails console, we might type the following:

machine_octokit.set_commit_status('ucsb-cs-test-org-1/assignment-lab00', {
   :state => :pending,
   :target_url => 'https://localhost:8000/',
   :description => 'Test'
})

status = machine_octokit.get_commit_status('ucsb-cs-test-org-1/assignment-lab00')

Note: the Octokit method you might need is this: https://octokit.github.io/octokit.rb/Octokit/Client/Statuses.html#create_status-instance_method

@pconrad
Copy link
Contributor

pconrad commented May 23, 2017

You probably want to add this method to the base class git_strategy.rb:

create_status(repo, sha, state)

You'll pass through an empty hash to the underlying octokit method documented o this page

http://octokit.github.io/octokit.rb/Octokit/Client/Statuses.html#create_status-instance_method

create_status(repo, sha, state, options = {})

For gitlab, we can just leave it alone for now, since we aren't using it yet. The "not implemented yet" error will get thrown and that's ok for now.

That method comes directly from

@pconrad
Copy link
Contributor

pconrad commented May 23, 2017

We also need a get_most_recent_status(repo, sha) which wraps the

(Array<Sawyer::Resource>) statuses(repo, sha, options = {})

method but only returns the most recent status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants