Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.

Create an artifact plugin#55

Merged
imbstack merged 13 commits into
masterfrom
artifacts
Mar 31, 2016
Merged

Create an artifact plugin#55
imbstack merged 13 commits into
masterfrom
artifacts

Conversation

@imbstack

Copy link
Copy Markdown
Contributor

Does what it says on the tin.

@imbstack

Copy link
Copy Markdown
Contributor Author

@jonasfj, @gregarndt: How does this payload schema look to you? Let's change it to be what we want.

Comment thread plugins/artifacts/config-schema.yml Outdated
title: Local artifact location
description: Filesystem path of artifact
type: string
remotePath:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I propose path and name...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remotePath/name should not start with /...

If type is folder it should end with /, and if type is file it should not ever end with /...

Also it should never contain any double slashes...

@gregarndt

Copy link
Copy Markdown
Collaborator

Looks good, we just need to get a consensus on the naming of the source and destination stuff.

@selenamarie selenamarie changed the title [WIP] Create and artifact plugin (Don't merge yet) [WIP] Create an artifact plugin (Don't merge yet) Mar 11, 2016
@jonasfj

jonasfj commented Mar 13, 2016

Copy link
Copy Markdown
Contributor

I propose path and name... I see the benefit of going with artifactName, the only downside is that everywhere else in artifact end-point documentation it is referred to as <name>..

Honestly, I can't care much... As long as we don't call it remotePath because it is not a path.
Whatever we do, the JSON schema should document it with title: "Artifact Name".


Regarding source I would prefer sourcePath as it's always going to be a path. Just path works fine too... But I care less about that since it doesn't related to queue docs...

@imbstack

Copy link
Copy Markdown
Contributor Author

I submit a further WIP diff to check and see if this is a good direction to be going in. I feel fairly happy with how this is shaping up. If this is a generally acceptable way of going about this, most of the changes from here on out will be filling out error handling in the plugin itself, and using the client lib stuff (#60) that you all are working on now in the runtime bits.

Currently the tests for this look like

$ go test -v ./plugins/artifacts/
=== RUN   TestArtifactsEmpty
--- PASS: TestArtifactsEmpty (0.00s)
=== RUN   TestArtifactsFile
/public/blah.txt
Hello World
--- PASS: TestArtifactsFile (0.00s)
=== RUN   TestArtifactsDirectory
/public
Hello World
/public
Hello World
/public
Hello World
--- PASS: TestArtifactsDirectory (0.00s)
PASS
ok      github.com/taskcluster/taskcluster-worker/plugins/artifacts     0.017s

@imbstack

Copy link
Copy Markdown
Contributor Author

A note for @gregarndt: We decided to move ReadSeekCloser to runtime to avoid dependency loops between runtime and engine.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.1%) to 70.511% when pulling 069cf17 on artifacts into 197638a on master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.1%) to 75.214% when pulling c7f400b on artifacts into ea81ad1 on master.

@imbstack

Copy link
Copy Markdown
Contributor Author

I'd love if I could get a 30% review on this at some point today, just so that we all feel like this is moving in the right direction. As a caveat, nothing is done and the points don't matter. If this might be better done as a guided excercise at this point, I'd be happy to hop on vidyo and talk it through with someone.

@jonasfj, @gregarndt: any takers?


func (plugin) NewTaskPlugin(options plugins.TaskPluginOptions) (plugins.TaskPlugin, error) {
return &taskPlugin{
TaskPluginBase: plugins.TaskPluginBase{},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need for this line... the zero-value is assigned by default...

@imbstack

Copy link
Copy Markdown
Contributor Author

@gregarndt, @jonasfj: Alright, I think this is pretty much ready (barring inevitable review comments). In particular, I'm pretty sure the error handling I have in here is still overly simplistic, but it's at least moving in the right direction I think.

Example of created artifacts: https://tools.taskcluster.net/task-inspector/#WzLXbfiVTf2MHmaCEJFRmg/0
Example of error artifact: https://tools.taskcluster.net/task-inspector/#ObSgu516SnOhJdOuu3EMsQ/0

Comment thread runtime/ioext/ioext.go Outdated
}

// ReadSeekNopCloser is an implementation of ReadSeekCloser that wraps io.ReadSeekers
type ReadSeekNopCloser struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't need to export this type...

You create it with NopCloser whose return type should ReadSeekCloser

@imbstack imbstack merged commit 37dd9ea into master Mar 31, 2016
@imbstack imbstack deleted the artifacts branch March 31, 2016 16:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants