Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Oct 27, 2022

This PR removes the references to Package Storage V1:

  • Removes the subcommands to promote and publish packages and its dependencies
    • Commands are kept but just a deprecated message will be shown to the users. Example:
       $ elastic-package publish
      elastic-package has been installed.
      Publish the package
      DEPRECATED: Package candidates to the Package Storage v2 are published using Jenkins jobs. README: https://github.com/elastic/elastic-package/blob/main/docs/howto/use_package_storage_v2.md
      
  • Removes references to snapshot and staging environments:
    • Update the status command of a package
  • Update README accordingly

This PR also adds some tests to the status command about the local environment and pending changes not merged yet.

Example of output for the status subcommand:

 $ elastic-package status
elastic-package has been installed.
Package: elastic_agent
Owner: elastic/elastic-agent-control-plane
Package Versions:
+-------------+---------+---------+---------------+--------------------------------+
| ENVIRONMENT | VERSION | RELEASE |     TITLE     |          DESCRIPTION           |
+-------------+---------+---------+---------------+--------------------------------+
| Local       | 1.3.5   | GA      | Elastic Agent | Collect logs and metrics from  |
|             |         |         |               | Elastic Agents.                |
+-------------+---------+---------+---------------+--------------------------------+
| Production  | 1.3.5   | GA      | Elastic Agent | Collect logs and metrics from  |
|             |         |         |               | Elastic Agents.                |
+-------------+---------+---------+---------------+--------------------------------+

To be merged after the switch to Package Storage V2.

mrodm added 6 commits October 26, 2022 17:13
Readme updated without the promote and publish commands. Removed also
the reference to Github Authorization tokens since there is no need to
communicate from elastic-package to Github to create Pull Requests.
@mrodm mrodm requested a review from a team October 27, 2022 10:22
@mrodm mrodm self-assigned this Oct 27, 2022
changelogTable = append(changelogTable, formatChangelogEntry(change))
}
table := tablewriter.NewWriter(os.Stdout)
table := tablewriter.NewWriter(w)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update to use the same writer as the other table, so it can be tested in cmd/status_test.go

Comment on lines -287 to -316
### GitHub authorization

The `promote` and `publish` commands require access to the GitHub API to open pull requests or check authorized account data.
The tool uses the GitHub token to authorize user's call to API. The token can be stored in the `~/.elastic/github.token`
file or passed via the `GITHUB_TOKEN` environment variable.

Here are the instructions on how to create your own personal access token (PAT):
https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token

Make sure you have enabled the following scopes:
* `public_repo` — to open pull requests on GitHub repositories.
* `read:user` and `user:email` — to read your user profile information from GitHub in order to populate pull requests appropriately.

After creating or modifying your personal access token, authorize the token for
use of the Elastic organization: https://docs.github.com/en/github/authenticating-to-github/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As elastic-package should not create any PRs, I think this section is not needed anymore. Is there any other usage for this token ? @elastic/ecosystem

@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 27, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-12-02T13:38:02.139+0000

  • Duration: 33 min 26 sec

Test stats 🧪

Test Results
Failed 0
Passed 869
Skipped 0
Total 869

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 27, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (34/34) 💚
Files 67.188% (86/128) 👍 0.264
Classes 61.957% (114/184) 👍 0.129
Methods 48.761% (374/767) 👍 1.185
Lines 31.929% (3396/10636) 👍 1.378
Conditionals 100.0% (0/0) 💚

@mrodm mrodm changed the title Remove code package storage v1 Remove code related to Package Storage v1 and update README Oct 28, 2022
@mrodm mrodm marked this pull request as ready for review November 7, 2022 16:48
Added promote and publish commands again with all the flags so commands
will not fail by unknown command or unknown flag. Instead these commands
will show a deprecated message
@mrodm mrodm requested a review from jsoriano November 21, 2022 11:52
@mrodm mrodm merged commit 561afc8 into elastic:main Dec 12, 2022
@mrodm mrodm deleted the remove_code_package_storage_v1 branch December 12, 2022 10:52
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.

3 participants