Skip to content

chore: change the way we look for upstream remote#7230

Merged
maribethb merged 3 commits intoRaspberryPiFoundation:developfrom
maribethb:fix-remote
Aug 4, 2023
Merged

chore: change the way we look for upstream remote#7230
maribethb merged 3 commits intoRaspberryPiFoundation:developfrom
maribethb:fix-remote

Conversation

@maribethb
Copy link
Copy Markdown
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes the fact that npm run updateGithubPages did not run for me

Proposed Changes

Changes the methodology for finding a git remote name. The old way doesn't work for me because the output of git remote -v looks like this for me (snippet):

upstream		git@github.com:google/blockly.git (fetch)

(ok that probably didn't work, but it seems like there's an extra tab between the name and the url, idk why)
Also, the url text the old way was looking for doesn't work for me because I use SSH for git, not HTTPS.

Behavior Before Change

Assumes the user is using https. Assumes there is only one tab in the git output :/

Behavior After Change

Hopefully finds the upstream remote name for everyone!

Reason for Changes

I'm trying to update github pages

Test Coverage

Prettttty sure this works locally, but hard to test the entire process given that the updateGithubPages script stashes and resets git branches. I tested by commenting out all the parts of the task except the one that fetches the remote.

Documentation

no

Additional Information

  • Not sure this would work for windows. But also not sure that matters because non-core-team members would not be able to run this command anyway as they don't have access to push to the google/blockly repo. Also not sure the old method worked on windows. I don't know much about windows in general.
  • Could also maybe solve this by not doing a git reset. I thought about deleting the gh-pages branch locally, checking out a new copy based on develop (which you can do via specifying the remote URL instead of the name), then force pushing to overwrite the remote version of gh-pages branch at the end. I think that would work. But this is less of a change and I think this should also work, so we'll see?

@maribethb maribethb requested a review from a team as a code owner June 30, 2023 00:14
@github-actions github-actions Bot added the PR: chore General chores (dependencies, typos, etc) label Jun 30, 2023
@maribethb maribethb requested a review from cpcallen June 30, 2023 00:15
@maribethb
Copy link
Copy Markdown
Contributor Author

@cpcallen can you run git remote -v | grep "google/blockly" | cut -f1 | head -1 and make sure it find the name properly for you

Comment thread scripts/gulpfiles/git_tasks.js Outdated
maribethb and others added 2 commits June 30, 2023 12:25
thanks christopher

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
@cpcallen
Copy link
Copy Markdown
Collaborator

cpcallen commented Jul 12, 2023

@maribethb: are you thinking of doing more work on this making some additional changes to this PR, or shall we merge it?

@maribethb maribethb merged commit 2a2b3b3 into RaspberryPiFoundation:develop Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: chore General chores (dependencies, typos, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants