Skip to content
This repository has been archived by the owner. It is now read-only.

Create an artifact plugin #55

Merged
merged 13 commits into from Mar 31, 2016
Merged

Create an artifact plugin #55

merged 13 commits into from Mar 31, 2016

Conversation

@imbstack
Copy link
Contributor

@imbstack imbstack commented Mar 11, 2016

Does what it says on the tin.

@imbstack
Copy link
Contributor Author

@imbstack imbstack commented Mar 11, 2016

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

Loading

title: Local artifact location
description: Filesystem path of artifact
type: string
remotePath:
Copy link
Contributor

@jonasfj jonasfj Mar 11, 2016

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...

Loading

Copy link
Contributor

@jonasfj jonasfj Mar 11, 2016

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...

Loading

@gregarndt
Copy link
Collaborator

@gregarndt gregarndt commented Mar 11, 2016

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

Loading

@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
Copy link
Contributor

@jonasfj jonasfj commented Mar 13, 2016

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...

Loading

@imbstack
Copy link
Contributor Author

@imbstack imbstack commented Mar 18, 2016

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

Loading

@imbstack
Copy link
Contributor Author

@imbstack imbstack commented Mar 18, 2016

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

Loading

@coveralls
Copy link

@coveralls coveralls commented Mar 18, 2016

Coverage Status

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

Loading

@coveralls
Copy link

@coveralls coveralls commented Mar 22, 2016

Coverage Status

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

Loading

@imbstack
Copy link
Contributor Author

@imbstack imbstack commented Mar 25, 2016

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?

Loading


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

@jonasfj jonasfj Mar 25, 2016

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...

Loading

@imbstack
Copy link
Contributor Author

@imbstack imbstack commented Mar 29, 2016

@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

Loading

}

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

@jonasfj jonasfj Mar 29, 2016

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

Loading

@imbstack imbstack merged commit 37dd9ea into master Mar 31, 2016
2 checks passed
Loading
@imbstack imbstack deleted the artifacts branch Mar 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants