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

Another attempt to replace go-bindata with //go:embed #460

Merged
merged 3 commits into from
Jun 8, 2023

Conversation

moson-mo
Copy link
Contributor

@moson-mo moson-mo commented May 6, 2023

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

The PR fulfills these requirements:

  • All tests are passing?
  • New/updated tests are included?
  • If any static assets have been updated, has ui/bindata.go been regenerated?
  • Are there doc blocks for functions that I updated/created?

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Description:

Another attempt to replace go-bindata with go embed. ;)

Now the downside using embed package is that one needs to run the npm/npx steps prior to go compilation to generate the web-UI files to be embedded (unless these are also to be stored in this repo, similar to what is done with bindata.go)

With this PR in it's current state we're assuming the webpack output is not stored in this repo.
Thus, unfortunately, a simple go install... won't work anymore.

Imho those webpack artifacts should not be in the repo really. (In whatever form, be it bindata.go or just the files)

Changes

  • Replace go-bindata with //go:embed
  • Amend README with build instructions
  • Amend Github workflow jobs
  • Amend Dockerfile

@moson-mo moson-mo marked this pull request as ready for review May 6, 2023 22:15
@moson-mo moson-mo changed the title [DRAFT] Another attempt to replace go-bindata with //go:embed Another attempt to replace go-bindata with //go:embed May 6, 2023
Copy link
Contributor

@dschott68 dschott68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally and with Docker build. LGTM and thank you!

@dschott68 dschott68 merged commit 93eddc9 into hound-search:main Jun 8, 2023
rwtnorton added a commit to EasyPost/hound that referenced this pull request Dec 2, 2024
Summary:
Merge pull request hound-search#387 from corbosman/main

Adds support for Github webhooks, so that committing to a repository sends a webhook request to hound, which then re-indexes the repository. Per contributor @corbosman, this enabled his org to use Hound with thousands of repos and keep indexes fresh.

