Skip to content

Sharepoint support#702

Merged
sjaiswalh merged 31 commits into
mainfrom
feature/sharepoint-support
Mar 27, 2026
Merged

Sharepoint support#702
sjaiswalh merged 31 commits into
mainfrom
feature/sharepoint-support

Conversation

@sjaiswalh

Copy link
Copy Markdown
Collaborator

No description provided.

sjaiswalh added 30 commits March 9, 2026 18:49
- Revert dashboard new-features-banner to original dismissible feature banner
- Revert isShown logic to localStorage-based (was hardcoded to 'return true')
- Remove permanent-migration-banner CSS and pulseRed animation from dashboard.scss
- Delete document/sidebar/migration-banner component (hbs + ts)
- Remove MigrationBanner reference from document/sidebar.hbs
- Add MERGE_PLAN.md for sharepoint merge tracking
- Upgrade go.mod to Go 1.24.0 with SharePoint dependencies
- Add back Google-specific deps (cloud.google.com/go, genproto)
- Copy 20 new packages: microsoftgraph, sharepointhelper, auth/microsoft,
  auth/oidcalb, auth/sharepoint, middleware, etc.
- Copy 55 differing files from hermes-sharepoint
- Merge Document model (Option A): dual GoogleFileID + FileID fields
  - Add GetFileIdentifier() and hasNoFileID() helpers
  - Add BeforeCreate validation hook
  - Fix all 7 redundant vet errors (d.FileID == '' && d.FileID == '')
  - Update query patterns for dual-field lookups
- Merge auth.go: 4-tier auth (OIDC ALB > Okta > Microsoft > Google)
- Add Okta backward compat in config.go
- Copy hermes-plugin for Go embed compilation
- All builds pass (go build ./..., go vet ./...)
- pkg/models tests pass
- Replace web/ entirely with hermes-sharepoint frontend (Ember 3.28 -> 5.8)
- Clean hermes-plugin manifests: keep only manifest.xml
- Remove enterprise AppDomain (hashicorp.com) from manifest.xml
- Update Makefile: add plugin/build and build/linux targets
- Build verified: go build ./... passes
- Add Dockerfile (public alpine:3.21.5, no enterprise mirror)
- Update ci.yml: Go 1.24, add plugin build, workflow_dispatch
- Add docker-build-push.yml (generic GHCR, no enterprise doormat)
- Merge CODEOWNERS: both @hashicorp-forge/labs and @hashicorp/team-scale-performance-eng
- Add SharePoint config templates to configs/config.hcl
- Remove hashicorp.services from CORS allowlist (cors.go)
- Fix draft doc number comparison bug: remove .docx from regex replacement
- Fix v1 test to use SP draft format (ABC-xxx.docx)
- Fix v2 test to use original format (ABC-???) matching v2 regex
- All tests pass: go build ./... && go test ./...
…gin/

macOS cp -R did not copy hidden files when target directory existed.
This restores all missing dotfiles (.eslintrc.js, .gitignore, .yarnrc.yml,
tsconfig.json, postcss.config.js, testem.js, etc.) and hermes-plugin source
files (package.json, src/, assets/, webpack.config.js, manifest.xml, etc.).

Removes nested src/src/ and assets/assets/ created by cp -R on existing dirs.
Removes enterprise AppDomain from hermes-plugin/manifest.xml.

Verified: make build passes (web + plugin + go), go test ./... all pass.
…template

- Remove hermes-plugin/dist/ from git tracking (build artifact, gitignored)
- Remove unused microsoft_auth/microsoft_graph blocks from configs/config.hcl
- Update email from_address to Microsoft tenant user
Restored in documents.go:
- IsLocked check (Google-only guard) in PATCH handler
- Added hcd import

Restored in drafts.go:
- IsLocked check (Google-only guard) in PATCH handler
- Owner photo lookup via SearchPeople in POST handler
- Create-as-user flow with impersonation + MoveFile + TemporaryDraftsFolder
- Ownership transfer email with SearchPeople name lookups
- Added imports: context, hcd, jwt, drive/v3, option

Restored in reviews.go:
- IsLocked check (Google-only guard) before database transaction
- MoveFile to DocsFolder with revert function on review creation
- Added hcd import
- Empty publishReaderGroups and publishGroupDisplayNames in documents.go
- Use GetFileIdentifier() instead of .FileID for DB-loaded documents
  in documents_related_resources.go and projects_related_resources.go
- Fix model Create() Where clauses to dynamically query google_file_id
  or file_id based on which field is populated
- Wrap SharePoint-only filename sanitization in srv.SharePoint != nil
  conditional in drafts.go
Production code fixes (16 files):
- Restore Google domain sharing in drafts_shareable.go (wrapped in useSharePoint guard)
- Restore createGoogleShortcut in v2/reviews.go alongside createSharePointShortcut
- Restore email notifications in v1/reviews.go with EmailSenderAdapter
- Restore entire Google indexing path (runGoogleWorkspace) in indexer.go
- Fix validate() to require at least one backend, not mandate SharePoint
- Restore auth conditional in server.go (OidcAlb/Okta web auth)
- Fix .FileID bugs to use GetFileIdentifier() in 5 API handler files (v1+v2)
- Fix FileID-only validation to use hasNoFileID() in document_review.go,
  document_group_review.go, document_related_resource_external_link.go
- Add dual-provider design comments in document.go, document_file_revision.go
- Fix new-owner email in drafts.go to be dual-backend aware

Test files (8 files):
- Revert test files to use GoogleFileID (restore original Google path coverage)
- Fix document_file_revision_test.go for FileRevisionID (new PK) and pointer type
- Add TestDocumentDualBackend: parameterized Create/Get/Upsert/Delete for both backends
- Add TestDocumentDualBackendCoexistence: Google + SharePoint docs coexist,
  independent CRUD, GetFileIdentifier(), hasNoFileID() validation
- Add TestDocumentReviewDualBackend: review Get/Update/Find for both backends
- Add TestDocumentGroupReviewDualBackend: group review Get/Find for both backends
- Add TestDocumentFileRevisionDualBackend: revision Create/Find for both backends

All changes compile clean (go build ./... and go vet ./pkg/models/...)
@sjaiswalh sjaiswalh requested a review from a team as a code owner March 27, 2026 09:43
@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@sjaiswalh sjaiswalh merged commit d18e210 into main Mar 27, 2026
1 of 2 checks passed
@sjaiswalh sjaiswalh deleted the feature/sharepoint-support branch March 27, 2026 11:27
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