-
Notifications
You must be signed in to change notification settings - Fork 42
librarian: doc needs update for commit flag #2495
Copy link
Copy link
Closed
Milestone
Description
Documentation does not mention of "commit" flag for generate.
And comment for the flag only mentions release:
librarian/internal/librarian/flags.go
Lines 42 to 46 in 31a496d
| func addFlagCommit(fs *flag.FlagSet, cfg *config.Config) { | |
| fs.BoolVar(&cfg.Commit, "commit", false, | |
| `If true, librarian will create a commit for the release but not create | |
| a pull request. This flag is ignored if push is set to true.`) | |
| } |
Whereas
push description includes both commit and push:librarian/internal/librarian/flags.go
Lines 88 to 93 in 31a496d
| func addFlagPush(fs *flag.FlagSet, cfg *config.Config) { | |
| fs.BoolVar(&cfg.Push, "push", false, | |
| fmt.Sprintf(`If true, Librarian will create a commit and a pull request for the changes. | |
| A GitHub token with push access must be provided via the | |
| %s environment variable.`, config.LibrarianGithubToken)) | |
| } |
But code honors a commit flag and will not commit if not provided.
librarian/internal/librarian/generate.go
Lines 144 to 160 in 31a496d
| commitInfo := &commitInfo{ | |
| branch: r.branch, | |
| commit: r.commit, | |
| commitMessage: "feat: generate libraries", | |
| failedLibraries: failedLibraries, | |
| ghClient: r.ghClient, | |
| idToCommits: idToCommits, | |
| prType: generate, | |
| push: r.push, | |
| repo: r.repo, | |
| sourceRepo: r.sourceRepo, | |
| state: r.state, | |
| workRoot: r.workRoot, | |
| failedGenerations: failedGenerations, | |
| } | |
| return commitAndPush(ctx, commitInfo) |
librarian/internal/librarian/command.go
Lines 332 to 334 in 31a496d
| func commitAndPush(ctx context.Context, info *commitInfo) error { | |
| if !info.push && !info.commit { | |
| slog.Info("Push flag and Commit flag are not specified, skipping committing") |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels