remove LFS from codebase (#33777)
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
|
||||
// Install features. Type 'feature' in the VS Code command palette for a full list.
|
||||
"features": {
|
||||
"git-lfs": "latest",
|
||||
"sshd": "latest"
|
||||
},
|
||||
|
||||
@@ -42,7 +41,7 @@
|
||||
},
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "git lfs pull && npm ci",
|
||||
"postCreateCommand": "npm ci",
|
||||
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "node"
|
||||
|
||||
@@ -101,7 +101,7 @@ This file should be automatically updated, but you can also run `script/update-e
|
||||
|
||||
### 🚢 🛳️ 🚢 Shipping the release branch
|
||||
|
||||
- [ ] The megabranch creator should push the search index LFS objects for the public `github/docs` repo. The LFS objects were already pushed for the internal repo after the `sync-english-index-for-<PLAN@RELEASE>` was added to the megabranch. To push the LFS objects to the public repo:
|
||||
- [ ] Sync the search indices for the new release:
|
||||
1. First navigate to the [sync search indices workflow](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml).
|
||||
2. Then, to run the workflow with parameters, click on `Run workflow` button.
|
||||
3. A modal will pop up where you will set the following inputs:
|
||||
|
||||
@@ -91,7 +91,6 @@ jobs:
|
||||
with:
|
||||
ref: 'main'
|
||||
persist-credentials: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- if: ${{ env.IS_INTERNAL_BUILD == 'true' }}
|
||||
name: Check out PR code
|
||||
@@ -100,10 +99,6 @@ jobs:
|
||||
ref: ${{ env.COMMIT_REF }}
|
||||
# To prevent issues with cloning early access content later
|
||||
persist-credentials: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- name: Check out LFS objects
|
||||
run: git lfs checkout
|
||||
|
||||
- name: Get preview app info
|
||||
env:
|
||||
|
||||
@@ -65,10 +65,6 @@ jobs:
|
||||
ref: ${{ env.COMMIT_REF }}
|
||||
# To prevent issues with cloning early access content later
|
||||
persist-credentials: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- name: Check out LFS objects
|
||||
run: git lfs checkout
|
||||
|
||||
- name: 'Set env vars'
|
||||
run: |
|
||||
|
||||
5
.github/workflows/browser-test.yml
vendored
5
.github/workflows/browser-test.yml
vendored
@@ -50,11 +50,6 @@ jobs:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Checkout LFS objects
|
||||
run: git lfs checkout
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
|
||||
@@ -49,10 +49,6 @@ jobs:
|
||||
with:
|
||||
# To prevent issues with cloning early access content later
|
||||
persist-credentials: 'false'
|
||||
lfs: 'true'
|
||||
|
||||
- name: Check out LFS objects
|
||||
run: git lfs checkout
|
||||
|
||||
- if: ${{ env.ENABLE_EARLY_ACCESS }}
|
||||
name: Clone docs-early-access
|
||||
|
||||
5
.github/workflows/repo-sync.yml
vendored
5
.github/workflows/repo-sync.yml
vendored
@@ -100,7 +100,10 @@ jobs:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||
|
||||
# Set up npm and run npm ci to run husky to get githooks for LFS
|
||||
# Set up npm and run npm ci to get custom husky githooks error
|
||||
# messages if they exist. We could also remove these two steps
|
||||
# because currently we have no hooks with customer error messages.
|
||||
# See pull #32064 where they were removed.
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
with:
|
||||
|
||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -66,15 +66,6 @@ jobs:
|
||||
# Even if if doesn't do anything
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||
with:
|
||||
# Not all test suites need the LFS files. So instead, we opt to
|
||||
# NOT clone them initially and instead, include them manually
|
||||
# only for the test groups that we know need the files.
|
||||
lfs: ${{ matrix.test-group == 'content' }}
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
# persist-credentials: 'false'
|
||||
# ->> Do we really need this? actions/checkout doesn't use it for the nested example:
|
||||
# https://github.com/actions/checkout#checkout-multiple-repos-nested
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
@@ -172,11 +163,6 @@ jobs:
|
||||
token: ${{ secrets.DOCUBOT_REPO_PAT }}
|
||||
path: translations/ko-kr
|
||||
|
||||
# This is necessary when LFS files where cloned but does nothing
|
||||
# if actions/checkout was run with `lfs:false`.
|
||||
- name: Checkout LFS objects
|
||||
run: git lfs checkout
|
||||
|
||||
- name: Gather files changed
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -48,9 +48,7 @@ For more information about using a codespace for working on GitHub documentation
|
||||
|
||||
#### Make changes locally
|
||||
|
||||
1. [Install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage).
|
||||
|
||||
2. Fork the repository.
|
||||
1. Fork the repository.
|
||||
- Using GitHub Desktop:
|
||||
- [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop.
|
||||
- Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)!
|
||||
@@ -58,9 +56,9 @@ For more information about using a codespace for working on GitHub documentation
|
||||
- Using the command line:
|
||||
- [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them.
|
||||
|
||||
3. Install or update to **Node.js v16**. For more information, see [the development guide](contributing/development.md).
|
||||
2. Install or update to **Node.js v16**. For more information, see [the development guide](contributing/development.md).
|
||||
|
||||
4. Create a working branch and start with your changes!
|
||||
3. Create a working branch and start with your changes!
|
||||
|
||||
### Commit your update
|
||||
|
||||
|
||||
@@ -10,9 +10,7 @@ It runs on macOS, Windows, and Linux environments.
|
||||
|
||||
You'll need Node.js version 16 to run the site. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](https://github.com/nodenv/nodenv#readme) for instructions on switching Node.js versions.
|
||||
|
||||
You'll want to [install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage).
|
||||
|
||||
Once you've installed Node.js (which includes the popular `npm` package manager) and Git LFS, open Terminal and run the following:
|
||||
Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/github/docs
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
export const namePrefix = 'github-docs'
|
||||
export const maxContentLength = 5000
|
||||
|
||||
export default {
|
||||
// to reduce the size of our enormous search index, we limit the
|
||||
// content and record size for translated articles
|
||||
maxContentLength,
|
||||
namePrefix,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copies certain directories over to docs-internal-test and pushes. Useful for debugging actions
|
||||
# Doesn't copy over git lfs files (.json.br), content/, and data/ directories
|
||||
# Doesn't copy over content/ and data/ directories
|
||||
|
||||
echo "Make sure to run this script in the root path of docs-internal!"
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
import { render } from 'cheerio-to-text'
|
||||
|
||||
import { maxContentLength } from '../../lib/search/config.js'
|
||||
|
||||
// This module takes cheerio page object and divides it into sections
|
||||
// using H1,H2 heading elements as section delimiters. The text
|
||||
// that follows each heading becomes the content of the search record.
|
||||
@@ -10,7 +8,7 @@ import { maxContentLength } from '../../lib/search/config.js'
|
||||
const ignoredHeadingSlugs = ['in-this-article', 'further-reading', 'prerequisites']
|
||||
|
||||
export default function parsePageSectionsIntoRecords(page) {
|
||||
const { href, $, languageCode } = page
|
||||
const { href, $ } = page
|
||||
const title = $('h1').first().text().trim()
|
||||
const breadcrumbsArray = $('[data-search=breadcrumbs] nav.breadcrumbs a')
|
||||
.map((i, el) => {
|
||||
@@ -81,15 +79,6 @@ export default function parsePageSectionsIntoRecords(page) {
|
||||
console.warn(`${objectID} has no body and no intro.`)
|
||||
}
|
||||
|
||||
// These below lines can be deleted (along with the `maxContentLength`
|
||||
// config) once we've stopped generating Lunr indexes on disk that
|
||||
// we store as Git LFS.
|
||||
if (!process.env.ELASTICSEARCH_URL) {
|
||||
if (languageCode !== 'en' && body.length > maxContentLength) {
|
||||
body = body.slice(0, maxContentLength)
|
||||
}
|
||||
}
|
||||
|
||||
const content =
|
||||
intro && !body.includes(intro.trim()) ? `${intro.trim()}\n${body.trim()}`.trim() : body.trim()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user