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

Set up lighthouse artifact feed for our fork #13

Merged

Conversation

DeeDeeG
Copy link
Member

@DeeDeeG DeeDeeG commented Jul 7, 2020

Requirements for Contributing a Bug Fix

Identify the Bug

#1 (comment)

#11 (comment)

Description of the Change

Rather than hard-coding upstream Atom's feed ID, set it with an environment variable. We can configure this in Azure DevOps so that our environment variable points to our fork's (technically our Azure DevOps oganization's) artifact feed.

Having this artifact feed set up properly can save about 10 minutes per OS.

Alternate Designs

  • Just hard-code our ID in place of upstream's.

  • We could also make separate .yml config files for our CI entirely I guess, and stop using the original ones. This avoids the possibility of merge conflicts. But I think that's not worth the hassle and the mess of files it would make. Upstream ahrdly ever updates their CI config, and I think we would likely want to track their changes if they do.

Possible Drawbacks

Some people don't like to save time. (Just kidding).

I guess with caching you have to make sure it updated when you want it to. So keep an eye out that it doesn't restore a cache when it shouldn't (i.e. when something in the repo changed and node_modules needs to be rebuilt).

Verification Process

Successful node_modules restoration on my personal fork: https://dev.azure.com/DeeDeeG/b/_build/results?buildId=67&view=logs&j=4fbced83-508e-5fe0-c978-5c71ec0fc506&t=96ecc7f1-cdb5-518e-2cb8-d9226cce9313

Release Notes

N/A

aminya and others added 8 commits July 3, 2020 17:58
Visit "https://feeds.dev.azure.com/${YOUR_ORGANIZATION_HERE}/_apis/packaging/feeds"
to find the "fullyQualifiedId" of your organization's
default artifact feed. That value is what you should set
the "ARTIFACT_FEED" environment variable to in Azure DevOps UI.

(IDs are formatted like this: "af6c77da-ef34-bcde-daaf-e2b489a23b2c")

The "description" for the feed should say "Default feed for ${organization}",
e.g. "Default feed for atomcommunity". If the description says something else,
or "null", then it's the wrong feed.
@DeeDeeG
Copy link
Member Author

DeeDeeG commented Jul 7, 2020

Reminder to find our Azure DevOps organization's default feed id from here:

https://feeds.dev.azure.com/atomcommunity/_apis/packaging/feeds

(Next to fullyQualifiedID:)

And either set it as the value for an environment variable ARTIFACT_FEED for each feed... Or hard-code this in place of upstream's feed ID.

description: should have the value "Default feed for atomcommunity" or else it is the wrong feed. (There are organization scoped feeds, and project scoped feeds. Lighthouse caching only works with organization scoped feeds. The "default feed for atomcommunity" is our organization scoped feed.)

@DeeDeeG
Copy link
Member Author

DeeDeeG commented Jul 7, 2020

Also, as mentioned in #10 and #11, we are looking at the official Cache task, which is officially supported by Azure DevOps, as opposed to the Lighthouse Universal Packages/artifact feeds solution, which is an unofficial "DevLabs" project.

microsoft/azure-pipelines-artifact-caching-tasks#40 (comment)
microsoft/azure-pipelines-artifact-caching-tasks#33 (comment)

This is a good thing to get working first, though.

@aminya
Copy link
Member

aminya commented Jul 7, 2020

Rather than hard-coding upstream Atom's feed ID, set it with an environment variable. We can configure this in Azure DevOps so that our environment variable points to our fork's (technically our Azure DevOps oganization's) artifact feed.

Where can I find this feed ID?

@DeeDeeG
Copy link
Member Author

DeeDeeG commented Jul 7, 2020

Where can I find this feed ID?

Visit this URL in a browser where you are logged into Azure DevOps: https://feeds.dev.azure.com/atomcommunity/_apis/packaging/feeds

This page serves a json structured data file. In it there should be a key:value pair fullyQualifiedId:${the_id_you_are_looking_for}

If you have more than one fullyQualifiedId in the json file, it means you added a project scoped artifact feed at some point. In that case, look for the feed with this key:value pair: description:Default feed for atomcommunity

(Their server will apparently check your cookies/web session with Azure DevOps to make sure you are an authorized administrator for the "atomcommunity" Azure DevOps organization. When I try to visit this page, it shows the following error: "TF400813: The user 'Windows Live ID\\${my_email_here}' is not authorized to access this resource.")

(Maybe this is too much of an explanation, but I hope to make it very clear for anyone else who might be reading this and hoping to understand how to set up Azure DevOps.)

@DeeDeeG
Copy link
Member Author

DeeDeeG commented Jul 7, 2020

By the way: I am working on a total replacement for the Lighthouse caching thing. Seems promising so far, but I can't say for 100% sure that it will work:

https://dev.azure.com/DeeDeeG/b/_build/results?buildId=70&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=d33d5f04-2c42-5a66-3d48-399912433e22

Similar idea to #11

@aminya aminya closed this Jul 7, 2020
@aminya aminya reopened this Jul 7, 2020
@aminya
Copy link
Member

aminya commented Jul 7, 2020

I added the ID. Let's see how this runs.

@aminya aminya force-pushed the master branch 2 times, most recently from 7a81062 to 9755960 Compare July 7, 2020 08:17
@aminya aminya merged commit 82a8377 into atom-community:master Jul 7, 2020
@aminya
Copy link
Member

aminya commented Jul 7, 2020

I merged this to test it on master.

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

Successfully merging this pull request may close these issues.

Setting up Azure pipelines
3 participants