Omit ports in constructed URL (hound-search#383)

Improve accessibility (hound-search#398)

* Resolve WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2

* Resolve WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.InputText.Name

* Resolve WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Button.Name

* Improve stats contrast

* Improve advanced text contrast

* Improve repo title contrast

* Improve contrast in advanced section

* Improve line number contrast

* Improve excluded files contrast

* Improve "load all" button contrast

Automatically build docker image and publish to ghcr.io (hound-search#401)

* Feat: Use goreleaser

* Feat: Add docker build, remove goreleaser

* Fix: Add image name

* Feat: Use ghcr.io and build-push-action@2

* We try again

* Trying yet again

* Fix: Use actor and GITHUB_TOKEN

* Fix: Use github.actor in image tag path

* Fix: use github.repository_owner instead of github.actor

When you have an organisation, github.actor != github.repository_owner

Co-authored-by: Jone Marius Vignes <[email protected]>

Update default-config.json (hound-search#391)

* Update default-config.json

* Update default-config.json (ref: main)

Add hyperlinks to repository root (hound-search#396)

Add literal search option (hound-search#397)

* Add literal search option

* Pull EscapeRegExp into common.js

* Add db/ to Jest ignore patterns

* Test EscapeRegExp() matches its input

* Test vacuous EscapeRegExp

Give repo links a target of blank (hound-search#404)

Add rel="noopener noreferrer" to _blank links

Adding pull request template

Update README to use ghcr.io

Currently, the README suggests running an outdated version of hound. There's been a lot of good work done in the past [3 years](https://hub.docker.com/r/etsy/hound/tags).

The container registry was updated in hound-search#401

Add latest tag

Fix typo

Remove default branch warning

It's been almost a year since we renamed the default branch to `main`. The warning can probably be taken out.

ui: collapse and expand files Fixes hound-search#182

Fix the linter, update golang versions. (hound-search#422)

* golangci to v3 per https://stackoverflow.com/questions/71758856/github-action-for-golangci-lint-fails-with-cant-load-fmt

* add with latest

* add setup-go and specific version

* update version

* Use only one actions/checkout, previous version of go linter

The linter (`golangci`) and the action that runs the linter (`golangci/golangci-lint-action`) are separate. The linter seems to be running but finding new errors, so this change might be enough to temporarily squash those.

* Drop go 1.12 and 1.13,  add 1.17 and 1.18

There's a new golang version every 6 months. The latest two golang versions are supported officially. I'm keeping 1.14 around for now since it was previously the latest supported version.

* Only run linter on 1.17

The 1.18 linter has import issues that we'll investigate later.

* update version

* nolint

* nolint

* nolint

* nolint

* update lint to go 1.18

Co-authored-by: David Schott <[email protected]>

chore: Bump version const

Otherwise, `houndd -version` spits out the wrong version.
Anticipating the patch release that this commit will go out with.

Add config.json to .gitignore

Add .dockerignore

Adding the setup-qemu-action to enable multiplatform docker builds from github actions

Attempt auto-generated files

Add badge

refactor to use filenames and no regex

add config override

add some docs

add config test

Update version for release

Update Makefile to reflect the move to a go module.

Convert Signal to es6 class. (hound-search#440)

Upgrade all devDependencies in webpack build. (hound-search#439)

Corrected a typo in readme.md

chore: add manual install option (hound-search#446)

* chore: add another option to install hound

* chore: format

* chore: add $GOPATH/bin in installation

* fix indentation for bulleted list

---------

Co-authored-by: dschott <[email protected]>

kick off for pull requests (hound-search#448)

Add my name to the README

change Advanced options div ID

Merge pull request hound-search#449 from hound-search/jswensen-bug-385

[Issue 385] change Advanced options div ID

Update list of maintainers with additional volunteers (hound-search#451)

Add `display-name` option to customize/disambiguate output (hound-search#454)

Rebuild ui/bindata.go

It seems that ui/bindata.go has got out of sync; the changes from
d25b221 aren't applying and the
advanced dialog box is always showing, as the div doesn't match.

Regenerating this seems to make things work

Closes: hound-search#453

bump the version (hound-search#457)

Update alpine to 3.16 and switch from bzr to breezy (hound-search#429)

Co-authored-by: David Schott <[email protected]>

Add support for manually setting a limit on results

* Added a query parameter to allow user to specify max results, rather
  than a hard limit at 5000, for each index.
* Added support for a default max result limit in the config.  If unset,
  it remains at the former default of 5000 results per index.
* Fixed issue where no results would be returned if the limit was
  exceeded - now it simply returns the results up to the limit.

Add tests for parse min/max bounds

Merge pull request hound-search#464 from hound-search/AlexTalks/tests

Add support for manually setting a limit on results(copy)

Another attempt to replace go-bindata with //go:embed (hound-search#460)

* switch from go-bindata to embed

Signed-off-by: moson-mo <[email protected]>

* bump semver dependency to v4

Signed-off-by: moson-mo <[email protected]>

* amend workflow jobs for go-embed switch

Signed-off-by: moson-mo <[email protected]>

---------

Signed-off-by: moson-mo <[email protected]>

Remove jquery from hound

Merge pull request hound-search#465 from hound-search/iagu/remove-jquery

Remove jquery from hound

Add fake source

Copy with rsync

fake: Do not copy, use a symlink

Rebase on the latest version

Replace tar hashing with golang.org/x/mod and add options

Rename vcs driver from "fake" to "local"

Rename "detect-changes" to "watch-changes"

Update the README

Clarify a few things in the comments

Suppress the linting error

Prevent line numbers from being copied in search results

Merge remote-tracking branch 'mainline/main' into sync_with_mainline

support phab repo links

Reviewers: #risk_assessment_framework!

Subscribers: #risk_assessment_framework

Differential Revision: https://phab.easypo.net/D61327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants