shawnzhu / artifacts-v2

MIT License
0 stars 0 forks source link

How to expose artifacts feature on Travis web/api #17

Open shawnzhu opened 7 years ago

shawnzhu commented 7 years ago

I've made travis-build to provide an addon to enable travis-worker uploading artifacts into artifacts server via a JWT token. There're two options in my mind to expose artifacts meta info to travis-web:

  1. add new api endpoint in travis-api like /api/jobs/<job-id>/artifacts so Travis web can pick up artifacts meta info via existing authentication of travis-api. Then the architecture design is, travis-api will serve as gateway of artifacts server for all API traffic.
  2. add the authentication method used by travis-api today to this artifacts server so that travis-web can redirect user to artifacts server directly. Then the artifacture design is, artifacts-server needs to access Redis and/or Postgres database of Travis CI.

@josh @meatballhat @rkh comments?

shawnzhu commented 7 years ago

I've managed to made option 2 via https://github.com/shawnzhu/travis-web/commit/3765ce41eaa537eb8c9fae2a19bdb4e5749dfc33

So far, the problem is user has to acquire a new JWT from travis-web after JWT expires.

shawnzhu commented 7 years ago

This is an important question needs an answer because the design that a Travis CI user interacts with artifacts data determines the architecture:

These are generated from internal feedback from Travis CI enterprise users.

joshk commented 7 years ago

Hey @shawnzhu

I'm sorry for my delayed feedback. Maybe we can setup a call to go over any remaining questions?

shawnzhu commented 7 years ago

Summary

@joshk suggests travis-web sends API calls to Artifacts server directly.

There are also good inputs on improvements:

joshk commented 7 years ago

Thanks for writing this up @shawnzhu

I believe the URL would need to be /job/:id as that is the only thing kept in the DB