Closed Bug 1521638 Opened 6 years ago Closed 6 years ago

Add tc-web front end to the monorepo

Categories

(Taskcluster :: Services, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: owlish, Assigned: owlish)

References

Details

Attachments

(1 file)

No description provided.

Is this planned/not planned at all? Should I add tc-web to monorepo first and then add it to tc-builder or the other way around?

Flags: needinfo?(helfi92)

I don't think we should add it. taskcluster-web is not a node project, has react-specific linting and is not really a service/library. It is simply an application that uses the web-server service.

Flags: needinfo?(helfi92)

Awesome - thank you, Hassan!

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX

Let's talk about this.. I'd like to see it in the monorepo, since it's shipped as part of the Taskcluster services, and tightly coupled to the services themselves. It will also need to have documentation built into it, and all that documentation is in the monorepo..

If we could include it in the repo, but in such a way that it is not part of the yarn workspace, would that help?

Flags: needinfo?(helfi92)

Yes, that would definitely help. We can create a new directory and not include it in https://github.com/taskcluster/taskcluster/blob/73e7191cd95704f5e61c3e744d38e57570bccbc7/package.json#L10-L14. Irene, feel free to go for it. Hopefully it will makes things easier re: containerization :)

Flags: needinfo?(helfi92)

I'm assuming we can still hook up similar PR automation so that things are deployed to netlify for evaluation. If that's impossible, that's a strong reason to keep the repos separate (in which case maybe we can think about submodules or something..)

Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---

So, do I understand correctly that my tasks here would be to create a dir in the monorepo's root for the FE, copy the code over (probably still using Lerna? We want the commit history, don't we?) to there and try deploying from there to Netlify? Or, even wiser would be researching if we can automatically deploy it to Netlify when it's in the monorepo? <---- maybe you already know the answer to that, Hassan?

Flags: needinfo?(helfi92)
Attached image build-settings.png

So, do I understand correctly that my tasks here would be to create a dir in the monorepo's root for the FE, copy the code over (probably still using Lerna? We want the commit history, don't we?)

Yes, a new directory should be created in the monorepo's root. I think using Lerna along with brian's scripts is fine to transfer the code.

Or, even wiser would be researching if we can automatically deploy it to Netlify when it's in the monorepo? <---- maybe you already know the answer to that, Hassan?

To deploy from a monorepo via netlify, I believe you can do the following:

  1. Move netlify.toml[1] to the root directory of the monorepo
  2. Amend netlify.toml with the build command and publish directory. This will make sure we don't do it anymore from the UI(see screenshot). In the top of the file, you can do:
# “base” is the directory to change to before starting build.
# “command” is your build command.
# “publish” is the directory to publish (relative to the root of your repo).
[build]
  base    = "site"
  command = "build"
  publish = "site/build"

Once the PR is merged, I will go ahead and change the netlify app to link to the monorepo.

[1] https://github.com/taskcluster/taskcluster-web/blob/master/netlify.toml

Flags: needinfo?(helfi92)

Awesome, thank you Hassan! I'll start working on this then

Status: REOPENED → ASSIGNED

I think lerna does funny stuff with the package.json's, which we don't want here. When I imported tc-terraform, I did the following in the monorepo:

  • git fetch https://github.com/taskcluster/taskcluster-terraform to pull the commit history from tc-terraform
  • git checkout -b taskcluster-terraform FETCH_HEAD to check out a branch with just tc-terraform on it
  • mkdir infrastructure/terraform && git mv * infrastructure/terraform (or something like that) to move all of the files to the proper subdirectory, then committed
  • deleted stuff like CONTRIBUTING.md from infrastructure/terraform and committed
  • git checkout -b bug1516353 master to go back to the monorepo files
  • git merge --allow-unrelated-histories taskcluster-terraform to "merge" the tc-terraform branch, with this result.

Tomorrow Hassan will get tc-web from monorepo to work on Netlify, and then this bug can be closed

Done :)

Status: ASSIGNED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Component: Redeployability → Services
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: